I have a problem and I don't know why I'm having such a hard time solving it.
The problem comes from a VB6 COM object that raises an event periodically. The call back method for the event (the method that handles the event) has a strange signature. It looks like this:
onTheEvent(ByRe f x As AStructureType, ByRef y As Boolean)
I need to retrieve the information stored in "x" but sometimes the next event is raised before I can retrieve this information. Since it's being passed in ByRef the underlying memory for the structure is changed and ...well...thing s get really messed up.
How do I prevent the memory from being changed by the COM object (lock it) while I am using that memory?
(PS...if you haven't already gathered, it's a Structure, not an Object that I'm working with)
Thanks,
-Frinny
The problem comes from a VB6 COM object that raises an event periodically. The call back method for the event (the method that handles the event) has a strange signature. It looks like this:
onTheEvent(ByRe f x As AStructureType, ByRef y As Boolean)
I need to retrieve the information stored in "x" but sometimes the next event is raised before I can retrieve this information. Since it's being passed in ByRef the underlying memory for the structure is changed and ...well...thing s get really messed up.
How do I prevent the memory from being changed by the COM object (lock it) while I am using that memory?
(PS...if you haven't already gathered, it's a Structure, not an Object that I'm working with)
Thanks,
-Frinny
Comment