请帮忙把这段C++代码翻译成Delphi,谢谢!(50分)

  • 主题发起人 tianjh007
  • 开始时间
T

tianjh007

Unregistered / Unconfirmed
GUEST, unregistred user!
不懂C++.时间紧,现学来不及了,请帮帮忙,很简单的只是我不懂.谢谢!
long DllExport InitUserDLL3(LPSLDWORKS pSldWorks)
{
UserApp = new userApplication(pSldWorks);
UserApp->startApp();
return 97001;
}
或是:
long DllExport InitUserDLL3(ISldWorks* pSldWorks)
{
UserApp = new userApplication( );
UserApp->startApp();
return 97001;
}
 
L

LiChaoHui

Unregistered / Unconfirmed
GUEST, unregistred user!
恐怕翻译不了, 他们是针对不同的类库的
针对与特定类库的代码通常很难翻译
 
T

tianjh007

Unregistered / Unconfirmed
GUEST, unregistred user!
那请问一下new userApplication( );这种用法在Delphi中应该怎么用
 
L

LiChaoHui

Unregistered / Unconfirmed
GUEST, unregistred user!
Delphi中的Application对象是个全局对象, 不需要自己创建的
如果要自己创建,可以这样
Application := TApplication.Create;
 
L

leway

Unregistered / Unconfirmed
GUEST, unregistred user!
userApplication是自定義的Class,完成特定的功能。
UserApp = new userApplication(pSldWorks);創建服務程序實體
UserApp->startApp();運行服務程序。startApp()是Class userApplication的成員函數。
new userApplication( );在Delphi中就是
var
UserApp: userApplication;
begin
UserApp:= userApplication.create;
end;

 
T

tianjh007

Unregistered / Unconfirmed
GUEST, unregistred user!
to leway:
有点懂了
再问一下LPDISPATCH是什么,是数据类型吗?
 
L

leway

Unregistered / Unconfirmed
GUEST, unregistred user!
LPSLDWORKS是定義的一個類型,具體是什麼數據結構,要看它的代碼。
 
L

LiChaoHui

Unregistered / Unconfirmed
GUEST, unregistred user!
可能是一个接口的指针
 
T

tianjh007

Unregistered / Unconfirmed
GUEST, unregistred user!
T

tianjh007

Unregistered / Unconfirmed
GUEST, unregistred user!
多人接受答案了。
 

Similar threads

I
回复
0
查看
706
import
I
I
回复
0
查看
806
import
I
I
回复
0
查看
802
import
I
I
回复
0
查看
698
import
I
顶部