• Advertisement
Sign in to follow this  

C++ DLL CallBacks to VB.Net application lost

This topic is 3213 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, On a Windows CE device, I have a VB.Net program running, and a C++ DLL that hooks with the keyboard. This DLL seperates barcodes from normal key input. It works fine, until I open a certain form in my VB.net application. For some reason, the DLL stops calling my application when a barcode was received. The strange thing is that I can restore it by sending the function pointers to my VB callbacks again. So, I guess that either the CPP DLL looses his pointers to my VB.Net functions, or the VB.Net callbacks change address. VB.Net
Public Delegate Sub WEDGE_BarcodeCallBack(ByVal barcode As String)
<init the callbacks for the C++ DL>
DLL_SetCallBacks( addressOff( functionX ) )
// function X gets called, until a certain form is opened in this app. then
// I'll have to set the callback again
typedef void (__stdcall *WEDGE_BarcodeCallBack)( BSTR str );
WEDGE_BarcodeCallBack barcodeCallBack;
void DLL_SetCallBacks( const long _callBackFunction )
   barcodeCallBack = (WEDGE_BarcodeCallBack)_callBackFunction;
Any idea why this happens? Greetings, Rick

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement