DELPHI 调用DLL(20分)

F

Fucool

Unregistered / Unconfirmed
GUEST, unregistred user!
一个DLL 文件,在VB里调用如下;
Declare Function MakeStringObject Lib "PDFENC32.DLL" Alias "MakeMemoryObject" (lpObj As PDFOBJ, ByVal ioDirection As Integer, ByVal lpBase As Any) As Integer
Declare Function MakeFileObject Lib "PDFENC32.DLL" (lpObj As PDFOBJ, ByVal ioDirection As Integer, ByVal hFile As Long) As Integer
Declare Function MakeFilenameObject Lib "PDFENC32.DLL" (lpObj As PDFOBJ, ByVal ioDirection As Integer, ByVal lpcszFilename As String) As Integer
Declare Function MakeClipboardObject Lib "PDFENC32.DLL" (lpObj As PDFOBJ, ByVal ioDirection As Integer, ByVal hWnd As Long) As Integer
Declare Function MakeMemoryObject Lib "PDFENC32.DLL" (lpObj As PDFOBJ, ByVal ioDirection As Integer, lpBase As Any) As Integer
Declare Function MakeStringObject Lib "PDFENC32.DLL" Alias "MakeMemoryObject" (lpObj As PDFOBJ, ByVal ioDirection As Integer, ByVal lpBase As Any) As Integer
Declare Function MakeFileObject Lib "PDFENC32.DLL" (lpObj As PDFOBJ, ByVal ioDirection As Integer, ByVal hFile As Long) As Integer
Declare Function MakeFilenameObject Lib "PDFENC32.DLL" (lpObj As PDFOBJ, ByVal ioDirection As Integer, ByVal lpcszFilename As String) As Integer
Declare Function MakeClipboardObject Lib "PDFENC32.DLL" (lpObj As PDFOBJ, ByVal ioDirection As Integer, ByVal hWnd As Long) As Integer
Declare Function MakeMemoryObject Lib "PDFENC32.DLL" (lpObj As PDFOBJ, ByVal ioDirection As Integer, lpBase As Any) As Integer

我在DELPHI里 的调用如下;但出错,请问应如何写。
Function MakeStringObject; external 'PDFENC32.DLL' name 'MakeMemoryObject';
Function MakeFileObject; external 'PDFENC32.DLL' name 'MakeFileObject';
Function MakeFilenameObject; external 'PDFENC32.DLL' name 'MakeFilenameObject';
Function MakeClipboardObject; external 'PDFENC32.DLL' name 'MakeClipboardObject';
Function MakeMemoryObject; external 'PDFENC32.DLL' name 'MakeMemoryObject';

谢谢大家。
 
不会吧没一个人答题。。。。
 
多加一個 far;
Function MakeStringObject;far; external 'PDFENC32.DLL' name 'MakeMemoryObject';

 
同志们给点参考。。。。。
 
1.注意区分大小写
2.将参数写全
3.加上stdcall后缀
 
[:(!], 我翻译了好几个, 除了千堆雪赏了点银子外, 每人给钱. 以后有钱就给翻译
 
你怎麼不加后面的函數
Function MakeStringObject; external 'PDFENC32.DLL' name 'MakeMemoryObject' (var lpObj As PDFOBJ; var ioDirection : Integer; var lpBase: Any) As Integer

 
多谢同志们,我试试看。。。。。
 
我记得参数的定义应该写在前面,不信试试看。[:D]
 
Declare Function MakeMemoryObject Lib "PDFENC32.DLL" (lpObj As PDFOBJ, ByVal ioDirection As Integer, lpBase As Any) As Integer
写一个试试
Function MakeMemoryObject(lpObj :pDFOBJ;var ioDirection: Integer; lpBase : Any):integer; stdcall ;Lib "PDFENC32.DLL" ;
注意:
1 :PDFOBJ;Any 要先定义;stdcall ;far c.. 多种调用方式你要试试;
 
多人接受答案了。
 
顶部