PostMessage from a DLL
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
Hi,
I'm trying to write a DLL that have to manage serial comunication and
send results to another application.
Basically the DLL read data from serial port and when recognize a full
frame it compute some values from the read stream and send it to the
application.
All works fine when I put the read/send stuff in a class
"CComunication" that belongs to the project. When I make a DLL with
this class I got errors. I have tryed with MFC Extension and also
Regular DLL but the application still crash.
If I comment the post message istruction the programs doesn't crash.
pFrame = new CFrame;
::PostMessage(m_pWnd->m_hWnd, m_iMessage, (WPARAM) (pFrame), 0);
where m_pWnd is initialized in the exe dialog with values "this" and
m_iMessage is set to WM_APP+1.
I have tryed also with Postmessage
::PostMessage(m_pWnd->m_hWnd, m_iMessage,0, 0);
without results.
What can I do ?
Thanks in Advance
.
Relevant Pages
- Re: Multiple DLL, multiple THREADS, multiple applications or something else?
... Once DLL is loaded and serial port opened and DLL left in its own ... especially if you re-use the buffers by ... > respond to query from devices on serial port) on a notify base ... ... (borland.public.delphi.language.objectpascal) - Re: Events do not fire when used in COM DLL
... This may be a problem in a COM dll but I don't know if it ... this creates the serial port component ... Enter a wait loop (tried Application.Processmessages and also ... The first button event loads the DLL and brings up a dialogue form. ... (borland.public.delphi.language.objectpascal) - Re: DLL pass vector by value crash
... By the way, if you crash with an access violation, it is considered INCREDIBLY IMPORTANT ... When the above code is executed in my large MFC exe and when testFuncis ... no crash occurs in either config. ... If testDllClass were defined in the large MFC exe rather than a dll, ... (microsoft.public.vc.mfc) - Re: JNI EXCEPTION_ACCESS_VIOLATION
... I am not experienced in coding a dll and access it via ... Java, but, I would say to you that, if you do not mind, try to use the ... The code will crash when running under XP Service Pack 2 ... The code will NOT crash when running under Windows 2000 Service Pack 4 ... (comp.lang.java.programmer) - Re: Exporting global data from a DLL to an EXE
... like everyone else you use the obscure and meaningless word "crash" without ... Avoid making variables in a DLL visible. ... > - In the EXE I have used the keyword DLLIMPORT ... MVP Tips: http://www.flounder.com/mvp_tips.htm ... (microsoft.public.vc.mfc) |
|