VB and C++ sharing memory - possible?
Hi there. Is it possible to set up variables to they can be shared between a VB6 program and C++ DLL''s? I''m not talking about passing parameters to functions. I mean, can I declare global variables and access them from both languages?
Having an answer to this would hugely help with some of my problems. Articles and advice are welcome. Thanks.
GDNet+. It's only $5 a month. You know you want it.
i think so, you can put both functions and variables in dll''s...
Whip open the dll wizard in vc6 and try it out...
hehe
also you coulld just declare a null function, get it with the GetProcAddress() and cast his ass as a pointer to the type you want, you could use it to do whatever you want then Or will it explode if you try to set a value to dll func address?
Declaring dll calls in VB is a big pain, since it doesn''t have pointers and doesn''t support all the C base types quite the same way... and when you make a mistake, BOOM VB closes.
Whip open the dll wizard in vc6 and try it out...
hehe
also you coulld just declare a null function, get it with the GetProcAddress() and cast his ass as a pointer to the type you want, you could use it to do whatever you want then Or will it explode if you try to set a value to dll func address?
Declaring dll calls in VB is a big pain, since it doesn''t have pointers and doesn''t support all the C base types quite the same way... and when you make a mistake, BOOM VB closes.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Shared Memory is what you''re looking for. I''ve never tried, but I''m going to guess that accessing shared memory in VB is a NIGHTMARE. You might want to try some kind of COM setup, I can guarantee that it''s going to be your simplest route.
I'm not too sure abot this, but there are some undocumented things in VB, such as VarPtr, StrPts and ObjPtr, all of these will return the pointer for a variable, string or object respectivlely. Then you could somehow pass the pointer to the dll.
Check out this article, it should help your cause:
http://turbid.chthonic.bc.ca/articles/nitro.html
hth
EDIT: Fixed hyperlink
Trying is the first step towards failure.
Edited by - ragonastick on October 8, 2000 1:27:12 AM
Check out this article, it should help your cause:
http://turbid.chthonic.bc.ca/articles/nitro.html
hth
EDIT: Fixed hyperlink
Trying is the first step towards failure.
Edited by - ragonastick on October 8, 2000 1:27:12 AM
Trying is the first step towards failure.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement