char* ===> Pchar
short* ===> ^ShortInt;
* ===> Pointer;
short* ===> ^ShortInt;
* ===> Pointer;
解决方案 »
- dbgrid的cellclick中那个column参数的什么属性表示当前行啊?
- [来者有分] 是不是高手都写自己的博客去了...
- 哪位大哥知道上海达冠科技,拖欠工资,现在找不到他了.
- 请问在DBgrid中如何不显示SQL数据表中日期时间型字段的日期部分
- delphi+access单机版数据库问题,希望能指点一下,谢谢~~
- 求大家帮个忙:Delphi7中的Internet页上怎么没有TServerSocket和TClientSocket组件?
- 类型转换:字符串—数字
- 画图速度慢,怎么再提高???
- 在access中如何创建一个临时表?
- 挂钩的作用是什么?如何具体的使用系统挂钩?最好能举个例子,谢谢各位大虾赐教!
- 请叫一个数据库显示的问题(给分的)
- 求救、求救!!!!!!
dll接口
extern "C"
{
int _declspec(dllexport) add_2(short *c)
{
*c=100;
return *c;
}
}Delphi的主要编码type
TPInt = ^Shortint;
TInStr_2 = function(a:TPInt): Integer;var
pC: TPInt;
ret: Integer;
...procedure TForm1.Button1Click(Sender: TObject);
begin
Moudle := Loadlibrary('d:\tmp\dll.dll'); PFunc := GetProcAddress(Moudle,'add_2'); new(pC);
pC^ := 0;
ShowMessage(IntToStr(pC^)); { '0' is output here } ret := TInstr_2(PFunc)(pC); ShowMessage(IntToStr(pC^)); { '100' should be output , but '0' is output}
ShowMessage(IntToStr(ret)); Freelibrary(Moudle);
end;
var
c:integer;ret := TInstr_2(PFunc)(@C);
c := 0;ShowMessage(IntToStr(c));
TInstr_2(PFunc)(@c);
ShowMessage(IntToStr(c)); { '100' should be output , but '0' is output}
var a: Integer ; b: PChar
方式调用成功,但动态调用还是失败。