作者weiyi0321 (weiyi)
看板Programming
标题Re: [VB6 ] 使用ActiveX DLL
时间Tue May 6 18:35:18 2008
※ [本文转录自 Visual_Basic 看板]
作者: weiyi0321 (weiyi) 看板: Visual_Basic
标题: Re: [VB6 ] 使用ActiveX DLL
时间: Tue May 6 15:27:52 2008
直接把DLL component拉进设计框架使用ABC_Get
跟
透过reference引入DLL (
Dim temp As ABCLib.MyABC←这是Class的名称
Set temp = New MyABC
Dim s As String
Dim a As Boolean
s = "YES,5"
a = MyABC.ABC_Get(s)
^^^^^^^^^这会被标示起来
)
在执行时会出现下面的错误讯息
Compiler error:
Function or interface marked as restricted, or the function uses an
Automation type not supported in Visual Basic
而被标示起来的function就是DLL里面提供的method..也就是下面的ABC_Get
DLL interface中method的宣告为
[id(1), helpstring("method ABC_Get")] HRESULT ABC_Get([in]CHAR* Cmd,
[out, retval]BOOL* F);
--
另外我在写code的时候..
通常写完function name( ←不是会自动出现提示吗?
我在写呼叫DLL method的时候都没有出现..
麻烦板友们解惑了..感谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.114.75.117
※ 编辑: weiyi0321 来自: 140.114.75.117 (05/06 15:29)
1F:推 albb0920:那 Call MyABC.ABC_Get(s,a) 呢? 05/06 16:05
※ 编辑: weiyi0321 来自: 140.114.75.117 (05/06 17:09)
※ 编辑: weiyi0321 来自: 140.114.75.117 (05/06 17:14)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.114.75.117