拜托问,执行到第一个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.
解决方案 »
- 客户端调用服务端的方法是报错'method ***** not supported by automation object' 自动化对象不支持该方法?怎么回事
- 散分纪念一下
- 【麻烦大家一下】青岛到底怎么样
- 请问怎么在DELPHI执行 HTML文件但不要打开(显示) 这个 HTML文件
- 看一下这个"Record not found or changed by another user"问题,和其他人的不一样.
- 请问如何在Delphi中调用bcp?急!!
- CSDN积分问题?
- 大家帮我看看,这个三层结构的数据库访问为什么会出先这等怪事(这是李维书上的例子哦)
- 如何设置透明色?
- 如何执行存储过程
- 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.