AGB  ·  Datenschutz  ·  Impressum  







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

Dll Problem

Offene Frage von "mr.unbekannt"
Ein Thema von mr.unbekannt · begonnen am 19. Jun 2007 · letzter Beitrag vom 22. Jun 2007
 
mr.unbekannt

Registriert seit: 20. Jul 2005
Ort: Schwerin
152 Beiträge
 
Delphi 7 Professional
 
#1

Dll Problem

  Alt 19. Jun 2007, 17:40
Hi @all,

ih habe ein Problem beim laden einer dll. nachfolgend erstmal den quelltext der dll und des projectes:
Delphi-Quellcode:
unit main;

interface

uses
  sharemem,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, extctrls;

type
  Tfmmain = class(TForm)
    PageControl1: TPageControl;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public

    { Public declarations }
  end;
  TShow_DLLForm = procedure; stdcall;

var
  fmmain: Tfmmain;
  Show_DLLForm: TShow_DLLForm;

implementation


{$R *.dfm}

procedure Tfmmain.Button1Click(Sender: TObject);
var
  dllhandle: Thandle;

begin
  dllhandle := 0;
  try
    dllhandle := LoadLibrary('Project1.dll');
    @Show_DLLForm := GetProcAddress(dllhandle,'startdll');
    if @Show_DLLForm <> nil then
      Show_DLLForm;
  finally
    FreeLibrary(dllhandle);
    showmessage('fertsch');
  end;

end;


end.
Delphi-Quellcode:
library Project1;

{ Important note about DLL memory management: ShareMem must be the
  first unit in your library's USES clause AND your project's (select
  Project-View Source) USES clause if your DLL exports any procedures or
  functions that pass strings as parameters or function results. This
  applies to all strings passed to and from your DLL--even those that
  are nested in records and classes. ShareMem is the interface unit to
  the BORLNDMM.DLL shared memory manager, which must be deployed along
  with your DLL. To avoid using BORLNDMM.DLL, pass string information
  using PChar or ShortString parameters. }



uses
  sharemem,
  SysUtils,
  Classes,
  dialogs,
  comctrls,
  main in 'main.pas';




{$R *.res}





procedure startdll;
begin
  fmmain.Button1.Caption := 'test';
end;

begin


end.
mein problem ist nun, dass ich die dll lade, aber die procedure Show_DLLForm nil ist und somit nicht ausgeführt wird. wo liegt der fehler? Habe leider bis jetzt keine Erfahrungen mit Dll's
  Mit Zitat antworten Zitat
 


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 14:54 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz