#include "stdafx.h"
#include <iostream>
#include "atlbase.h"
#import "..\MyServer\_MyServer.tlb" no_namespace
using namespace std;
struct OleCom {
OleCom() { CoInitialize(NULL);}
~OleCom() { CoUninitialize(); }
}olecom;
int _tmain(int argc, _TCHAR* argv[])
{
CComPtr<IUnknown> spUnknown;
spUnknown.CoCreateInstance(__uuidof(CObject1));
CComPtr<IObject1> pI;
spUnknown.QueryInterface(&pI);
short res = 0;
pI->get_GetANum(&res);
cout << res << endl;
return 0;
}