| 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
*/
.
|
|
|
|

|
Related Articles |
|
|