高手帮忙啊!.net2005调用delphi的DLL 报错 AccessViolationException 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。 可是用.net2003调用就可以.
C#代码
examProj1.examClass dd = new examClass();
dd.UserLogin("张旭", "zx", "4", "192.168.1.29"); Delphi代码
procedure Texam.UserLogin(const UserID, UserPwd, Style,
ServerIP: WideString);
begin
if clsDB.GetDBConn(ServerIP) then
begin if auPwdOK1(UserID,UserPwd,Style) then
begin
if Style='1' then
begin
Main:=TMain.Create(Self);
Main.Parent:=nil;
Main.Visible:=True;
Screen.Cursor:=crDefault;
userlimit:='zh';
end;
if Style='2' then
begin
Main1:=TMain1.Create(Self);
Main1.Parent:=nil;
Main1.Visible:=True;
Screen.Cursor:=crDefault;
userlimit:='zj';
end;
if Style='4' then
begin
Main2:=TMain2.Create(Self);
Main2.Parent:=nil;
Main2.Visible:=True;
Screen.Cursor:=crDefault;
userlimit:='sj';
end;
end; end;
end; 用Tlbimp转换后的DLL 方法
public virtual void UserLogin(string UserID, string UserPwd, string Style, string ServerIP)
examProj1.examClass 的成员 请各位高手帮帮我吧,我郁闷3天了。
examProj1.examClass dd = new examClass();
dd.UserLogin("张旭", "zx", "4", "192.168.1.29"); Delphi代码
procedure Texam.UserLogin(const UserID, UserPwd, Style,
ServerIP: WideString);
begin
if clsDB.GetDBConn(ServerIP) then
begin if auPwdOK1(UserID,UserPwd,Style) then
begin
if Style='1' then
begin
Main:=TMain.Create(Self);
Main.Parent:=nil;
Main.Visible:=True;
Screen.Cursor:=crDefault;
userlimit:='zh';
end;
if Style='2' then
begin
Main1:=TMain1.Create(Self);
Main1.Parent:=nil;
Main1.Visible:=True;
Screen.Cursor:=crDefault;
userlimit:='zj';
end;
if Style='4' then
begin
Main2:=TMain2.Create(Self);
Main2.Parent:=nil;
Main2.Visible:=True;
Screen.Cursor:=crDefault;
userlimit:='sj';
end;
end; end;
end; 用Tlbimp转换后的DLL 方法
public virtual void UserLogin(string UserID, string UserPwd, string Style, string ServerIP)
examProj1.examClass 的成员 请各位高手帮帮我吧,我郁闷3天了。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货