Hi,
I am having a problem in that I need to create a
shared VB DLL\Active EXE for both a C++ DLL and a VB EXE/DLL to share
the same variable values. I would be
very grateful if someone could just provide an example in format as
follows:-
Shared VB DLL (Class):
**********************
Public intSharedVariable as Integer
c++ dll
**********************
bla bla bla (update and display variable)
VB EXE/DLL
*************
bla bla bla (update and display variable)
I have tried using import and set my shard VBDLL to 'GlobalMultiUse',
but they each still use different instances/memory. Maybe my set-up is
wrong?
Anyones help would be much appreciated. Been a while out of C++ now...
Thanks,
John Guilbert.
John Guilbert - 26 Nov 2003 12:58 GMT
This is now solved.
Problem:
Needed to share Visual Basic DLL variable values with C++ (i.e. Global
Variables).
Resolution:
NEW Intermediate C++ DLL
Created an intermediate C++ DLL with the SetSharedMem and GetSharedMem
functions (browse the web for the C/C++ DLL code). Must export
functions setsharedmem and getsharedmem as _stdcall functions.
C++ DLL
In main C++ dll I loaded the intermediate C++ DLL (ensuring to use the
_stdcall in the procedure definitions for GetProcAddress - this is
what caused the problem). Example: typedef VOID (_stdcall
*SETSHAREDMEM)(LPTSTR);
VB DLL
Use Declare statement (all parameters as BYVALS) to get the two
functions; getsharedmem and setsharedmem.
EASY.......
Hope this helps anyone.
John.