|
-
Mar 7th, 2005, 08:48 PM
#1
Re: Callback from C dll to VB6
Here's another idea if you're using Forms: Subclass your form and send it a message you've defined yourself each time the callback procedure is called. That way you can use the wParam or lParam arguments to pass on the data without storing them in global variables first.
-
Mar 7th, 2005, 09:00 PM
#2
Re: Callback from C dll to VB6
Yes, there are many work arounds that I could implement, but shouldn't I be able to build my callback so that it acts like callbacks from APIs? I would just like to know how they do it.
For example I've been able to call up MsgBoxes and such in a TimerProc callback after a SetTimer call
This is exactly my point. If I don't have problems with callbacks MS devises why is mine not working?
in your callback procedure in VB you simply create a timer with a low interval, just enough for your callback to finish executing and then do the job in the callback procedure for the timer.
I doubt that this would work since if the problem is as I expect that the thread has not been properly initialized, then a callback to an unintialized thread isn't going to work either. I may try it just to confirm my suspicions however. Thanks
-
Mar 7th, 2005, 09:10 PM
#3
Re: Callback from C dll to VB6
 Originally Posted by moeur
in your callback procedure in VB you simply create a timer with a low interval, just enough for your callback to finish executing and then do the job in the callback procedure for the timer
I doubt that this would work since if the problem is as I expect that the thread has not been properly initialized, then a callback to an unintialized thread isn't going to work either. I may try it just to confirm my suspicions however. Thanks
Maybe you're right! However the subclassing and sending a message to your form approach should work, since it's then sent to the regular thread in the VB process.
-
Nov 28th, 2009, 03:33 PM
#4
Addicted Member
Re: Callback from C dll to VB6
Code:
lProcAdr = (long)(&DoTheWork);
what do if i change DoTheWork to :
Code:
LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam)
I got Error when i do this
Code:
lProcAdr = (long)(GetMsgProc);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|