Fixed - thanks for the help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was calling a new instance of the dll. I'm not used to using dlls, but that was still pretty ignorant of me. Thanks. I really appreciate all the help from Ben,Bryan, and Armin.
 
Ok. I have a student with the same probelm how do you fix it so both pieces of code call the same instance of the dll? And will it work will 6.0 rather then .net?


----- mike wrote: -----

I was calling a new instance of the dll. I'm not used to using dlls, but that was still pretty ignorant of me. Thanks. I really appreciate all the help from Ben,Bryan, and Armin.
 
Change the sub new to shared sub new. Then declare any shared variables as
public/private shared variable as type.


TeacherB said:
Ok. I have a student with the same probelm how do you fix it so both
pieces of code call the same instance of the dll? And will it work will 6.0
rather then .net?
----- mike wrote: -----

I was calling a new instance of the dll. I'm not used to using dlls,
but that was still pretty ignorant of me. Thanks. I really appreciate all
the help from Ben,Bryan, and Armin.
 
I don't know if this will help but I was doing the following
Dim sysDLLA As New Standard.Sy
Dim sysDLLB As New Standard.Sy

sysDLLA.GetValue(
sysDLLB.Init(

I should have been doing this
Dim sysDLL As New Standard.Sy
sysDLL.GetValue(
sysDLL.Init(

In the first example, I was creating a second instance of the dll and the second call never had variables set because it wasn't the same instance. This is why the second example works

I don't know how to create DLLs in VB6 so I can't help with that one
 
Back
Top