PDA

View Full Version : Using COM(ActiveX?) hangs up



gri
6th March 2007, 14:18
Hello,

First of all: The examples of ActiveQt do all do their work :)

Now to my problem: I'm trying to access a remote application, which results in a hangup ... maybe someone can tell me why :(
The querySubObject() causes the problem ... If disableMetaObject() is set, it does not hang up .. while calling this function inventor takes up 100% cpu


CLSID clsid;
::CLSIDFromProgID(L"Inventor.Application", &clsid);

IUnknown* unk = NULL;
if ( SUCCEEDED(::GetActiveObject(clsid, NULL, &unk)) )
{
QAxObject inventor(unk);
QAxObject* pDocuments = inventor.querySubObject("Documents"); // hangs up
if ( pDocuments )
{
//...
}

unk->Release();
}

wysota
6th March 2007, 14:28
What if you break and debug? Does it freeze inside Qt code, your code or COM code?

gri
6th March 2007, 14:40
not really debugable ... none of the threads stops somewhere meaningful ...

I found that the calls don't hang up. But each call takes about 20+ seconds!! While that Inventor does not hang up and still works with 100% cpu usage ...

So how to get the calls do their work faster? I don't need a function list of the object, I know which functions to call ..

gri
6th March 2007, 14:56
Ok, after trying:

with disableMetaObject() and dynamicCall() everything works fast ... but setting this on each object is really annoying :(

wysota
6th March 2007, 22:05
Are you using debug or release mode?

How about using QAxBase::queryInterface() to ask for an interface that would return return an interface you might call directly? I don't know if it's possible with the COM server you want, but omitting creation of QAxObject should speed things up.