title: how to declare c# dll functions dynamically in c++ builder
body: <p>i tried the code shown below  to call a c# dll function (COM) but when i do that i get the errors below "Invalid use of namespace 'MaxElementFn'"</p>
  
  <p>My guess is that maybe i am calling the c# dll function incorrectly in c++ builder. any suggestion will be greatly appreciated. thank  you in advance.</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  #include &lt;cstdio&gt;
  
  using MaxElementFn = int(__stdcall *) (int a, int b);
  
  int main()
  
  {
  
    HMODULE mod = LoadLibraryA("ExportedCodeSolution.dll");
  
  
    MaxElementFn maxElement = reinterpret_cast&lt;MaxElementFn&gt;(GetProcAddress(mod, "maxElement"));
  
  
    std::printf("max: %d\n", maxElement(1, 2));
  
  
  }
  
  [BCC32 Error] Unit1.cpp(145): E2070 Invalid use of namespace 'MaxElementFn'
  [BCC32 Error] Unit1.cpp(151): E2451 Undefined symbol 'MaxElementFn'
  </code></pre>
  
  <p>these are the errors i am getting</p>