The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ecube on August 28, 2008, 11:29:03 PM

Title: vb and masm
Post by: ecube on August 28, 2008, 11:29:03 PM
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.
Title: Re: vb and masm
Post by: zooba on August 29, 2008, 04:11:16 AM
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
Title: Re: vb and masm
Post by: BlackVortex on August 29, 2008, 04:16:38 AM
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 !
Title: Re: vb and masm
Post by: ecube on August 29, 2008, 07:48:25 AM
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