Jump to content
  • Advertisement
Sign in to follow this  
spek

C++ DLL CallBacks to VB.Net application lost

This topic is 3396 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
CPP DLL
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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!