请大侠指教调用DLL的步骤极其函数说明的方法,多谢
解决方案 »
- delphi编辑器里,按“'”键,不出来,按两下就出来两个,怎么设置成按一下就出来一个
- delphi调用vc中的dll参数如何对应?求救!!!!!!!!
- 急救!急救!急救!急救!急救!急救!急救!
- 【各位帮忙,这是什么病毒啊!】
- 请问如何交换StringGrid中的指定行和列,是使用编码的方式不是设置属性!
- 高分求SQL语句,在线等待,马上给分!!!!
- 怎样才能把存储进数据库中的AutoCAD文件还原成.dwg文件?
- 求助DateTimePicker.date在程序中如何把他清空!!!!!!!!
- 需要Delphi5.0密码
- 用什么语句关闭用 childf:=Tchildf.Create(form1);建立的窗口?
- 在BDE中数据库IBLocal的用户名是SYSDBA,那它的密码是什么?
- 公式识别??????
type TFunc = function (a :string ;b:integer) :integer ;
然后
procedure TForm1.Button1Click(Sender: TObject);
var
pfunc:TFarProc;
Moudle:THandle;
ret1:Integer;
myfun :TFunc ;
begin
Moudle:=loadlibrary('C_COMW.DLL');
if moudle< 32 then
SHowmessage('Load DLL Fail')
else
begin
pfunc:=GetProcaddress(moudle,'InitC_COMW');
if pfunc=nil then
ShowMessage('Get Function Address Fail')
else
begin
myfunc := @pfunc ;
ret1:=0;
*** ret1:=myfunc('R PLU.TXT 4 -lo -d:c_util.ini -i -T',1));
ShowMessage(IntToStr(ret1));
end;
end;
end;
出错的问题。我的DLL是用VC++编写的,用DELPHI调用应该没有什么问题把?
还有就是感谢大家的回复
['{00020400-0000-0000-C000-000000000046}']
function GetTypeInfoCount(out Count: Integer): HResult; stdcall;
function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;
function GetIDsOfNames(const IID: TGUID; Names: Pointer;
NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;
function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;
end;
['{00020400-0000-0000-C000-000000000046}']
function GetTypeInfoCount(out Count: Integer): HResult; stdcall;
function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;
function GetIDsOfNames(const IID: TGUID; Names: Pointer;
NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;
function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;
end;
用快速查看看一下你的输出函数名是否正确,如果可能在VC中输出函数用C的格式输出。