Einzelnen Beitrag anzeigen

schwa226

Registriert seit: 4. Apr 2008
400 Beiträge
 
#7

Re: Dynamische DLL Funktion bringt nur Fehler

  Alt 17. Okt 2008, 16:25
@sirius: Vielen dank! Funktioniert super! Habe noch einen Windows Version Check eingebunden damit die Fehlersuche leichter wird...

Jetzt hab ich aber ein neues Problem und zwar so neu, da ich noch nie mit FastMM gearbeitet habe.

Ich will ja eine externe DLL Laden. Diese DLL scheint FastMM mitcompiliert zu haben den beim Loadlibray bekomme ich diese Meldung:
http://s3b.directupload.net/images/0...p/q3bvuxtj.jpg
Wenn ich die Applikation dann beende bekomme ich gar nicht schöne Fehlermeldungen (ca 3 STK).

Nach etwas suchen habe ich dann die FastMM gefunden und in meinem Projekt File ganz oben bei den uses angegeben:
Code:
uses
  FastMM4 in 'FastMM4.pas',
  FastMM4Messages in 'FastMM4Messages.pas',
Dann gab es noch keine Verbesserung. Dann habe ich noch in der "FastMM4Options.inc" das aktiviert:
Code:
{-----------------------Memory Manager Sharing Options------------------------}

{Allow sharing of the memory manager between a main application and DLLs that
 were also compiled with FastMM. This allows you to pass dynamic arrays and
 long strings to DLL functions provided both are compiled to use FastMM.
 Sharing will only work if the library that is supposed to share the memory
 manager was compiled with the "AttemptToUseSharedMM" option set. Note that if
 the main application is single threaded and the DLL is multi-threaded that you
 have to set the IsMultiThread variable in the main application to true or it
 will crash when a thread contention occurs. Note that statically linked DLL
 files are initialized before the main application, so the main application may
 well end up sharing a statically loaded DLL's memory manager and not the other
 way around. }
{$define ShareMM}

  {Allow sharing of the memory manager by a DLL with other DLLs (or the main
   application if this is a statically loaded DLL) that were also compiled with
   FastMM. Set this option with care in dynamically loaded DLLs, because if the
   DLL that is sharing its MM is unloaded and any other DLL is still sharing
   the MM then the application will crash. This setting is only relevant for
   DLL libraries and requires ShareMM to also be set to have any effect.
   Sharing will only work if the library that is supposed to share the memory
   manager was compiled with the "AttemptToUseSharedMM" option set. Note that
   if DLLs are statically linked then they will be initialized before the main
   application and then the DLL will in fact share its MM with the main
   application. This option has no effect unless ShareMM is also set.}
  {$define ShareMMIfLibrary}

{Define this to attempt to share the MM of the main application or other loaded
 DLLs in the same process that were compiled with ShareMM set. When sharing a
 memory manager, memory leaks caused by the sharer will not be freed
 automatically. Take into account that statically linked DLLs are initialized
 before the main application, so set the sharing options accordingly.}
{$define AttemptToUseSharedMM}

{Define this to enable backward compatibility for the memory manager sharing
 mechanism used by Delphi 2006 and 2007, as well as older FastMM versions.}
{$define EnableBackwardCompatibleMMSharing}
Dann kommt zwar immer noch die oben gezeigt Fehlermeldung beim laden der DLL. Die Fehlermeldungen beim beenden sind jedoch weg!
Muss ich noch etwas zusätzliches für Memory Share angeben?

Da ich mich mit FastMM nicht auskenne...wie kann ich das noch zum laufen bringen? Einen anderen Memorymanger benutze (soweit ich weis) nicht! Wo kann man das bei Delphi 2007 nachsehen?

Auch bekomme ich das mit dem FastMM Log-File nicht hin. Wo wird diese gespeichert?
  Mit Zitat antworten Zitat