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

dll 該如何寫程式呼叫到另一應用程式

尚未結案
pricejit2
一般會員


發表:53
回覆:18
積分:14
註冊:2005-01-28

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-04-01 11:18:52 IP:220.229.xxx.xxx 未訂閱
dll檔案的使用方法 1 我用一個計算機的應用程式並把它包成dll檔 2在另一個應用程式 須使用到計算機 用呼叫dll 的方式 但程式碼不知如何運用 請各位大大幫忙
jeffreck
高階會員


發表:247
回覆:340
積分:197
註冊:2003-01-23

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-04-01 14:52:05 IP:61.218.xxx.xxx 未訂閱
引言: dll檔案的使用方法 1 我用一個計算機的應用程式並把它包成dll檔 2在另一個應用程式 須使用到計算機 用呼叫dll 的方式 但程式碼不知如何運用 請各位大大幫忙
    我的寫法    New一個 DLL Wizard
------------------------------
專案檔 *.dpr    library GetAccessMsg;    uses
  SysUtils,
  Classes,
  SendMsg in 'SendMsg.pas';    exports
   SendToLogSale,
   GoToLogSale;
{$R *.res}    begin
end.
-----------------------------------------------------------
程式 *.pas
------------------------------
unit SendMsg;    interface    Uses  Windows,Messages, Dialogs,ShellApi,SysUtils,Forms;               // .dll中提供給外部呼叫用的函式
Function SendToLogSale(str1:Pchar;str2:Pchar;str3:Pchar):Boolean;export;stdcall;
Function GoToLogSale():Boolean;export;stdcall;    implementation    Function SendToLogSale(str1:Pchar;str2:Pchar;str3:Pchar):Boolean;
Begin
''''    end    ------------------------------------------------
VB 去 Call
------------------------------
Option Explicit
Public Declare Function SendToLogSale Lib "I:\GetAccessMsg.dll" (ByVal str1 As String, ByVal str2 As String, ByVal str3 As String) As Boolean
Public Declare Function GoToLogSale Lib "I:\GetAccessMsg.dll" () As Boolean    Public Function uf_RunLonSale(FormName As String) As String       If SendToLogSale("OPENFORM", FormName, "") Then       Else
    MsgBox ("錯誤!!")
   End If
    
End Function    Public Function uf_GoToLogSale() As String       If GoToLogSale() Then       Else
    MsgBox ("錯誤!!")
   End If
    
End Function  
jeffreck
高階會員


發表:247
回覆:340
積分:197
註冊:2003-01-23

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-04-01 17:57:07 IP:61.218.xxx.xxx 未訂閱
由Delphi 去 Call http://delphi.ktop.com.tw/topic.php?topic_id=66141
系統時間:2024-06-27 0:05:31
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!