AGB  ·  Datenschutz  ·  Impressum  







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

DLL starten

Ein Thema von Dax · begonnen am 28. Mär 2003 · letzter Beitrag vom 8. Apr 2003
Antwort Antwort
Seite 1 von 2  1 2      
Dax
(Gast)

n/a Beiträge
 
#1

DLL starten

  Alt 28. Mär 2003, 06:23
Wie kann ich ein Programm als .dll kompilieren und dann auch starten(wie die Dialogboxen von Windows(Verknüpfung, Freigaben, ..))?


MfG gecko2000
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#2
  Alt 28. Mär 2003, 07:41
  1. Ein Programm mußt du als DLL schreiben. Du kannst zwar eine Exe in eine DLL verwandeln (aber dazu sind Änderungen im Code nötig).
  2. Eine DLL kann man nicht "starten", sonst wäre es eine Anwendung. Du kannst eine DLL nur "laden" und dann von deinem Programm Funktionen aus ihr aufrufen.
  3. Zitat:
    (wie die Dialogboxen von Windows(Verknüpfung, Freigaben, ..)
    Du kannst auch Fenster in DLL's unterbringen. Bitte die Foren-Suche benutzen, wir hatten das schon öfters.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#3
  Alt 28. Mär 2003, 08:43
Geht schon. Dazu liefert Windows die Programme rundll und rundll32 aus.

Zitat von MSDN:
Rundll vs. Rundll32
Rundll loads and runs 16-bit DLLs, whereas Rundll32 loads and runs 32-bit DLLs. If you pass the wrong type of DLL to Rundll or Rundll32, it may fail to run without indicating any error messages.
Rundll command line
The command line for Rundll is as follows:
RUNDLL.EXE <dllname>,<entrypoint> <optional arguments>
An example is as follows:
RUNDLL.EXE SETUPX.DLL,InstallHinfSection 132 C:\WINDOWS\INF\SHELL.INF
There are 3 issues to consider carefully in the above command line:
  1. Rundll or Rundll32 search for the given DLL filename in the standard places (see the documentation for the LoadLibrary() function for details). It is recommended that you provide a full path to the DLL to ensure that the correct one is found. For best results, use the short file name instead of the long file name to ensure that no illegal characters will appear. Note in particular that this means a DLL in the "C:\Program Files" folder should be converted to its short name.
  2. The <dllname> may not contain any spaces or commas or quotation marks. This is a limitation in the Rundll command line parser.
  3. In the above command line, the comma (,) between the <dllname> and the <entrypont> function name is extremely important. If the comma separator is missing, Rundll or Rundll32 will fail without indicating any errors. In addition, there cannot be any white spaces in between the <dllname>, the comma, and the <entrypoint> function.
......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#4
  Alt 28. Mär 2003, 08:46
Hm. OK. Überredet.

..
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Chewie

Registriert seit: 10. Jun 2002
Ort: Deidesheim
2.886 Beiträge
 
Turbo Delphi für Win32
 
#5
  Alt 28. Mär 2003, 14:15
Na ja, aber genau genommen wird die DLL nicht "gestartet". Man startet nur ein Progrramm, das eine angegebene DLL lädt und den Code an einem bestimmten Prozedureinsprungspunkt ausführt.
Martin Leim
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#6
  Alt 4. Apr 2003, 15:14
TweakUI (wers noch kennt) hat keine exe, nur eine DLL, und diese lässt sich starten wie eine exe
Mario
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#7
  Alt 4. Apr 2003, 15:36
Wenn mich nicht alles täuscht, dann ist TweakUI eine CPL (auch ein DLL Typ), welche automatisch durch die Systemsteuerung gestartet wird. Ähnlich dem Verfahren von RunDLL32.

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
OregonGhost

Registriert seit: 8. Jun 2002
Ort: Lübeck
1.216 Beiträge
 
Delphi 3 Professional
 
#8
  Alt 4. Apr 2003, 15:42
Also, unter Windows XP ist Tweak UI eine .exe
Früher war es allerdings tatsächlich eine Systemsteuerungsanwendung CPL.
Oregon Ghost
---
Wenn NULL besonders groß ist, ist es fast schon wie ein bisschen eins.
  Mit Zitat antworten Zitat
Christian Seehase
(Co-Admin)

Registriert seit: 29. Mai 2002
Ort: Hamburg
11.105 Beiträge
 
Delphi 11 Alexandria
 
#9
  Alt 4. Apr 2003, 18:01
Moin Sakura,

wenn ich nicht sehr irre ist eine CPL eine Exe für einen speziellen Zweck (so wie auch SCR Dateien). Immerhin lässt so ein Applet ja auch direkt ausführen.

Was RunDll(32) angeht:
Eigentlich müsste das Programm, korrekter Weise, RunFunctionFromDLL heissen, aber da hat dann wieder die 8.3 Konvention für System DLLs zugeschlagen
Tschüss Chris
Die drei Feinde des Programmierers: Sonne, Frischluft und dieses unerträgliche Gebrüll der Vögel.
Der Klügere gibt solange nach bis er der Dumme ist
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#10
  Alt 4. Apr 2003, 18:41
Zitat von Christian Seehase:
wenn ich nicht sehr irre ist eine CPL eine Exe für einen speziellen Zweck (so wie auch SCR Dateien). Immerhin lässt so ein Applet ja auch direkt ausführen.
Nop, Du hast mich zwar gerade zum Zweifel gebracht, aber Delphi hat mich bestätigt.
Delphi-Quellcode:
// HIER STEHTS ***********
library Project2;

uses
  CtlPanel,
  Unit1 in 'Unit1.pas{AppletModule1: TAppletModule};

exports CPlApplet;

{$R *.RES}

// UND HIER STEHTS ***********
{$E cpl}

begin
  Application.Initialize;
  Application.CreateForm(TAppletModule1, AppletModule1);
  Application.Run;
end.
Die CPL Dateien werden auch über die RUNDLL32 ausgeführt:
Code:
rundll32.exe shell32.dll,Control_RunDLL %1,%*
......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  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 03:24 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