Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

passing structure between atl com dll & vb6.0 exe

10 views
Skip to first unread message

jjoohhnn

unread,
Apr 20, 2009, 10:25:19 AM4/20/09
to
Hi all,

I declared a structure in atl com dll's idl file as below:

typedef struct _mystruct{
char mydata[10];
int num;
}MySturct;

I could use this structure in vc client. But, not in vb client. How to
achieve this?

thanks in advance.

Regards,
Jjoohhnn.


Ralph

unread,
Apr 20, 2009, 11:34:49 AM4/20/09
to

"jjoohhnn" <jjoo...@microsoft.discussions.com> wrote in message
news:%23kWOXPc...@TK2MSFTNGP04.phx.gbl...

> Hi all,
>
> I declared a structure in atl com dll's idl file as below:
>
> typedef struct _mystruct{
> char mydata[10];
> int num;
> }MySturct;
>
> I could use this structure in vc client. But, not in vb client. How to
> achieve this?
>

It should work you need to provide more information on why you "can't use it
in vb client"?

In the meantime here are several issues ...

A C/C++ int is a VB Long, not a VB Integer. This can occasionally causes
surprises.

Note you are declaring a 'fixed string'. VB defaults to dynamic strings,
thus not appreciating the difference can also lead to surprises.

The underscore could be a problem. VB does not recognize a valid name if it
is the leading char. But you can get around this by delimiting (or
'escaping') the identifier with square brackets with in VB, eg
"[_mystruct]". But should not be a problem as you have typedef'd it to be
"MyStruct" which is a legal VB identity.

Where are you publishing it? For use with VB it must be within a published
interface or library.

Are other items in this typelib working correctly? Or is this as far as you
got?

-ralph

jjoohhnn

unread,
Apr 24, 2009, 11:06:37 AM4/24/09
to
Hi Ralph,

Thank you. It's working fine.

Regards,
jjoohhnn.
"Ralph" <nt_cons...@yahoo.com> wrote in message
news:O0E4M8cw...@TK2MSFTNGP06.phx.gbl...

0 new messages