|
|
How to build a COM to Send and Receive Multi File by ATL
CodeWorrior April 24,2002.
Introduction
The COM can send and receive Multi file from Server .
The project code has been built with VC++ 6.0 SP5 / ATL3.0 and tested on Win2K Professional.
Getting started
1.Create an ATL Project by useing ATL COM AppWizard ,name it as what you want,
at the step 1 :choose Support MFC;
2.Insert New ATL object by menu/toolbar,select Control -->lite Control-->
names: short name-->TestThread
attributes: support ISupportErrorInfo
support Connection_Points
interface -->Dual
thread model -->Apartment
Misc: inVisible at runtime
then click ok;
3. At classview ,right click CTestThread select Add Method,
add three method and the .idl file can found code like following lines
interface ITestThread : IDispatch
{
[id(1), helpstring("MultiThread Download File From Server")] HRESULT DownFile([in]BSTR bstrString);
[id(2), helpstring("Show About")] HRESULT About();
[id(3), helpstring("method SendFile")] HRESULT SendFile([in]BSTR bstrstring,[in]BSTR bstrFileString);
}
4.In TestThread.cpp add following codes:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
网友评论:(评论内容只代表网友观点,与本站立场无关!) |
阅读排行
|