COM library interop inconsistency

G

Guest

I have a com dll, and I add it to my VS 2005 C# project it wrap the dll in a
set of functions.
And when I'm generating the .NET wrapper dll manually by using the
TlbImp.exe, the function does not look the same.
For example:
(1) By using the add reference of the VS2005 I get the interop DLL with
function that looks like that:
void Func(int i, ref System.Array stream)
(2) By using the TlbImp.exe manually I get the interop DLL with function
that looks like that:
void Func(int i, ref byte[] stream)

Why the difference?
Can I make the VS2005 generate the interop libraries like the TlbImp.exe
does? How?
 
P

Patrick Steele

I have a com dll, and I add it to my VS 2005 C# project it wrap the dll in a
set of functions.
And when I'm generating the .NET wrapper dll manually by using the
TlbImp.exe, the function does not look the same.
For example:
(1) By using the add reference of the VS2005 I get the interop DLL with
function that looks like that:
void Func(int i, ref System.Array stream)
(2) By using the TlbImp.exe manually I get the interop DLL with function
that looks like that:
void Func(int i, ref byte[] stream)

Why the difference?
Can I make the VS2005 generate the interop libraries like the TlbImp.exe
does? How?

It looks like VS.NET runs the tlbimp tool with the /sysarray option.
I've never noticed that before. Although for most of the work I've done
with COM interop, I've generated the wrappers myself using tlbimp so I
can control their namespace and have them signed (my wrappers were going
into the GAC).
 

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