关于在VC++的Dll中调用Delphi的Dll,且返回及传输的都是对象 ( 积分: 100 )

  • 主题发起人 aaccccaa
  • 开始时间
A

aaccccaa

Unregistered / Unconfirmed
GUEST, unregistred user!
请各位帮帮忙,我对VC++不是很熟悉,但是确实一定要实现这种功能。
在Delphi中的Dpr中的定义:
function GetMainControl(dllParent: TPtControl): TMLControl;
StdCall;
exports
GetMainControl;
Delphi中引用的类的原型:
TPtControl = class
hPtr: HWND;

//获取长度
function GetLen: Integer;
virtual;
stdcall;
abstract;
end;

TMainControl = class
procedure Init;
virtual;
stdcall;
abstract;
procedure Quit;
virtual;
stdcall;
abstract;
end;

TMLControl = class(TMainControl)
procedure Init;
override;
procedure Quit;
override;
end;

那要使用此Dll中的输出函数,
function GetMainControl(dllParent: TPtControl): TMLControl;
StdCall;
我在VC中该如何做呢?????
我是这样做的建立ControlClass.h,内容如下:
#include "stdafx.h"
class TPtControl
{
HWND hPtr;
virtual int GetLen()=0;
};
class TMainControl
{
virtual void Init()=0;
virtual void Quit()=0;
};
class TMPControl :public TPtControl {
int GetLen();
}
我想知道具体的代码。
还有在VC中用LoadLibrary的那段代码是怎么用的。另外对Delphi Dll中的
function GetMainControl(dllParent: TPtControl): TMLControl;
StdCall;
在VC中怎么定义及引用,载入。
 
请各位帮帮忙,我对VC++不是很熟悉,但是确实一定要实现这种功能。
在Delphi中的Dpr中的定义:
function GetMainControl(dllParent: TPtControl): TMLControl;
StdCall;
exports
GetMainControl;
Delphi中引用的类的原型:
TPtControl = class
hPtr: HWND;

//获取长度
function GetLen: Integer;
virtual;
stdcall;
abstract;
end;

TMainControl = class
procedure Init;
virtual;
stdcall;
abstract;
procedure Quit;
virtual;
stdcall;
abstract;
end;

TMLControl = class(TMainControl)
procedure Init;
override;
procedure Quit;
override;
end;

那要使用此Dll中的输出函数,
function GetMainControl(dllParent: TPtControl): TMLControl;
StdCall;
我在VC中该如何做呢?????
我是这样做的建立ControlClass.h,内容如下:
#include "stdafx.h"
class TPtControl
{
HWND hPtr;
virtual int GetLen()=0;
};
class TMainControl
{
virtual void Init()=0;
virtual void Quit()=0;
};
class TMPControl :public TPtControl {
int GetLen();
}
我想知道具体的代码。
还有在VC中用LoadLibrary的那段代码是怎么用的。另外对Delphi Dll中的
function GetMainControl(dllParent: TPtControl): TMLControl;
StdCall;
在VC中怎么定义及引用,载入。
 
vc?不太熟
 
顶部