在ActiveX中使用URLDownLoadToFile函數中的參數問題

來源:互聯網
上載者:User

在ActiveX中使用URLDownLoadToFile函數中的參數問題 AirLu(AirLu) Delphi VCL組件開發及應用 - delphi2007.net
http://www.delphi2007.net/DelphiVCL/html/delphi_2004050911041736277.html

在普通應用程式中這樣寫是正確的URLDownLoadToFile(nil,   PChar('http://xxx/a.zip),   PChar('c:\a.zip'),   0,   nil),但如果在編寫activex控制項中使用此函數時,第一個參數不能用nil,不知那位高手知道該怎麼寫。  
  以下是URLDownLoadToFile函數的參數說明:  
  Syntax  
   
  HRESULT   URLDownloadToFile(                      
          LPUNKNOWN   pCaller,  
          LPCTSTR   szURL,  
          LPCTSTR   szFileName,  
          DWORD   dwReserved,  
          LPBINDSTATUSCALLBACK   lpfnCB  
  );  
   
  Parameters  
   
  pCaller:  
      Pointer   to   the   controlling   IUnknown   interface   of   the   calling   Microsoft®   ActiveX®   component   (if   the   caller   is   an   ActiveX   component).   If   the   calling   application   is   not   an   ActiveX   component,   this   value   can   be   set   to   NULL.   Otherwise,   the   caller   is   a   Component   Object   Model   (COM)   object   that   is   contained   in   another   component   (such   as   an   ActiveX   control   within   the   context   of   an   HTML   page).   This   parameter   represents   the   outermost   IUnknown   of   the   calling   component.   The   function   attempts   the   download   within   the   context   of   the   ActiveX   client   framework   and   allows   the   caller's   container   to   receive   callbacks   on   the   progress   of   the   download.    
   
  szURL:  
      Pointer   to   a   string   value   containing   the   URL   to   be   downloaded.   Cannot   be   set   to   NULL.    
   
  szFileName:  
      Pointer   to   a   string   value   containing   the   name   of   the   file   to   create   for   bits   that   come   from   the   download.    
   
  dwReserved:  
      Reserved.   Must   be   set   to   0.  
   
  lpfnCB:  
      Pointer   to   the   caller's   IBindStatusCallback   interface.    
   
  其中第一個參數pCaller到底該怎麼寫?  
  請高手不吝賜教!

  • 請教如何使用indy組件實現檔案自動上傳?
  • 請問如何用IdHTTPServer實現檔案自動上傳?
  • 使用spcomm進行串口通訊的問題?急
  • 各位大蝦,有沒有這樣的控制項,點擊Combobox,下拉式清單彈出的是一個TreeView
  • 現在一Delphi動態庫(沒有類),如何用asp調用?(查到的資料基本是VB的Dll)
  • 增加一個事件。可以再加分
  • 資料顯示問題,高手請進!謝謝
  • 有誰見過這個VCL
  • 一個關於資料顯示的問題,高手請進!
  • 請問如何用Delphi程式在Internet選項中->安全->受信任的網站中加入一個網站?
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.