View Full Version : Accessing a Com server from an extern app made with visual studio

26th April 2016, 15:51
Hi everybody, I'm so happy to be one of QT's programmers & share with u this space.

so, I'm working on an application (client) which is supposed to communicate via com technology with a server made with qt ( qaxserver).

In ATL projects we have to include a file that contains the declaration of the interfaces. so that we can use them in our methods,

#include "../SimpleCOM/SimpleCOM_i.h"
#include "../SimpleCOM/SimpleCOM_i.c"

int _tmain(int argc, _TCHAR* argv[])
BSTR* message; //used to accept return value from server.
HRESULT hr; //COM error code;
ISimpleChatServer *chat; //pointer to the interface

hr = CoInitialize(0);

hr = CoCreateInstance(CLSID_SimpleChatServer,NULL,CLSCT X_INPROC_SERVER,IID_ISimpleChatServer,(void**) &chat);

hr = chat -> CallMe(_T("Zhiwei"), &message);

My questions are the following:
how can i access the interfaces defined in qt COM servers ???
IS there a way to generate that header file that defines those interfaces??

Thx for your time.