AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Funktion in dll auslagern

Ein Thema von Pseudemys Nelsoni · begonnen am 19. Mär 2004 · letzter Beitrag vom 20. Mär 2004
Antwort Antwort
Seite 1 von 2  1 2      
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#1

Funktion in dll auslagern

  Alt 19. Mär 2004, 13:13
moin,

kann mir jemand sagen wie ich eine funktion in einer dll auslagere? ich möchte die dll nachher mit mirc aufrufen, also um mal ein beispiel zu nennen, ich möchte der dll einen wert übergeben, sie soll dann den wert multipliziert mit 2 wiedergeben. Das soll nur ein beispiel sein. also wie hätte das auszusehen?
Mario
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#2

Re: Funktion in dll auslagern

  Alt 19. Mär 2004, 13:17
Hier das DLL Tutorial bitte durcharbeiten http://www.luckie-online.de/Ablage/Exporte/

Natürlich sind noch die Schnittstellendefinitionen zu mirc zu beachten.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#3

Re: Funktion in dll auslagern

  Alt 19. Mär 2004, 13:22
danke, werd ich tun
Mario
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#4

Re: Funktion in dll auslagern

  Alt 20. Mär 2004, 14:44
das war mir doch zu schwer das tut, aber ich hab den DLL part aus meinem buch gelesen, da wars einfach erklärt .

Nun aber eine frage, in der mirc hilfe steht folgendes:

Zitat:
Technical notes
This section contains technical information for programmers who want to create DLLs for use with mIRC.

The routine in the DLL being called must be of the form:

int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)

mWnd is the handle to the main mIRC window.

aWnd is the handle of the window in which the command is being issued, this might not be the currently active window if the command is being called by a remote script.

data is the information that you wish to send to the DLL. On return, the DLL can fill this variable with the command it wants mIRC to perform if any.

parms is filled by the DLL on return with parameters that it wants mIRC to use when performing the command that it returns in the data variable.

Note: The data and parms variables can each hold 900 chars maximum.

show is FALSE if the . prefix was specified to make the command quiet, or TRUE otherwise.

nopause is TRUE if mIRC is in a critical routine and the DLL must not do anything that pauses processing in mIRC, eg. the DLL should not pop up a dialog.

The DLL can return an integer to indicate what it wants mIRC to do:

0 means that mIRC should /halt processing

1 means that mIRC should continue processing

2 means that it has filled the data variable with a command which it wants mIRC to perform, and has filled parms with the parameters to use, if any, when performing the command.

3 means that the DLL has filled the data variable with the result that $dll() as an identifier should return.

Note: You may need to create a .def file with the procedure names exported when compiling your DLL.


wie setze ich das:

int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)

in delphi um?
Mario
  Mit Zitat antworten Zitat
NicoDE
(Gast)

n/a Beiträge
 
#5

Re: Funktion in dll auslagern

  Alt 20. Mär 2004, 14:47
Zitat von Pseudemys Nelsoni:
was ist mWND? das gibts in delphi doch garnicht oder?
Das ist der Name Parameters (kannst Du in Deiner DLL nennen wie Du willst).
In C/C++ sind Parameter und Typ im Sinne der Delphi Language vertauscht.
(HWND mWnd -> mWnd: HWND)

Zitat von Pseudemys Nelsoni:
wie setze ich das:

int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)

in delphi um?
function ProcName(mWnd, aWnd: HWND; data, parms: PAnsiChar; show, nopause: LongBool): Integer; stdcall; Bzw. PByte statt PAnsiChar, je nach Verwendung.
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#6

Re: Funktion in dll auslagern

  Alt 20. Mär 2004, 14:48
sorry, hab meine frage umgeändert, da mir das auch auffiel *G*
Mario
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#7

Re: Funktion in dll auslagern

  Alt 20. Mär 2004, 18:44
hoi, danke

btw: was ist denn ein LongBool? ein langer boolean?

btw²: muss ich nicht noch export; hinter dem stdcall anfügen damit ich auf die funktion der dll zugreifen kann?
Mario
  Mit Zitat antworten Zitat
NicoDE
(Gast)

n/a Beiträge
 
#8

Re: Funktion in dll auslagern

  Alt 20. Mär 2004, 18:58
Zitat von Pseudemys Nelsoni:
was ist denn ein LongBool?
Ein Boolean mit vier (statt einem) Byte.

Zitat von Pseudemys Nelsoni:
muss ich nicht noch export; hinter dem stdcall anfügen damit ich auf die funktion der dll zugreifen kann?
Das wäre eine Möglichkeit - oder einen extra Exports-Abschnitt.
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#9

Re: Funktion in dll auslagern

  Alt 20. Mär 2004, 19:06
mach ich das mit dem extra abschnitt

achja, sorry ich hab noch eine frage dazu, wie kann ich aus PAnsiChar (enthält ja den übergebenen text oder?) nen string machen? ich meine ich muss ja irgendwie das ganze ding auslesen.

ich hatte mal einfach so planlos angefangen:

Delphi-Quellcode:
library registry_dll;

uses
  Windows, registry;

{$R *.res}

function GetKeyValue(mWnd, aWnd: HWND; data, parms: PAnsiChar; show, nopause: LongBool): Integer; stdcall; export;
var
  reg: TRegistry;
begin
  reg := TRegistry.Create;
  with reg do
  begin
    RootKey := // ja wie krieg ich den denn nun :mrgreen:
end;
in "data" muss ein pfad stecken zum Key in der registry, aber keine anung wie ich mit PAnsiChar umzugehen habe, hast du da ne Idee?

btw: Mag zwar sein das das niemand weiss, weil mirc das halt so will und nicht ihr, aber das ergebnis ist ja ein Integer, wie kann ich denn damit text wiedergeben
Mario
  Mit Zitat antworten Zitat
NicoDE
(Gast)

n/a Beiträge
 
#10

Re: Funktion in dll auslagern

  Alt 20. Mär 2004, 19:13
Zitat von Pseudemys Nelsoni:
wie kann ich aus PAnsiChar (enthält ja den übergebenen text oder?) nen string machen?
StrPas(x)
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:10 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz