2014-09-02 75 views
0
  • 的IDM提供了客戶端應用程序 一些API調用IDM(互聯網下載管理器)?
#import "IDManTypeInfo.tlb" 
#include "IDManTypeInfo.h"     
#include "IDManTypeInfo_i.c" 
#include <atlbase.h>  //for CComBSTR class 
int main(int argc, char* argv[]) 
{ 
    //......... 
} 
+0

這就是C++,你不能直接把它翻譯成C#。但是,您可以隨時在C++中執行一些包裝器.dll並獲取它在C#中調用/調用的函數。 – 2014-09-02 14:44:01

回答

2

它很容易,從理論上來講。

IDM似乎是一個COM庫, 所有您需要做的就是將TLB文件放入tlbimp中,它將生成C#lib。

如何創建COM封裝http://msdn.microsoft.com/en-us/library/ms404285(v=vs.110).aspx

您可以使用tlbimp.exe是這一點。在我的電腦上有這個文件:

C:\ Program Files文件(x86)的\互聯網下載管理器\ idmantypeinfo.tlb

您現在已經運行TLBIMP命令生成特定的C#庫:

C:\Program Files (x86)\Internet Download Manager>tlbimp idmantypeinfo.tlb 
Microsoft (R) .NET Framework Type Library to Assembly Converter 3.5.30729.1 
Copyright (C) Microsoft Corporation. All rights reserved. 

Type library imported to IDManLib.dll 

C:\Program Files (x86)\Internet Download Manager> 

您現在已生成IDManLib.dll包含必要的東西。

相關問題