I have a C++ dll with a header having the following struct:

struct TData
	DWORD  m_Command;
	BYTE   m_Option;
    	char   m_Message[300];

The dll also has a callback function MessageReceived that takes TData as a parameter. The function fills in the m_Message with some data and returns.

in VB6, I have a similar type:

Public Type TData
    m_Command As Long
    m_Option As Byte
    m_Message As String
End Type

when the MessageReceived is called, I have an error:
The instruction at ........ referenced memory at ........ The memory could not be "written"
I'm assuming that this is because I'm not initializing a buffer for m_Message. Is there a way I can do this, since the MessageReceived is a callback, I do not create my TData to pass it in the function. Help.

7 Years
Discussion Span
Last Post by selvaganapathy
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.