Marshaller Error when calling vb 6 dll with embedded structure.

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?
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top