I am making program with no window, so i didnt registreted WNDCLASSEX and all that stuff about window

but what i want is to recive a few messages directrly to main thread message queue from my dll,
so AFAIK I need to send message from dll to exe using PostThreadMessage but this doesnt work, this function returns 0
i am not sure where is the problem becouse GetLastError after PostThreadMessage says operation is completed sucessfully

anyway any help or source on this would be great
Posted on 2002-04-24 16:16:21 by Mikky
PSDK has the following to say about PostThreadMessage:

The function fails if the specified thread does not have a message queue. The system creates a thread's message queue when the thread makes its first call to one of the User or GDI functions.

I assume that GetMessage would qualify as a User function (as it
is in user32.dll), but... dunno.

If you just want to send data between threads, there are (imo) better
ways. You could set up a pipe, memory mapped files, or (easier
and better :)) some global data protected with a synchronization
object, like a critical section. Or event flagging if the thread only
has to run when there's input data.
Posted on 2002-04-25 05:49:12 by f0dder
yup in order to windows create my message queue on the beggining of the program I called MessageBox
buts not a problem

i dont actually want to send/recive data between processes, but just a few messages that will notify my .exe program that somthing is happend in dll
Posted on 2002-04-25 08:37:56 by Mikky
Again.. event, CRITICAL_SECTION protected global var, or callback.
That's probably the easiest ways, but all of course depending on
your program architecture.
Posted on 2002-04-25 08:42:45 by f0dder