multithreaded dll - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: multithreaded dll (/showthread.php?tid=75142) multithreaded dll by cooldude_i06 on 06-07-2007 at 03:04 PM
I need to use a C++ Dll in my script using Interop.Call, however the function this Dll contains runs an infinite loop in the background, which ofcourse freezes WLM because the function does not return anything. I know that VB6 does not support multithreading so calling it through an ActiveX dll won't help. So I'm looking for suggestions. RE: multithreaded dll by Volv on 06-07-2007 at 03:26 PM You could create a timer in MsgPlus to call the function every X milliseconds instead of using an infinite loop. RE: multithreaded dll by cooldude_i06 on 06-07-2007 at 03:29 PM No the infinite loop is part of the C++ dll and that cannot be changed due to functionality reasons. The only thing I can do is run it in a separate thread so the main function does not wait for it to end and returns a value so that Plus can get going with the script. RE: multithreaded dll by Mnjul on 06-07-2007 at 04:19 PM
You can call CreateThread, or alternatively, _bginthread if you're using Visual C++, in your C++ DLL. RE: multithreaded dll by CookieRevised on 06-07-2007 at 09:51 PM
Multithreading is somewhat possible in VB though (for example with ActiveX, but it depends on what you exactly want to do... (Though doing it in C++ would be easier) RE: multithreaded dll by cooldude_i06 on 06-08-2007 at 01:42 AM
Well I'm trying to use the Winpcap library, and as far as I have seen the only way to retrieve packetcapture events is using a loop. |