C++ CPP Calling a DLL dynamically with parameters
<p>I am not C++-professional yet. I am doing my master thesis and mainly programming. There will be 4 DLLs and one exe in the end.<br>
I googled some stuff, how to compile dlls and stuff and already made a dll from a "template". Now, the question is: How do I call a dll dynamically from cpp with parameters?</p>

<p>This is my code (mainly from <a href="http://www.tutorialspoint.com/dll/dll_writing.htm" rel="nofollow">here</a>):</p>

<pre><code>#include &lt;cstdlib&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;
#include &lt;iostream&gt;
#include &lt;stdio.h&gt;
#include &lt;windows.h&gt;
#include &lt;stdexcept&gt;

typedef VOID (*DLLPROC) (LPTSTR);

HINSTANCE hinstDLL;
DLLPROC HelloWorld;
BOOL fFreeDLL;

hinstDLL = LoadLibrary("Test-DLL.dll");

if (hinstDLL != NULL)
{
   HelloWorld = (DLLPROC) GetProcAddress(hinstDLL, "hello");

   if (HelloWorld != NULL)
      (HelloWorld);

   fFreeDLL = FreeLibrary(hinstDLL);
}
</code></pre>

<p>The function to be called is <code>hello(const char *s)</code>. How do I pass the <code>*s</code> to the dll?</p>