Click here to Skip to main content
15,902,634 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

In a DLL, I use GlobalAlloc to allocate my data structure. And pass the pointer CPtrArray *m_ptr using
::PostMessage(hMainProgram, WM_MY_REGISTERED_MESSAGE, WM_MY_DATA, (LPARAM) m_ptr);

In main program, it can get all the data of CPtrArray, but when the program close, it will stop at assembly int 3

Thanks
Posted

1 solution

If your "main program" is running in another process
you should use the Shared Memory (or COM transfer) :)

Elsewise (the "main program" is running in the same process)
you could pass an allocated by new pointer
and delete after the usage in the reaction function :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900