Home All Groups Group Topic Archive Search About

How to expose a structure to VB6 from VB.NET?

Author
6 Apr 2005 9:23 AM
Peter van der Veen
Hi

I have a VB.net apllication (DLL) with a structure and a property get.

public structure tMyCode
    dim iCode as integer
    dim sText as string
end structure

writeonly property GetCodes as tMycode
    get
        dim a(0) as tMycode
        a(0).icode=10
        a(0).sText = "text"
        return a
    end get
end property



I can see these this in VB6 (using comvisible), but got an error when
assigning it in vb6

dim a as tMycode

This raises an error (Variable uses an automation type not supported.

We can't use types in VB.net, but how can i get those in VB6?

I hope my problem is clear.

Peter

Author
6 Apr 2005 10:11 AM
Cor Ligthert
Peter,

Is this not more a question for a VBCom newsgroup.

microsoft.public.vb.general.discussion

That last is the most active one.

Cor
Author
6 Apr 2005 10:26 AM
Peter van der Veen
Don't think so, but i'll try

I think i'm doing something wrong in VB.NET.

On Wed, 6 Apr 2005 12:11:43 +0200, "Cor Ligthert"
<notmyfirstn***@planet.nl> wrote:

Show quoteHide quote
>Peter,
>
>Is this not more a question for a VBCom newsgroup.
>
>microsoft.public.vb.general.discussion
>
>That last is the most active one.
>
>Cor
>
Author
6 Apr 2005 3:20 PM
Dick Grier
Hi,

Perhaps this will get you going:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnhcvb04/html/vb04g9.asp

If you have done that... I am not sure.  Perhaps you will need to wrap the
"type" as a class, not a structure.

Dick

--
Richard Grier  (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2  (391 pages) published July 2004.  See
www.mabry.com/vbpgser4 to order.