A
arothberg
I have a legacy application using a VC++ application and Excel VBA.
The summary of the application flow is as follows:
Excel VBA code would retrieve a needed Long value from within the active
sheet and pass it to a VC++ application via a PostMessage API call to the
VC++ application's main window, passing the Long value as the lParam.
Now I need to change the implementation to pass a string. I am constrainted
to have to continue to use PostMessage to communicate with the VC++
application. I tried using GlobalAlloc() in the Excel VBA code where the
string would be stored in the heap (as a byte array) and then the HGLOBAL
would be passed as the lParam. However, it appears to be garbage when I try
to retrieve the data (using GlobalLock()) in the VC++ application.
I'm trying to avoid having to use a physical file (i.e. with the file name
being an integer passed as an lParam).
Any other options to get this string over to the VC++ application where I'm
constrainted to only pass a long via an lParam in PostMessage. (I cannot use
SendMessage).
Thanks in advance.
The summary of the application flow is as follows:
Excel VBA code would retrieve a needed Long value from within the active
sheet and pass it to a VC++ application via a PostMessage API call to the
VC++ application's main window, passing the Long value as the lParam.
Now I need to change the implementation to pass a string. I am constrainted
to have to continue to use PostMessage to communicate with the VC++
application. I tried using GlobalAlloc() in the Excel VBA code where the
string would be stored in the heap (as a byte array) and then the HGLOBAL
would be passed as the lParam. However, it appears to be garbage when I try
to retrieve the data (using GlobalLock()) in the VC++ application.
I'm trying to avoid having to use a physical file (i.e. with the file name
being an integer passed as an lParam).
Any other options to get this string over to the VC++ application where I'm
constrainted to only pass a long via an lParam in PostMessage. (I cannot use
SendMessage).
Thanks in advance.