R
rss
Unregistered / Unconfirmed
GUEST, unregistred user!
那就继续吧:
将Delphi函数:
function ShowForm(mainForm:TForm):integer;stdcall
var
Form1: TForm1;
ptrLongInt;
begin
ptr:=@(Application.MainForm);
ptr^:=LongInt(mainForm);
Form1:=TForm1.Create(mainForm);
Form1.Show;
result:=1;
end;
转为 CBuilder
int ShowForm(TForm *mainForm)
{
TFrom **m1
//因MainForm 为指向指针的指针
m1=&(Application->MainForm)
*m1=mainForm;
TForm *Form1=new TForm(mainForm);
Form1->Show();
return 1
}
编译无问题,运行显示子窗口后就出错.
本人对C++的指针很糊涂,请高手指点改怎样转换Delphi函数.
将Delphi函数:
function ShowForm(mainForm:TForm):integer;stdcall
var
Form1: TForm1;
ptrLongInt;
begin
ptr:=@(Application.MainForm);
ptr^:=LongInt(mainForm);
Form1:=TForm1.Create(mainForm);
Form1.Show;
result:=1;
end;
转为 CBuilder
int ShowForm(TForm *mainForm)
{
TFrom **m1
//因MainForm 为指向指针的指针
m1=&(Application->MainForm)
*m1=mainForm;
TForm *Form1=new TForm(mainForm);
Form1->Show();
return 1
}
编译无问题,运行显示子窗口后就出错.
本人对C++的指针很糊涂,请高手指点改怎样转换Delphi函数.