English 中文(简体)
从VBA召唤一名DLL
原标题:Calling a DLL from VBA
  • 时间:2009-10-12 18:47:30
  •  标签:

我需要从使用VBA的准入中指定一个DL职能。 DL职能的原型是

int __stdcall myFunction(const char* data,
        int rows, int cols, int sl, int fullsize, 
        double aspect_ratio,
        double y,
        void** ppResult);

我在访问中宣布:

Private Declare Function DllImport_myFunction _
        Lib "myFunctionDLL.dll" _
        Alias "myFunction" _
            (ByVal data As String, _
             ByVal rows As Long, _
             ByVal cols As Long, _
             ByVal sl As Long, _
             ByVal fullsize As Long, _
             ByVal aspectRatio As Double, _
             ByVal y As Double, _
             ByRef handle As Long)

当我试图要求出入时,准入遭到侵犯。 我在LLL职能的第一份发言中做了一个突破点,但没有打上。

声明是否不正确?

问题回答

你没有返回

Private Declare Function DllImport_myFunction Lib "myFunctionDLL.dll" Alias "myFunction" _
(ByVal data As String, _
 ByVal rows As Long, _
 ByVal cols As Long, _
 ByVal sl As Long, _
 ByVal fullsize As Long, _
 ByVal aspectRatio As Double, _
 ByVal y As Double, _
 ByRef handle As Long
) As Long

也许需要增加“C”号,以避免任满。





相关问题
热门标签