D
delphicg
Unregistered / Unconfirmed
GUEST, unregistred user!
把下面的VB代码转换成Delphi代码,无法通过调试,求救!
其中:
K3Login,EBCGL都是金蝶的COM中间件!
dim oK3login as object
dim oItem as object
dim oItemclass as object
dim oItemClassSet as object
Set oK3login=createobject("K3login.ClsLogin"
if not oK3login.checkLogin then exit sub
set oitem=Createobject(EBCGL.item)
Set oitemSet=Createobject(EBCGL.itemclass)
set oitem=oitemSet.createnew(101,0,"1100","李四"//Createnew这个函数是个Idispath类型
oitem.savechange
oitem=nothing
oitemclass= nothing
ok3login=nothing
//转换的代码如下:
var
Com_Login_K3:TK3Login;
Com_Set_ItemClass:TItemClassSet;
Com_Set_Item:TItemSet;
OItem,OItemClass:Variant;
begin
Com_Login_K3:=TK3Login.create(self);
if not Com_Login_K3.checkLogin then exit;
Com_Set_ItemClass:=TItemClassSet.Create(self);
OItemClass:=CreateOleObject('ItemClass');//这句出错,提示“无效类型字符串”
OItemClass:=Com_Set_ItemClass.CreateNew('003','你好');//此函数类型IDispath
OItemClass:=Unassigned;//这句不能释放资源
end;
其中:
K3Login,EBCGL都是金蝶的COM中间件!
dim oK3login as object
dim oItem as object
dim oItemclass as object
dim oItemClassSet as object
Set oK3login=createobject("K3login.ClsLogin"
if not oK3login.checkLogin then exit sub
set oitem=Createobject(EBCGL.item)
Set oitemSet=Createobject(EBCGL.itemclass)
set oitem=oitemSet.createnew(101,0,"1100","李四"//Createnew这个函数是个Idispath类型
oitem.savechange
oitem=nothing
oitemclass= nothing
ok3login=nothing
//转换的代码如下:
var
Com_Login_K3:TK3Login;
Com_Set_ItemClass:TItemClassSet;
Com_Set_Item:TItemSet;
OItem,OItemClass:Variant;
begin
Com_Login_K3:=TK3Login.create(self);
if not Com_Login_K3.checkLogin then exit;
Com_Set_ItemClass:=TItemClassSet.Create(self);
OItemClass:=CreateOleObject('ItemClass');//这句出错,提示“无效类型字符串”
OItemClass:=Com_Set_ItemClass.CreateNew('003','你好');//此函数类型IDispath
OItemClass:=Unassigned;//这句不能释放资源
end;