線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1239
推到 Plurk!
推到 Facebook!

dll錯誤訊息--invalid pointer opertion

尚未結案
Ivy_chen
一般會員


發表:3
回覆:5
積分:1
註冊:2003-01-15

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-05-20 10:57:10 IP:203.75.xxx.xxx 未訂閱
請問各位高手 為何呼叫dll後會出現invalid pointer opertion 訊息?我所寫的DLL如下: library telcond; uses SysUtils, Classes, telcon in 'telcon.pas'; {$R *.RES} exports tranchn; begin end. -------------------------------------------------------------------- unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Edit1: TEdit; Label1: TLabel; Label2: TLabel; Button1: TButton; Label3: TLabel; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; procedure tranchn(var v: string; var C1:STRING; var C:STRING); external 'telcond.DLL'; implementation {$R *.dfm} .............. 請幫幫忙! 謝謝!
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-05-20 11:10:07 IP:147.8.xxx.xxx 未訂閱
If you want to use string in your dll, you should uses ShareMem in both your dll and your main application and it should be the very first unit to be used. However I would recommend using PChar instead of string since it could be used with other development tools. 發表人 - william 於 2003/05/20 11:11:19
Ivy_chen
一般會員


發表:3
回覆:5
積分:1
註冊:2003-01-15

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-05-20 17:36:13 IP:203.75.xxx.xxx 未訂閱
謝謝你的指導! 我把STRING改成PCHAR後就可以了! 不過我沒有uses ShareMem,我試過加上去,可是反而有錯誤訊息 "runtime ....." 總之,謝謝你!
系統時間:2024-05-15 14:45:07
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!