// atlcall.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#import "AtlSample.tlb"
#include "Debug/atlsample.tlh"
using namespace AtlSampleLib;
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr;
hr =::CoInitialize(NULL);
IAccountPtr pAccount = NULL;
pAccount.CreateInstance(__uuidof(Account));
if (FAILED(hr))
{
printf("(FAILED(hr) \r\n");
::CoUninitialize();
return 0;
}
BSTR buf;
pAccount->Post(100,&buf);
::SysFreeString(buf);
pAccount.Release(); //必须先调用,否则::CoUninitialize()会有异常
::CoUninitialize();
return 0;
}