如何从我的C#应用​​程序调用IDM(Internet Download Manager)

时间:2014-09-02 14:41:02

标签: c# api

#import "IDManTypeInfo.tlb" 
#include "IDManTypeInfo.h"                
#include "IDManTypeInfo_i.c" 
#include <atlbase.h>     //for CComBSTR class
int main(int argc, char* argv[])
{
    //.........
}

1 个答案:

答案 0 :(得分:2)

从理论上讲,这很容易。

IDM似乎是一个COM库, 您需要做的就是将TLB文件抛出到tlbimp中,它将生成C#lib。

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

您可以使用 tlbimp.exe 。在我的电脑中有这个文件:

C:\ Program Files(x86)\ Internet Download Manager \ 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