Async event or callback from the c++ dll to the vb.net application

Hello
I have an vb.net application that need to perform async tcp/ip  communication with some boards. For this communication I have an c++ win32 dll .
here is the question : when my dll  asynchronically receives some data he must immediately notifies about this and send it to the main vb.net project , how do I do it Tongue Tied
Actually I want to create and set an event in my dll for this purpose but I don't know how to catch this event in vb.net application Tongue Tied
May be I need use the callback for this but again I don’t know how to do it Tongue Tied

thanks in advance< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />




Answer this question

Async event or callback from the c++ dll to the vb.net application

  • Mark Ainsworth

    I was wondering what protocol you are using because several of the web classes have good well characterized and well documented interfaces. If this DLL doesn't do something special or there is no particular investment or political reason to use the DLL, i'd seriously consider the asynch web classes.

    There are lots of synchronization techniques available and all different levels, many of them obscure. At the API level there are handle based signalobjectandwait and multipleevents sleepx, waitformultipleobjects, waitforsingleobject, mutexes semaphores and queueuserapc.

  • Andrew O.

    Unfortunately it is the customer willing to build c++ or c  dll for communication.
    There will be some other programs(created by others) that will be use this dll



  • Aaron Hallberg - MSFT

    Ok if you want to use a callback all you have to, is to pass the address of the callback routine. Often a dll will return as one of it's argument a pointer to data structure it has updated. Possibly you passed it to the dll to begin with.....

  • Async event or callback from the c++ dll to the vb.net application