simpleclient.cpp

来自「Visual_C++[1].NET_Bible1 Visual_C++宝典书中」· C++ 代码 · 共 35 行

CPP
35
字号
// SimpleClient.cpp 

#include "stdafx.h"
#include <iostream>
using namespace std;

#import "..\DbServer\_DbServer.tlb" no_namespace named_guids

int _tmain(int argc, _TCHAR* argv[])
{
	CoInitialize(NULL);

	try
	{
		IDbObjectPtr p(CLSID_CDbObject);
		p->UpdateIndexes();

		cout << "Doing something else while the object works";
		for (int i = 0; i < 10; i++)
		{
			cout << ".";
			Sleep(1000);
		}
		cout << endl;
	}
	catch(_com_error& e)
	{
		cout << e.ErrorMessage();
	}

	CoUninitialize();
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?