HighTechTalks DotNet Forums  

Tlbimp: unexpected conversion of SAFEARRAY in structure

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Tlbimp: unexpected conversion of SAFEARRAY in structure in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Armin Zingler
 
Posts: n/a

Default Tlbimp: unexpected conversion of SAFEARRAY in structure - 07-18-2007 , 07:00 PM






Hi, (.Net 2.0)

an AX-DLL written in VB6 is imported by tlbimp.

VB6 code:

Public Type SAKomplexRecord
....
End Type

Public Type SAKomplex
Records() As SAKomplexRecord
End Type


IDL: (from original VB6 DLL)
typedef [uuid(.....), version(1.0)]
struct tagSAKomplex {
[helpstring("Records")
]
SAFEARRAY(SAKomplexRecord) Records;
} SAKomplex;


typedef [uuid(.....), version(1.0)]
struct tagSAKomplexRecord {
.....
} SAKomplexRecord;


Problem:
In VB.Net, referencing the imported file, the declaration of
SAKomplex.Records is
"Public Records As System.Array".
I expect it to be
"Public Records() As Projectname.SAKomplexRecord".

Why is this? In the same library, there is another structure containing an
array of structures. There it works.


Armin


Reply With Quote
  #2  
Old   
Armin Zingler
 
Posts: n/a

Default Re: Tlbimp: unexpected conversion of SAFEARRAY in structure - 07-18-2007 , 08:01 PM






"Armin Zingler" <az.nospam (AT) freenet (DOT) de> schrieb
Quote:
Hi, (.Net 2.0)

an AX-DLL written in VB6 is imported by tlbimp.
I assumed that the Upgrade wizard that converts a VB6 project to VB.Net,
internally only calls tlbimp.exe. That's why I asked for tlbimp.exe. In
reality, I used the upgrade wizard (and not tlbimp), which obviously
internally uses "/sysarray" to create the interop assemblies.

If I manually call tlbimp.exe, the result is fine, so this problem is
solved. Anyway thx for reading.


Armin



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.