C++ 中定义结构体,
struct CObjectInterface
{
virtual int __stdcall proc1(void);
virtual time_t __stdcall proc2(void);
//--- firewall config access
virtual int __stdcall func1(const int pos, double *acc);
virtual int __stdcall func2(const int pos);
virtual int __stdcall func3(const int pos,double *acc);
virtual int __stdcall func4(const int pos,const int shift);
}Delphi 中如何定义啊
struct CObjectInterface
{
virtual int __stdcall proc1(void);
virtual time_t __stdcall proc2(void);
//--- firewall config access
virtual int __stdcall func1(const int pos, double *acc);
virtual int __stdcall func2(const int pos);
virtual int __stdcall func3(const int pos,double *acc);
virtual int __stdcall func4(const int pos,const int shift);
}Delphi 中如何定义啊
解决方案 »
- delphi中的FormCloseQuery与Close的区别
- exe中的res,想用别的res替换,用什么软件可以做到!?
- 关于MonthCalendar1的问题
- 腊月了,放分阿!
- 可以将EXCEL文件直接作为数据库吗?如何在DELPHI中使用?
- 动态创建TWebBrowser?
- dll动态库怎样调试
- 对表 "Source"UPDATE 操作,显示错误提示:" InternalDataSet: Cursor not returned from Query."
- 请大哥哥们指教
- 请大家帮帮我!谢谢!
- 怎样保存和恢复dbgrideh的字体到ini文件
- ExcelWorkBook.SaveAs(newFilePath)报错
如果是抽象类,C++中的struct又没有虚表,所以...
下面提供参考,有大牛给过过眼,看是否可以这样定义。program Project1;{$APPTYPE CONSOLE}uses
Windows;type
int = integer;
time_t = longint;type
CObjectInterface = object
function proc1(): int;virtual;stdcall;abstract;
function proc2(): time_t;virtual;stdcall;abstract;
//--- firewall config access
function func1(const pos: int; acc: Pdouble): int;virtual;stdcall;abstract;
function func2(const pos: int): int;virtual;stdcall;abstract;
function func3(const pos: int; acc: Pdouble): int;virtual;stdcall;abstract;
function func4(const pos; const shift: int): int;virtual;stdcall;abstract;
end;begin
{ TODO -oUser -cConsole Main : Insert code here }
end.
type
// C++有开关,Time_t可能映射为32位整数也可能映射为64位整数.你要自己去看下具体开关怎么设置的
Time_t = Int64; CObjectInterface = class
function proc1(): Integer;virtual; stdcall; abstract;
function proc2(): Time_t; virtual; stdcall; abstract;
// --- firewall config access
function func1(const pos: Integer; acc: PDouble): Integer;virtual; stdcall; abstract;
function func2(const pos: Integer): Integer; virtual; stdcall; abstract;
function func3(const pos: Integer; acc: PDouble): Integer; virtual; stdcall; abstract;
function func4(const pos: Integer; shift: Integer): Integer;
virtual; stdcall; abstract;
end;
上面是C++对象,Delphi调用的封装方式,如果是Delphi对象就把abstract去掉,自己实现一下