I guess the question would be now is, what version of Lazarus and are you doing GUI objects in the DLLs?
The DLL is not Doing anything with my GUI, Thanks
Possibilities:
- 32-bit vs 64-bit problem? Main program one, dll the other?
- dependencies of the DLL
- multiple versions of the dll and/or its dependencies.
Main Programm is executed as 32 Bit. I will check the DLL, Thanks.
Hi!
Toto, we're not in Win95 anymore!
Read this carefully where to put (or hide) your DLL:
https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order
As always with M$: 50 ways to leave your lover ....
Winni
Thats a Lot of confusing Stuff right there but im Sure i put it right with an ok Name, Thanks.
Hello Guys
So Today i tried to include a Dll like that :
{ ----- dll-files ----- }
libCAL_CC = 'CoilCalc.dll';
LIbCAL_CD = 'C:\WGKBlck\DBM\calcdll.dll';
//CoilCalc
Function CoilCalc (Inpt : PChar;var Buffer : PChar) : LongInt; stdcall; external libCAL_CC;
//StartJob
Function StartJob (p1 : Single; p2, p3 : Variant) : Boolean; stdcall; external LIbCAL_CD;
The "CoilCalc.dll" did work (used it many times before)
But When i included the Second 1 the Application didn't Start (No Messages) just noticed it was Debugging and after that (Finished or not) it Stoped.
Can Some1 Help me Please ?
With external and fpc you may not define the complete path of the library.
LIbCAL_CD = 'C:\WGKBlck\DBM\calcdll.dll';
Before linking, fpc will strip C:\WGKBlck\DBM and keep-look for calcdll.dll defined in your library-search-path.
In Windows it may be in the \system\ directory for example.
So just copy your library there or update the search-directory path.
But if you want to assign a custom path, then you should use dynamic loading of libraries and LoadLibrary().
I Will Try this as next ... If this Reply gets edited ..then u will know if it worked
But When i included the Second 1 the Application didn't Start (No Messages) just noticed it was Debugging and after that (Finished or not) it Stoped.
The fact that you didn't get any message means the problem is most likely in the initialization of the LibCAL_CD dll or in one of its functions the program calls early during its initialization.
Posting more code from the DLL and the program that uses it would likely be useful to give you additional help.
DLL Did Work exactly as it Should in my VB6 Code. just a different call from a different IDE, i guess..
Edit: it was a Problem with The Path, i guess. i put all my dll's in my Project order and it worked, still got Access violation, but i got the dll running !
Thank u Guys for ur Help.