News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

vb and masm

Started by ecube, August 28, 2008, 11:29:03 PM

Previous topic - Next topic

ecube

I wrote a dll in masm and loaded it in a vb app, in the vb app i'm using addressof to allow 1 of the sub's to be a callback function that the dll can use, it works fine when I call the function, but when I try and pass that address to another thread in my masm dll it crashes the app, can anyone tell me possible reasons why that may be? i checked in a debugger, the address is the same.

zooba

If you're using VB6 or earlier, the IDE has some serious issues with multithreading. I believe that if you make an exe it will run fine, though the COM aspects may cause trouble.

If you are using a newer version of VB, I'm afraid I have not come across this issue and can't suggest anything. You may be better to use some sort of window message to do the callback than to directly call the function.

Cheers,

Zooba :U

BlackVortex

I think the visual basic code is too slow for the "Wickedly Crafted"(tm) masm32-produced code in the dll, so the OS can't synchronize them








just kidding
Seriously,now, user-mode debuggers don't always recreate real-time execution properly. Some timing/threading-related bugs can't be reproduced under debugging. Thank god for softice, it's like it freezes time itself !

ecube

yeah was vb6, I couldn't figure out the problem so I just used wm_copydata ipc method instead, seems to work ok :) thanks guys