为什么DLL出错??,急呀!!(Access Violation at address 002B7F56 in module 'calbom.dll',read

  • 主题发起人 主题发起人 pmis
  • 开始时间 开始时间
P

pmis

Unregistered / Unconfirmed
GUEST, unregistred user!
为什么DLL出错??,急呀!!(Access Violation at address 002B7F56 in module 'calbom.dll',read of address '0000005C')(100分)<br />DLL内容:
library calbom;

uses
ShareMem,
SysUtils,
DB,
ComCtrls,
Classes,
QDialogs,
BomDataMoudle in '../BomDataMoudle.pas' {DataModule1: TDataModule};

{$R *.res}

Procedure expand(itname:Pchar;bomview:TTreeView);StdCall;
Begin
//程序中有调用ClientDataset
End;

Exports
expand;

begin
end.


调用DLL的程序如下:
unit BOMAdd;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ComCtrls, ExtCtrls, DBCtrls, Mask, Grids,
DBGrids,DB;

type
TBom_Add = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
TItem: TEdit;
SBS1: TSpeedButton;
SBR1: TSpeedButton;
Label2: TLabel;
TDp: TEdit;
BOMTree: TTreeView;
procedure SBS1Click(Sender: TObject);
procedure BOMTreeClick(Sender: TObject);
procedure BOMTreeDblClick(Sender: TObject);
procedure SBR1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Bom_Add: TBom_Add;

implementation

uses BomDataMoudle;
Procedure expand(itname:Pchar;bomview:TTreeView);StdCall
external 'calbom.dll';

{$R *.dfm}

procedure TBom_Add.SBS1Click(Sender: TObject);
var
Str:String;
test:Pchar;
Begin
With BOMDM.C310 Do
Begin
close;
str:='Select item,part,unit,levels,begins,ends,Scrap From s310 Order by item,part';
commandtext:=str;
open;
End;

With BOMDM.C310S Do
Begin
close;
str:='Select part,keys,um,dp,line from s130 Order by part';
commandtext:=str;
open;
End;
test:=pchar(trim(TItem.text));
expand(test,BOMTree);
end;
 
itname没有分配内存
 
楼上兄台,要怎么分配内存啊
 
兄弟姐妹们,找个办法给我呀,谢啦
 

Similar threads

I
回复
0
查看
487
import
I
I
回复
0
查看
529
import
I
I
回复
0
查看
2K
import
I
I
回复
0
查看
711
import
I
后退
顶部