Subject: store variables from DLL file
Posted By: maxpotters Post Date: 8/25/2006 1:18:04 PM
Hi all,

I have created a DLL with Visual Basic 6.0. Now, when I run subroutines in this DLL from, for example, a standard EXE, all the variables used in this specific subroutine are cleared from the memory after being run. I would like to use the values from these variables further in my Executable (I already tried a Static statement, but somehow this makes my DLL crash).

So, to the question: Does anyone know how to store variables from a DLL in such a way that I can easily use/retrieve their values in an executable? (I have created a link between the DLL and the Executable)

Thanks in advance
Max (18)
Reply By: gbianchi Reply Date: 8/25/2006 1:21:55 PM
hi there.. why no store the variables on the exe side and pass is to the dll by ref???

couldn't you do that??

HTH

Gonzalo
Reply By: maxpotters Reply Date: 8/25/2006 4:15:10 PM
Hi,

The dll has code which is independent on the executable. It does check items on the form of the executable, either in variables or arrays. I need to be able to just store/remember them, since after the procedure in the DLL is finished the variables are cleared from the memory.

Thanks for your help though
Max
Reply By: marcostraf Reply Date: 8/26/2006 5:01:47 PM
are you talking about an ActiveX library right?

in the public class that is used by the exe declare your variables at module level, i.e. outside any methods like

private m_myVar as Double

then in your exe keep a copy of that class, and do not create and destroy it any time you use it (same trick, declare it at module level

private m_myClass as MyDLL.MyClass

In this way the class will be destroyed only when the app terminates (unless you set it to nothing) and thus it will keep its data

Go to topic 48902

Return to index page 193
Return to index page 192
Return to index page 191
Return to index page 190
Return to index page 189
Return to index page 188
Return to index page 187
Return to index page 186
Return to index page 185
Return to index page 184