M
ML
Hello,
I have an application in C++ (unmanaged). This application is a COM client
and needs to call many COM Servers. The COM servers are built with different
languages like VB 6.0, VB.Net, C#, C++, etc. All the COM server needs to
implement a specific COM class with the same list of methods. The list of
methods is the same (same prototypes, but the code inside each method is
different).
In a C++ application, we have to import the typelib of the COM class to be
able to call any method of this class.
In my case, I have to deal with an indeterminate number of COM Server. So I
can't import all the typelib for each COM Class, because I don't know all of
them.
I would like to import only one typelib since all the COM class in each COM
server are the same (methods with same prototypes).
But, it doesn't work.
I've imported a typelib from a C++ COM server in my C++ COM client.
This is the class generated by Visual Studio :
class Xyz : public COleDispatchDriver
{
public:
void Y()
{
InvokeHelper(0x1, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
};
The method Y() have the id = 0x1
I've imported the typelib from a C# COM Server in my C++ COM client.
This is the class generated by Visual Studio :
class Xyz : public COleDispatchDriver
{
public:
void Y()
{
InvokeHelper(0x60020000, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
};
The method Y() have the id = 0x60020000. That's why it doesn't work.
I tried to call these COM Servers from a vbscript with late binding, and
it's work ! But, in C++, I think we need the typelib even with the late
binding.
Any ideas or suggestions will be appreciated ?
Thanks
I have an application in C++ (unmanaged). This application is a COM client
and needs to call many COM Servers. The COM servers are built with different
languages like VB 6.0, VB.Net, C#, C++, etc. All the COM server needs to
implement a specific COM class with the same list of methods. The list of
methods is the same (same prototypes, but the code inside each method is
different).
In a C++ application, we have to import the typelib of the COM class to be
able to call any method of this class.
In my case, I have to deal with an indeterminate number of COM Server. So I
can't import all the typelib for each COM Class, because I don't know all of
them.
I would like to import only one typelib since all the COM class in each COM
server are the same (methods with same prototypes).
But, it doesn't work.
I've imported a typelib from a C++ COM server in my C++ COM client.
This is the class generated by Visual Studio :
class Xyz : public COleDispatchDriver
{
public:
void Y()
{
InvokeHelper(0x1, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
};
The method Y() have the id = 0x1
I've imported the typelib from a C# COM Server in my C++ COM client.
This is the class generated by Visual Studio :
class Xyz : public COleDispatchDriver
{
public:
void Y()
{
InvokeHelper(0x60020000, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
}
};
The method Y() have the id = 0x60020000. That's why it doesn't work.
I tried to call these COM Servers from a vbscript with late binding, and
it's work ! But, in C++, I think we need the typelib even with the late
binding.
Any ideas or suggestions will be appreciated ?
Thanks