Einzelnen Beitrag anzeigen

Benutzerbild von Andidreas
Andidreas

Registriert seit: 27. Okt 2005
1.110 Beiträge
 
Delphi 10.1 Berlin Enterprise
 
#6

AW: Probleme mit SHGetKnownFolderPath

  Alt 22. Nov 2013, 10:43
Der Fehler kommt immer noch...

In den Units der Forms habe ich ShareMem wieder entfernt, war das falsch?

So sieht es jetzt aus:

*.dpr des Hauptprogrammes
Delphi-Quellcode:
program Main;

uses
  ShareMem,
  Forms,


Aufruf der DLL
Delphi-Quellcode:
procedure Tmain_form.prOfflineModuleLoad_Single(sDLLModulePath : String);

type
TMyFormClass    = function : TFormClass; stdcall;
TSQLiteFileConnection = procedure(SQLiteFileConnection : TUniConnection); stdcall;
TSQLiteMemoryConnection = procedure(SQLiteMemoryConnection : TUniConnection); stdcall;
TParms = procedure(Language, UserSewingPlant, UserEANCheckPlantID : String) stdcall;

var
i : Integer;
lMyFormClass : TMyFormClass;
lSQLiteFileConnection : TSQLiteFileConnection;
lSQLiteMemoryConnection : TSQLiteMemoryConnection;
lParms : TParms;

begin

  //Define Variables
  gsDLL := sDLLModulePath;
  hDLL := LoadLibrary(PChar(gsDLL));
  gblDLLLoaded := True;

  //SQLite File Connection
  lSQLiteFileConnection := GetProcAddress(hDLL, 'prSQLiteFileConnect');
  If Assigned (lSQLiteFileConnection) Then
  Begin
    lSQLiteFileConnection(dmsqlite.SQLiteFile);
  End;

  //SQLite Memory Connection
  lSQLiteMemoryConnection := GetProcAddress(hDLL, 'prSQLiteMemoryConnect');
  If Assigned (lSQLiteMemoryConnection) Then
  Begin
    lSQLiteMemoryConnection(dmsqlite.SQLiteMemory);
  End;

  //Parameters
  lParms := GetProcAddress(hDLL, 'prModuleParameters');
  If Assigned (lParms) Then
  Begin
    lParms(gsPSTLanguage, gsPSTUserSewingPlant, gsPSTUserEANCheckPlantID);
  End;

  //Load DLL Form
  lMyFormClass := GetProcAddress(hDLL, 'fnForm');
  If @lMyFormClass <> Nil Then
  Begin
    frmLoadedForm   := lMyFormClass.Create(nil);
    frmLoadedForm.Position := poScreenCenter;
    frmLoadedForm.ShowModal;
  End Else
  Begin
    fnDisplayMyActionBox('ERR', 'System Error', 'prOfflineModuleLoad_Single', 'Could not load Module:', sDLLModulePath, EmptyStr, True);
  End;

end;


*.dpr der DLL
Delphi-Quellcode:
library updatecomdata;

uses
  ShareMem,
  Forms,
  Globals in '..\..\..\Globals\Globals.pas',
  Messages in '..\..\01_Globals\Messages.pas',
  myactionbox in '..\..\01_Globals\myactionbox.pas{actionbox_form},
  myerrorbox in '..\..\01_Globals\myerrorbox.pas{errorbox_form},
  Globals in '..\..\01_Globals\Globals.pas',
  updatecomdata in 'updatecomdata.pas{updatecomdata_form},
  updatecomdata_info in 'updatecomdata_info.pas{updatecomdata_info_form};

{$R *.res}

exports
  fnForm, prSQLiteFileConnect, prSQLiteMemoryConnect, prModuleParameters;

begin
end.
Ein Programmierer Programmiert durchschnittlich 15 Code Zeilen pro Tag
Wir sind hier doch nicht bei SAP!!!

Aber wir habens bald

Geändert von Andidreas (22. Nov 2013 um 10:47 Uhr)
  Mit Zitat antworten Zitat