• 大小: 180KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-08
  • 标签: com_vs2013  

资源简介

包括三个项目,COM组件,ATL和MFC测试

资源截图

代码片段和文件信息

// ConsoleApplication1.cpp : Defines the entry point for the console application.
//

#include “stdafx.h“

int _tmain(int argc _TCHAR* argv[])
{
CoInitialize(NULL);
CLSID clsid;
//捕获可能出现的错误
try
{
CLSIDFromProgID(OLESTR(“FirstCOM.math.1“) &clsid);
CComPtr pFirstClass;//智能指针
HRESULT hr = pFirstClass.CoCreateInstance(clsid);
if (FAILED(hr))return 0;
long ret = pFirstClass->Add(1 2);
printf(“%d\n“ ret);
//释放指针
pFirstClass.Release();
CoUninitialize();
}
catch (_com_error &error)
{
cout << error.ErrorMessage << endl;
}

return 0;
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-11-21 11:12  ConsoleApplication1\
     目录           0  2015-11-21 11:12  ConsoleApplication1\ConsoleApplication1\
     文件        1003  2015-11-21 10:00  ConsoleApplication1\ConsoleApplication1.sln
     文件       28672  2015-11-21 11:05  ConsoleApplication1\ConsoleApplication1.v12.suo
     文件         627  2015-11-21 11:02  ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.cpp
     文件        4623  2015-11-21 10:37  ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.vcxproj
     文件        1465  2015-11-21 10:37  ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.vcxproj.filters
     文件        1799  2015-11-21 10:00  ConsoleApplication1\ConsoleApplication1\ReadMe.txt
     文件         306  2015-11-21 10:00  ConsoleApplication1\ConsoleApplication1\stdafx.cpp
     文件         623  2015-11-21 11:00  ConsoleApplication1\ConsoleApplication1\stdafx.h
     文件         314  2015-11-21 10:00  ConsoleApplication1\ConsoleApplication1\targetver.h
     目录           0  2015-11-21 11:12  FirstCOM\
     目录           0  2015-11-21 11:12  FirstCOM\FirstCOM\
     文件        1436  2015-11-21 09:15  FirstCOM\FirstCOM.sln
     文件       27648  2015-11-21 11:05  FirstCOM\FirstCOM.v12.suo
     文件         107  2015-11-21 09:15  FirstCOM\FirstCOM\compreg.cpp
     文件         135  2015-11-21 09:15  FirstCOM\FirstCOM\compreg.h
     文件         837  2015-11-21 09:30  FirstCOM\FirstCOM\dlldata.c
     文件         372  2015-11-21 09:15  FirstCOM\FirstCOM\dllmain.cpp
     文件         306  2015-11-21 09:15  FirstCOM\FirstCOM\dllmain.h
     文件         287  2015-11-21 09:29  FirstCOM\FirstCOM\FirstClass.cpp
     文件        1480  2015-11-21 10:20  FirstCOM\FirstCOM\FirstClass.h
     文件         584  2015-11-21 09:19  FirstCOM\FirstCOM\FirstClass.rgs
     文件        4788  2015-11-21 09:19  FirstCOM\FirstCOM\FirstCOM.aps
     文件        1696  2015-11-21 10:32  FirstCOM\FirstCOM\FirstCOM.cpp
     文件         207  2015-11-21 09:15  FirstCOM\FirstCOM\FirstCOM.def
     文件        1430  2015-11-21 09:30  FirstCOM\FirstCOM\FirstCOM.idl
     文件        6944  2015-11-21 09:19  FirstCOM\FirstCOM\FirstCOM.rc
     文件         286  2015-11-21 09:15  FirstCOM\FirstCOM\FirstCOM.rgs
     文件        8231  2015-11-21 09:30  FirstCOM\FirstCOM\FirstCOM.vcxproj
     文件        2927  2015-11-21 09:30  FirstCOM\FirstCOM\FirstCOM.vcxproj.filters
............此处省略32个文件信息

评论

共有 条评论

相关资源