COM typedefs



 DEVELOP > c-Plus-Plus > COM typedefs

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Claus77"
Date: 24 Oct 2006 03:48:57 AM
Object: COM typedefs
hi there,
i'm just programing a com-interface and within my .idl file i define
a struct, somehow like this:
typedef struc struk
{
int a;
long b;
}struk;
which is uses in a method:
test(struk a)
{
....
}
now my problem:
how can i call this function from vb-script without getting an error?
do i have to define the struct in another way as here shown?
in c++ its easy, because i can call the struct directly...
greetings,
claus
.

User: "Phlip"

Title: Re: COM typedefs 24 Oct 2006 09:11:13 AM
Claus77 wrote:

.idl file

....

how can i call this function from vb-script without getting an error?

....

in c++ its easy, because i can call the struct directly...

This newsgroup is only qualified to discuss the raw C++ language itself, not
all its platform-specific bindings.
Tip: Don't use VBScript.
And post this question to a COM newsgroup for best results!
--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
.

User: "Salt_Peter"

Title: Re: COM typedefs 24 Oct 2006 04:41:17 AM
Claus77 wrote:

hi there,

i'm just programing a com-interface and within my .idl file i define
a struct, somehow like this:

typedef struc struk
{
int a;
long b;
}struk;

which is uses in a method:

test(struk a)
{
...
}


now my problem:
how can i call this function from vb-script without getting an error?
do i have to define the struct in another way as here shown?
in c++ its easy, because i can call the struct directly...

greetings,
claus

Who knows, except to say that C++ won't allow that either.
Structs don't exist. They are just blueprints, declarations.
A struct is not called nor is it an object - in any language. An
instance of a struct also can't be "called". An instance can be created
/ conceived by "invoking" the struct's constructor.
You can *call* a function and pass it an instance by value, pointer or
reference, assuming there is a corresponding blueprint somewhere for
that function (a declaration).
struct Whatever
{
int a;
Whatever() : a(99) { }
} instance;
void test( Whatever& ref )
{
std::cout << ref.a << std::endl;
}
int main()
{
test( instance );
}
/*
99
*/
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER