Marshaller Error when calling vb 6 dll with embedded structure.

  • Thread starter Thread starter Paul J Barrett
  • Start date Start date
P

Paul J Barrett

I have a problem with the marshaller calling a vb6 dll from csharp.
here follows the code that is similar in structure to what i want to call.

rem vb6 dll

type a
b1 as byte
b2(2) as byte
end type

type compoundstruct
c1 as byte
astruct(1 to 4) as a
end type

function dosomething(byref passed as compoundstruct) as int

passed.c1=1
passed.astruct(1).b1=1
passed.astruct(1).b2(1)=1


dosomething=1

end function

Should I create an adapter or is there a way to call this from csharp?
 
Paul,

Assuming that this is an ActiveX dll (in other words, a COM server of
some kind), you can use the TLBIMP.EXE utility to create managed
wrappers/definitions that you can access from C# to call the VB code.

Hope this helps.
 
Back
Top