Posted by on in Blogs
Explicit DLL load from Delphi You may also want to call your DLL function directly from Delphi. No more comments, just a sample code: program A; {$APPTYPE CONSOLE} uses Windows, System.SysUtils; var   res : Integer;   dll_handle: THandle;   MyFunction: function(param: integer): Integer stdcall; begin   res := 0;   dll_handle := LoadLibrary('My.DLL');   if (0 <> dll_handle)   then begin     @MyFunction := GetProcAddress(dll_handle, '_DllFunction');     if (NIL <> @MyFunction)     then begin       r...

Posted by on in Blogs
Implicit and Explicit DLL loading DLL could be loaded implicitly or explicitly. Another way is Static Linkage that allows placing all required functions to your program to avoid DLLs usage at all, but it is out of this post. Implicit DLL loading is having your program to load DLL before main() called. You specify DLL's library name already when linking a program; it will work with that exact version of DLL and will not even start without. Implicit load pros/contras: + Simple + Program will either start or not - Longer loadi...

Posted by on in Blogs
Entry point routine in RAD XE3 created DLL Typical DLL has an entry point. This is a function with a specific name which linker aware of. When DLL is loaded or unloaded this function is called; that helps to init DLL data or release resources. If you need this you should implement such a function. On RAD-built DLL load/unload, DLL itself automatically calls first matched function from this list: DllEntryPoint(), DllMain(),and last _libmain(). If more than one co-exists, others will be optimized-out, i.e. only best match will reside in...

Posted by on in Blogs
Creating simple DLL using RAD XE3 I will dig to details assuming you have already read this article: http://docwiki.embarcadero.com/RADStudio/en/Creating_Packages_and_DLLs In order to create a simple DLL in Embarcadero RAD XE3 create a new DLL project: File|New|Other…|C++BuilderProjects|Dynamic-linkLibrary Set it: C++ = On, Target Framework = None, Multi Threaded = On You will already have some code like: extern "C" int _libmain(unsigned long reason) { return 1; } Save and build; open your build folder...

Posted by on in Blogs
What to expect here? I work for Embarcadero as QA and my primary area is testing Debugger, mostly its low-to-mid levels. Hence, I keep my fingers on RAD features. Here I would like to share not very straight-forward things that could save some time to SW developers who use Embarcadero RAD Studio XE3....
  • Page :
  • 1

Check out more tips and tricks in this development video: