您现在的位置: 中国教师站 >> 教师关注 >> 电脑技术 >> 编程技术 >> Visual C >> 正文

Google
NoTitle118
作者:Siny 文章来源:中国教师站cn-teacher 点击数: 更新时间:2007-4-22 12:40:35

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]  ... 下一页  >> 

相关专题:
 
 网友评论:(评论内容只代表网友观点,与本站立场无关!)
GOOGLE广告

阅读排行

| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 |
中国教师站

中国教师站 版权所有 Copyright © 2006-2020 All Rights Reserved 站长:Sina & Siny
[备用域名:www.JXZYW.Com] 有事请留言有事请留言
【实力成就精品 诚信呵护品牌】

信息产业部备案
苏ICP备06018635号