Need a little help with QueryInterface
Bodlák Martin <[email protected]> Wed, 15 Jun 2005 17:13:59 +0200
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <[email protected]> |
Hello, I have a COM object which implements two interfaces.
How can I query this object for the second interface?
The code looks like
IDM3ItsClient dm3ItsClient = new IDM3ItsClient(PROGID_DM3ItsClient);
this is the first intarface, the actual com object is created because I used progid as a constructor parameter.
IDM3ItsConfig dm3ItsConfig = (IDM3ItsConfig) dm3ItsClient.queryInterface(IDM3ItsConfig.class);
// new IDM3ItsConfig(dm3ItsClient.queryInterface(dm3ItsClient.getClass()));
I have tried those two (and more ...) approaches to get the second interface (IDM3ItsConfig) for the created object to which I have interface IDM3ItsClient... but had no success.
I get an error in IDM3ItsConfig after return from this function:
public int getGuidToken() {
return iidToken;
}
The iidToken is a number (2 in my case) and it is an index to something called IdentityManager.
Maybe there is a problem with IdentityManager? Or with COM object which implements more than one interface?
Does anyone know (or even guess) where is the problem?
Best regards
Martin