拜托问,执行到第一个end时报内存错误是什么原因呢?
library USEME;{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
ShareMem,
SysUtils,
Classes,
Ulogic in 'Ulogic.pas',
Unit3 in 'Unit3.pas' {Dm: TDataModule};{$R *.res}function Usemeobj: Tuser;
begin
Result:=Tuser.Create;
end;-------------报错//begin
exports
Usemeobj;
end.
library USEME;{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
ShareMem,
SysUtils,
Classes,
Ulogic in 'Ulogic.pas',
Unit3 in 'Unit3.pas' {Dm: TDataModule};{$R *.res}function Usemeobj: Tuser;
begin
Result:=Tuser.Create;
end;-------------报错//begin
exports
Usemeobj;
end.
解决方案 »
- 请教delphi转换bcb,一小函数,谢谢,200分,BCB区还有100
- 在DBGrid中操作数据库的问题
- ●●●如何在两个含有密码的ACCESS数据库之间进行查询操作(解决问题则另加100分)●●●
- WebBrowser1怎样得到网页中所有的标签?
- 请教一个如何将当前文本内容包括字体信息保存进数据库的问题
- Delphi启动出错
- 以前做web程序的多长时间能入手delphi了
- 请问 DBTree一般是怎么用, 谁能很初级的讲讲?
- 有关Oracle数据库的问题?很急~~~~~~~~~~~~~~~~~~~~~~
- 我想学习Delphi,大家帮忙推荐一本好书!
- ClientSocket连接不成功3980次就报告错误,说缓冲区不足的,不知大家没有见过。
- 请教两个问题!
thanks
你跟踪一下VCL内部的了些代码吧,可能会找到问题所在。不过大部分还是自己的错,最好把你代码多贴出来一些,大家看看。
找个.dll的例子see see
现在打算全部重写看看.构造函数里空空的啥也没有.
虽然我坚信是自己的问题不过
--'你跟踪一下VCL内部的了些代码吧,可能会找到问题所在。'
--该怎么看呢是研究那些汇编指令吗?
Project P1.exe raised exception class ESocketError with with message 'Windows socket error:可能是应用程式尚未呼叫
WSAStartup' 或WSAStartup发生失败.(10093),on API'closesocket".Process stopped. Use Step or Run to coontinue.
若编译成exe执行退出时不会报错.会是什么原因造成的呢?
-------************form 代码:
unit Uman;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,Uuseri;type
{ Tuser = class(Tobject)
public
function WipQuery(sn: string):string; virtual; abstract;
end;} TForm1 = class(TForm)
BitBtn1: TBitBtn;
Edit1: TEdit;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
function UserA :ijack; external 'useme.dll';
implementation{$R *.dfm}procedure TForm1.BitBtn1Click(Sender: TObject);
var kk:ijack;
begin
kk:=usera;
edit1.Text:=kk.WipQuery('');
// usera.Free;
end;end.
*********************dll********
library useme;{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
SysUtils,
Classes,
Udm in 'Udm.pas' {DataModule2: TDataModule},
Ulogic in 'Ulogic.pas',
Uuseri in 'Uuseri.pas';{$R *.res}function UserA: ijack;
begin
UserA := Tuser.create;
end;exports
UserA;
end.************************interface*************
unit Uuseri;interface
type
Ijack= interface(Iinterface)
['{3EC3FDBF-D41E-47DE-B455-816A8765B374}']
function wipquery(sn:string):string;
end;
implementationend.