|
Under Windows 2000, you type "net send %computername% 12345" in Command Prompt. This will create a Messagebox titled "Messagener service". I can not log the message of this window. Nothing will display. Why? the process of this window is "CSRSS", which is a kernal process I believe, Is that the reason I can see its message?
What I want to do is send message to this window to simulate a mouse click on the OK button.
SendMessage(hwnd, WM_COMMAND, 1, 0);
I tried SendMessage, PostMessage, PostThreadMessage and Send NotifyMessage, none of them work!
Please
|
|
|
|
|
That is curious. However, a quick test to send WM_GETFONT shows that the window is responding. What happens if you send a mouse click to the window's button? Or you could also try to send a WM_SETFONT to the window to see if it does anything.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Has anyone come across any resources for doing a webcam application ala cuseeme style. I have seen a couple things on Codeproject but it's not quite what I'm looking for.
Thanks!
|
|
|
|
|
So what are you looking for that you haven't found? Most webcams require use of Video for Windows, which is somewhat difficult. You might look at Microsoft's Vision SDK.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
I made a class to manage a list of connections to my server, u can call AddConnection and RemoveConnection to add or remove a connection given the socket handle and/or thread handle.
This is the struct that contains all the data for each connection so far:
struct ClientConnection
{
HANDLE hThread;
SOCKET s;
ClientConnection(): hThread(NULL),s(INVALID_SOCKET)
{
}
~ClientConnection()
{
}
};
then i define a type like this:
typedef list <ClientConnection*> CL;
typedef CL::iterator CLI;
and declare a new private variable in my class like this:
CL cl;
Now the code to remove a connection from the list is this:
void ConnectionManager::RemoveConnection(SOCKET _sd)
{
CLI cli;
for ( cli = cl.begin(); cli != cl.end(); ++ cli )
{
if((*cli)->s==_sd)
{
cl.erase(cli);
}
}
}
But for some reason the program crashes when it tries to erase the entry in the list... And i dont know why, if i just delete it, then it works fine but then the entry isnt actually gone. How do i get rid of the entry??? so that for example if i have 3 connections and i remove the 2nd, the 3'rd one will take the seconds place in the list?..
Thanks
Kuniva
--------------------------------------------
|
|
|
|
|
nvm i found the solution by pure luck
shows me i shouldn't come running here too quickly :P
Kuniva
--------------------------------------------
|
|
|
|
|
|
yup lol, sorry its just how i'm used to saying it from the game i play.
Kuniva
--------------------------------------------
|
|
|
|
|
Can any one tell me this:
there are rules for the IDR_MANIFEST and IDR_MAINFRAME , correct?
this resources must have a particular value?
normally there are ID,IDI,IDC,IDD,IDR,IDS,IDB...
can they have sequential values or they have to be divided in ranges?
which type of resources corresponds to each one of this macros?
_APS_NEXT_RESOURCE_VALUE
_APS_NEXT_COMMAND_VALUE
_APS_NEXT_CONTROL_VALUE
_APS_NEXT_SYMED_VALUE
I know that there are resource renumber tools out there, but ...
MSN:maxsnts@hotmail.com
|
|
|
|
|
1. No, not really, although IDR_MAINFRAME is normally 100, and will "just happen" to be the lowest numbered ICON resource too, so that your app has that as it's default icon.
IDR_MANIFEST applies to VC7 and up, and I don't have that here, so can't remember.
2. The ids can be almost any value, but there are some SDK imposed limits, and MFC specifies others. Check out the TNxxxx docs in the user guide which explains these.
3. CONTROL = dialog control
COMMAND = menu item/toolbar button
RESOURCE = icon/bitmap/menu
Generally speaking I tend to allocate ranges for different parts of a project, and then manually override the values anyway.
Steve S
|
|
|
|
|
Steve S wrote:
Generally speaking I tend to allocate ranges for different parts of a project, and then manually override the values anyway.
WOW! I have think of that to , but in a big project that will become a very big task
MSN:maxsnts@hotmail.com
|
|
|
|
|
Hi,
I'm exporting this class form a dll:
#ifndef _DLL_H_ <br />
#define _DLL_H_ <br />
<br />
#if BUILDING_DLL <br />
# define DLLIMPORT __declspec (dllexport) <br />
#else /* Not BUILDING_DLL */ <br />
# define DLLIMPORT __declspec (dllimport) <br />
#endif /* Not BUILDING_DLL */ <br />
<br />
<br />
class DLLIMPORT AES <br />
{ <br />
public: <br />
AES(); <br />
virtual ~AES(void); <br />
<br />
private: <br />
<br />
}; <br />
#endif /* _DLL_H_ */ <br />
and this is the programm, that uses this dll:
#include <iostream> <br />
#include <stdlib.h> <br />
#include "..\AES\dll.h" <br />
<br />
using namespace std; <br />
<br />
int main(int argc, char *argv[]) <br />
{ <br />
HMODULE AESLibary = LoadLibrary("../AES/AES.dll"); <br />
if (AESLibary) <br />
printf("AES.DLL found!\r\n"); <br />
else <br />
printf("AES.DLL not found!\r\n"); <br />
<br />
<br />
AES myAES; <br />
<br />
system("PAUSE"); <br />
return 0; <br />
} <br />
but everytime I compile this program I get these errors:
[Linker error] undefined reference to `AES::AES()' <br />
[Linker error] undefined reference to `AES::~AES()' <br />
(generating the .dll file is no problem...)
can anybody tell me why?
thx
CND
|
|
|
|
|
You can not use dynamic loading (LoadLibrary) in this manner. For this statement
AES myAES; to work you must statically link with the .lib file that is produced with the DLL.
John
|
|
|
|
|
ok, but so I which manner can I use DLLs?
Is it possible to load dynamicly a class.
so to use IDEA.DLL if the user selects this DLL and AES.DLL if he selects this one.
This I important for me, because, I want to add crypto algorithms step by step, like plugins...
|
|
|
|
|
Check DelayLoad if want to do that...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Or use COM, with a standardised Interface.
|
|
|
|
|
Hi All,
I've read the articles here on CP about timers and their flaws, the quantization effects and so on, but I still can't understand this:-
My program needs to read data from my special hardware at 25Hz (period = 40ms).
I'm using a periodic multimedia timer with a callback to do the read, and I am using QueryPerformanceCounter to assess how accurately on the mark the callback got called.
Heres a chunk of the output of my program:-
23 40.12739 40.000000 +0.318480%
-8 40.13270 40.000000 +0.331750%
-36 40.12544 40.000000 +0.313591%
-43 40.13130 40.000000 +0.328258%
-31 40.12655 40.000000 +0.316385%
0 40.12683 40.000000 +0.317083%
29 39.12418 40.000000 -2.189552%
34 40.12823 40.000000 +0.320575%
15 40.12851 40.000000 +0.321274%
-14 40.13270 40.000000 +0.331750%
-46 40.1240. 40.000000 +0.311496%
-66 40.12879 40.000000 +0.321972%
-66 40.12963 40.000000 +0.324068%
-45 40.12711 40.000000 +0.317782%
-10 39.12725 40.000000 -2.181869%
Columns are: Reading from device, actual time gap in ms, intended timegap, percentile error in time gap
The fact that I get an error is of no suprise to me, and the fact that the sum of my errors is 0 is also no suprise. But, even if I run my program for an hour, I get this odd 8 sample pattern- 7 "+" errors, followed by one "-" error which is equal in magnitude to the previous 7 "+" errors. I don't understand why the pattern should be so uniform... Why are my time events always ~+0.31% out, except the 8th sample which is always ~-2.18%?
According to GetSystemTimeAdjustment(), my system clock period is 10 milliseconds. 40 milliseconds is a multiple of this?!?!
Also, I start my timer with :
timeBeginPeriod(tc.wPeriodMin);
timeSetEvent40,0,&CaptureProc,(DWORD) this,TIME_PERIODIC);
I know windows isn't realtime, but if I could achieve time accuracy of +/- ~.3% , 95% of samples, it would be good enough...
Any thoughts on why that pattern occurs? Or solutions?
Thansk
Jon
PS. WinXP Pro and Win2K give identical results.
Thanks
#include <beer.h>
|
|
|
|
|
I don't know about your particular situation.
Sorry.
But I can point you at a DirectMusic timer I use
for my midi sequencer.
It might beat the standard multimedia timer...
Over at http://groups.yahoo.com/group/MidiDev/join/
You'll need to look thru the archive for
dmtimer.h
Sorry. That's all i got...
...Steve
|
|
|
|
|
We have a little bit of problem with this CreateDIBBitmap.
We have been trying to copy image into memory and pasted on
control we have created for display, but seems like everytime
we do this on win2000 server, we get the function fails
returning NULL. But except this machine we don't have that
same problem. For this machine, we've tested with ATI 64MB,
32MB, 16MB, GeForce128MB for video card.
any information is helpfull.
Thanks,
shinya
|
|
|
|
|
Hello,
I'm using the MFCGrid and I want my code to respond to the user editing a cell.
It's a dialog based application. Looking at the demo app, it's looks like I should create the following mapping:
ON_NOTIFY(GVN_ENDLABELEDIT, IDC_GRID, OnGridEndEdit)
However, I am creating the Grid control dynamically in the code using
m_pGridCtrl->Create(rect, this, 100);
instead of binding it to a Custom Control on the dialog, therefore I don't have the equivelent of IDC_GRID.
Is there another way to bind the WM_NOTIFY message to a instantiated variable of the control.
Thanks,
John
|
|
|
|
|
In effect the Create() has done the binding for you. All you have to do is put
ON_NOTIFY(GVN_ENDLABELEDIT, 100, OnGridEndEdit)
in the message map (maybe using "IDC_GRID" might be better than just "100").
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
OOPs, I didn't realise that the third parameter was the resource ID, I thought it was some combination of default flags.
Thanks very much!
|
|
|
|
|
Friends,
I've two projects in a workspace. The main project is a dialog based application. The second project is a Win32 static library.
In the second project i include an *.rc file to add resouces in the project. Then i add a dialog box in the resource.
Now, i want to initiate the dialog box of my "static library project" from my main project. i.e if i click the OK button of my main application dialog, i want the modal dialog box that is present in the resource of static library project.
As such i am getting debug assertion failure. Can anyone tell me whats the reason. I am using Visual C++ 6.0
|
|
|
|
|
<edit>
Yes, i've set all the dependencies of projects
|
|
|
|
|
Resources must be put in modules (exe's or dll's).
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|