title: connecting and using a Delphi DLL in C++ Builder
body: <p>I wanted to ask for some help.
  I know, that there are a lot of places, where i can get this information. But, anyway, I have a problem connecting a Delphi DLL to my C++ Builder project.</p>
  
  <p>For example, my Delphi DLL looks like:</p>
  
  <pre><code>library f_dll;
  
  uses
    SysUtils,
    Classes,
    Forms,
    Windows;
  
  procedure HW(AForm : TForm);
          begin
                  MessageBox(AForm.Handle, 'DLL message', 'you made it!',MB_OK);
          end;
  exports
          HW;
  
  {$R *.res}
  
  begin
  
  end.
  </code></pre>
  
  <p>And this is how i connect a DLL and a function inside:</p>
  
  <pre><code>//defining a function pointer type
  typedef void (*dll_func)(TForm* AForm);
  
  dll_func HLLWRLD = NULL;
  
  HMODULE hDLL = LoadLibrary("f_dll.dll");
  if (!hDLL) ShowMessage("Unable to load the library!");
  
  //getting adress of the function
  HLLWRD = (dll_func)GetProcAddress(hDLL, "_HW"); 
  
  if (!pShowSum) ShowMessage("Unable to find the function");
  
  HLLWRLD(Form1);
  
  FreeLibrary(hDLL);
  </code></pre>
  
  <p>I have no mistake messages from compiler, I only have my Message Box saying, that dll is not connected. I have put my dll in project folder, in Debug folder. but there is just no connection.</p>
  
  <p>Please, I am asking you to help me. What is my mistake?</p>
  
  <p>EDIT: i've posted C++ code with mistakes, so here is the right one (this is for people, that have similar problems):</p>
  
  <pre><code>//defining a function pointer type
  typedef void (*dll_func)(TForm* AForm);
  
  dll_func HLLWRLD = NULL;
  
  HMODULE hDLL = LoadLibrary("f_dll.dll");
  if (!hDLL) ShowMessage("Unable to load the library!");
  
  //getting adress of the function
  HLLWRD = (dll_func)GetProcAddress(hDLL, "HW");  //HW instead _HW
  
  if (!HLLWRLD) ShowMessage("Unable to find the function"); //HLLWRLD instead pShowSum
  
  HLLWRLD(Form1);
  
  FreeLibrary(hDLL);
  </code></pre>