问你个问题,为什么我在dll里创建一个窗体,在别的程序里调用。
放其他的控件就好用,放ado控件就不好用?
在同事写的代码和我一样,就好用?
我的机器运行他们的程序,好用?
他们的机器运行我的程序,不好用?
他们在我机器上写一个dll,就不好用?
我重装了系统和delphi还不好用?为什么?为什么?为什么?为什么?错误提示:
exception EOLESYSERROR in module project1.dll at 000582a9
代码如下:
///////////////////////////library Project1
library Project1;uses
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1};exports showform name 'showform';//dll入口
begin
end.
/////////////////////////library Project1中的窗体单元
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB;type
TForm1 = class(TForm)
ADOConnection1: TADOConnection;
private
{ Private declarations }
public
{ Public declarations }
end;
function showform:boolean;stdcall;
var
Form1: TForm1;
implementation{$R *.dfm}
function showform:boolean;stdcall;
begin
form1:=Tform1.Create(application);
form1.ShowModal;
form1.Free;
end;
end.
//////////////////////////////调用
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
function showform:boolean;stdcall;external '..\dll\Project1.dll' name 'showform';
{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
showform;
end;end.
放其他的控件就好用,放ado控件就不好用?
在同事写的代码和我一样,就好用?
我的机器运行他们的程序,好用?
他们的机器运行我的程序,不好用?
他们在我机器上写一个dll,就不好用?
我重装了系统和delphi还不好用?为什么?为什么?为什么?为什么?错误提示:
exception EOLESYSERROR in module project1.dll at 000582a9
代码如下:
///////////////////////////library Project1
library Project1;uses
SysUtils,
Classes,
Unit1 in 'Unit1.pas' {Form1};exports showform name 'showform';//dll入口
begin
end.
/////////////////////////library Project1中的窗体单元
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB;type
TForm1 = class(TForm)
ADOConnection1: TADOConnection;
private
{ Private declarations }
public
{ Public declarations }
end;
function showform:boolean;stdcall;
var
Form1: TForm1;
implementation{$R *.dfm}
function showform:boolean;stdcall;
begin
form1:=Tform1.Create(application);
form1.ShowModal;
form1.Free;
end;
end.
//////////////////////////////调用
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
function showform:boolean;stdcall;external '..\dll\Project1.dll' name 'showform';
{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
showform;
end;end.
解决方案 »
- 求助关于子窗口的关闭问题
- 为什么说Adodataset1:Field name missing?
- 新年了,给大家散点分吧,分帖一
- 请问怎样使用Delphi中的TADODataset控件获取COM+返回的Recordset?
- 如何利用sql语句向数据库表中添加记录!!
- aodquery 中能在记录中一条一条的移动吗?
- 请问在类中声明一个属性域的类型为TNotifyEvent时,该属性如何使用,为什么要声明该种类型的属性?
- 请问,建表的时候,编号字段的类型,是自动添加好,还是用户自己输
- 编游戏的问题
- 千山火线求援!居然被 TADOStoredProc 搞定,Up有分
- 求助:哪位大侠有通用查询的例子!
- 庆祝减肥成功,第四次大散分(以100分奖励第一个,中间两个和最后一个进来的朋友)
http://info.borland.com/devsupport/delphi/downloads/dado501readme.html第二个ado升级包
http://info.borland.com/devsupport/delphi/mdac26.html差点忘了说了,都是for delphi5的
而ADO是MS的东东,对于DELPHI来说,就是调用了COM,当然要就初化了,就可在DLL里调OLE一样.这个问题我已经回答过N次了.
所以要在你创建ADO之前调用CoInitiaLize(nil)使用完以后再调用coUnInitiaLize.
确实是5116888(没有阳光)说的那样
因为我是在DLL中调用ADO
普通的调用当然没问题了
谢谢你,没办法,做人要守信用, 100分给阳光了
分不是主要的,主要是学习,对吗?
以后还要麻烦你啦