Excel won't load function from C++ DLL -


Good afternoon, all.

I am using Excel and amp; VBA is loading some DLLs and seeing what kind of problems I might have.

I made my own, very simple DLL to try it out. Why can not I understand for my life, but when I try to run, "I did not get the DLL function not found" message.

What do I have in my workbook ...

  personal declare sub-mouseclub "\ location \ myDLL" The nickname "_MouseClick" () 'I have also tried ...' () Sub Test () MouseClick and Sub   

Here is my simple function declaration in DLL ...

  extern "C" {void MouseClick (); ...}   

I thought that the name of my function might have been complicated when compiled, so I used the 'nm' to check ... < Pre> $ Nm myDLL.dll | Grep MouseClick 6df81254 T _MouseClick $ nm -C myDLL.dll | Grep MouseClick 6df81254T MouseClick

I do not understand ... I have used both of them to use to use it. Besides, I have a function that uses MouseClick Function Distinguishes it from using gdb ...

  $ gdb myDll.dll (gdb) test test function Function of assembler code for test function: 0x6df81327 & lt; + 0> : Push% EBP 0x6df81328 & lt; + 1>: mov% esp,% ebp ... 0x6df81361 & lt; + 58 & gt;: Call 0x6df81a44 & lt; SetCursorPos @ 8 & gt; 0x6df81366 & lt; + 63>: sub $ 0x8,% esp - & gt; 0x6df81369 & lt; + 66 & gt;: Call 0x6df81254 & lt; MouseClick & gt; 0x6df8136e & lt; + 71>: jmp 0x6df8138a & lt; Test Function + 99 & gt; ... 0x6df8138a & lt; + 99 & gt;: Skip 0x6df8138b & lt; + 100>: Termination towards the Adler dump.   

Here, the function is also referred to as "mouseclick".

I'm going all this wrong, but I do not understand that both GDB and NM show a "clean" function name, but Excel does not work with any of those people I will believe that it will happen. I got DLL to work with my VBA for some time, but I changed the document and now it is not working.

Should someone have done so much to point me in the right direction about this? What is the name of the function in Excel? Why is nm showing a function name which is not mangled? Am I going to go about this right?

Thank you first of all!

Anyone has already gone through all of this and added your solution to include the solution Updated:

The answer is specific to the GCC, which you seem to use.

Comments