Prev: wshShell.Run error 80070483 VBScript form VBA excel
Next: VB 6.0 with MSXML2.DOMDocument; How to access apache http with credentials
From: Jim on 8 Aug 2007 11:49 I'm using VB6 (still). I have a USB device that works fine if it is plugged in before starting VB6. I need it to work if it is plugged in before or after VB6 is already running. This requires dynamically loading the dll functions. I called the LoadLibrary and GetProcAddress win32api functions to get the address of a routine, and it returns a long value. How do I call this Proc from VB6? I need to run it, send it the variables it needs, and receive the result. I have the code to do this in C, but that uses pointers, so the call to the dynamically loaded dll functions use the same format as the standard dll function call - just the pointer is changed to point to the dynamically loaded dll function. Thanks in advance! Jim
From: Jeremiah D. Seitz on 9 Aug 2007 03:00 On Wed, 08 Aug 2007 08:49:18 -0700, Jim <jdwaineo(a)mtu.edu> wrote: >I'm using VB6 (still). I have a USB device that works fine if it is >plugged in before starting VB6. I need it to work if it is plugged in >before or after VB6 is already running. This requires dynamically >loading the dll functions. I called the LoadLibrary and >GetProcAddress win32api functions to get the address of a routine, and >it returns a long value. How do I call this Proc from VB6? I need to >run it, send it the variables it needs, and receive the result. > >I have the code to do this in C, but that uses pointers, so the call >to the dynamically loaded dll functions use the same format as the >standard dll function call - just the pointer is changed to point to >the dynamically loaded dll function. > >Thanks in advance! > >Jim Most of the examples I've seen use SendMessage with the proc address as the HWnd parameter, but it's somewhat limited. Google for "APIByName.Zip". It should do what you require. If you can't find it, I can send it to you. J. Jeremiah D. Seitz Omega Techware http://www.omegatechware.net
From: Jim on 9 Aug 2007 13:34 On Aug 9, 3:00 am, Jeremiah D. Seitz <jse...(a)omegatechware.net> wrote: > On Wed, 08 Aug 2007 08:49:18 -0700, Jim <jdwai...(a)mtu.edu> wrote: > >I'm using VB6 (still). I have a USB device that works fine if it is > >plugged in before starting VB6. I need it to work if it is plugged in > >before or after VB6 is already running. This requires dynamically > >loading the dll functions. I called the LoadLibrary and > >GetProcAddress win32api functions to get the address of a routine, and > >it returns a long value. How do I call this Proc from VB6? I need to > >run it, send it the variables it needs, and receive the result. > > >I have the code to do this in C, but that uses pointers, so the call > >to the dynamically loaded dll functions use the same format as the > >standard dll function call - just the pointer is changed to point to > >the dynamically loaded dll function. > > >Thanks in advance! > > >Jim > > Most of the examples I've seen use SendMessage with the proc address > as the HWnd parameter, but it's somewhat limited. > > Google for "APIByName.Zip". It should do what you require. If you > can't find it, I can send it to you. > > J. > Jeremiah D. Seitz > Omega Techware > http://www.omegatechware.net- Hide quoted text - > > - Show quoted text - I set this up, and it works for some of the functions. I need to pass a user defined variable to two of the functions by reference, and it doesn't handle that properly. Any ideas? Thanks for your help! Jim
From: Neila on 12 Aug 2007 23:35 On Aug 9, 10:34 am, Jim <jdwai...(a)mtu.edu> wrote: > On Aug 9, 3:00 am, Jeremiah D. Seitz <jse...(a)omegatechware.net> wrote: > > > > > On Wed, 08 Aug 2007 08:49:18 -0700, Jim <jdwai...(a)mtu.edu> wrote: > > >I'm using VB6 (still). I have a USB device that works fine if it is > > >plugged in before starting VB6. I need it to work if it is plugged in > > >before or after VB6 is already running. This requires dynamically > > >loading the dll functions. I called the LoadLibrary and > > >GetProcAddress win32api functions to get the address of a routine, and > > >it returns a long value. How do I call this Proc from VB6? I need to > > >run it, send it the variables it needs, and receive the result. > > > >I have the code to do this in C, but that uses pointers, so the call > > >to the dynamically loaded dll functions use the same format as the > > >standard dll function call - just the pointer is changed to point to > > >the dynamically loaded dll function. > > > >Thanks in advance! > > > >Jim > > > Most of the examples I've seen use SendMessage with the proc address > > as the HWnd parameter, but it's somewhat limited. > > > Google for "APIByName.Zip". It should do what you require. If you > > can't find it, I can send it to you. > > > J. > > Jeremiah D. Seitz > > Omega Techware > > http://www.omegatechware.net-Hide quoted text - > > > - Show quoted text - > > I set this up, and it works for some of the functions. I need to pass > a user defined variable to two of the functions by reference, and it > doesn't handle that properly. Any ideas? > > Thanks for your help! > > Jim Maybe these will be usefule, http://vbnet.mvps.org/index.html?code/core/farproc.htm http://vbnet.mvps.org/index.html?code/callback/browsecallback.htm
From: Jim on 13 Aug 2007 07:51
On Aug 12, 11:35 pm, Neila <neilane...(a)msn.com> wrote: > On Aug 9, 10:34 am, Jim <jdwai...(a)mtu.edu> wrote: > > > > > On Aug 9, 3:00 am, Jeremiah D. Seitz <jse...(a)omegatechware.net> wrote: > > > > On Wed, 08 Aug 2007 08:49:18 -0700, Jim <jdwai...(a)mtu.edu> wrote: > > > >I'm using VB6 (still). I have a USB device that works fine if it is > > > >plugged in before starting VB6. I need it to work if it is plugged in > > > >before or after VB6 is already running. This requires dynamically > > > >loading the dll functions. I called the LoadLibrary and > > > >GetProcAddress win32api functions to get the address of a routine, and > > > >it returns a long value. How do I call this Proc from VB6? I need to > > > >run it, send it the variables it needs, and receive the result. > > > > >I have the code to do this in C, but that uses pointers, so the call > > > >to the dynamically loaded dll functions use the same format as the > > > >standard dll function call - just the pointer is changed to point to > > > >the dynamically loaded dll function. > > > > >Thanks in advance! > > > > >Jim > > > > Most of the examples I've seen use SendMessage with the proc address > > > as the HWnd parameter, but it's somewhat limited. > > > > Google for "APIByName.Zip". It should do what you require. If you > > > can't find it, I can send it to you. > > > > J. > > > Jeremiah D. Seitz > > > Omega Techware > > > http://www.omegatechware.net-Hidequoted text - > > > > - Show quoted text - > > > I set this up, and it works for some of the functions. I need to pass > > a user defined variable to two of the functions by reference, and it > > doesn't handle that properly. Any ideas? > > > Thanks for your help! > > > Jim > > Maybe these will be usefule,http://vbnet.mvps.org/index.html?code/core/farproc.htm > > http://vbnet.mvps.org/index.html?code/callback/browsecallback.htm- Hide quoted text - > > - Show quoted text - Thanks for all the responses. They were very helpful. I was able to get my project working properly. Thanks again! Jim |