Problems including c++ dll

 

Hi,


I'd like to use an extern dll. I tried to use the ExpertSample dll and it worked. I even could compile this sample with Visual Studio 2008 ant it also worked. But when I opened a new project (classlibrary(dll)) in Visual Studio and copied the code from the ExpertSample into it, I could compile it of course. But when I tried to use it in meta trader, I got the error message "cannot call function 'GetIntValue' from dll 'myLibrary.dll' (error 127)". Do anybody know what the problem could be? Do I have to set any compiler settings to get it work?

Thank you very much


mxp

 
i've just created empty project, add new item c++ file, copied source, compiled. it was successfull compiled int the metaeditor. vs 2005.
 
m.b runtime library. C/C++ -> Code generation -> runtime library, select Multi-threaded (/MT)
 

thans for your answer,


i tried what you have done(create empty project, copy code set runtime library to Multi-threaded and i had to set the Configuration Type to dynamic link library) but it the same error occured again.

What do you mean with "m.b runtime library"?

 
mxp wrote >>

thans for your answer,

i tried what you have done(create empty project, copy code set runtime library to Multi-threaded and i had to set the Configuration Type to dynamic link library) but it the same error occured again.

What do you mean with "m.b runtime library"?

Have you made sure to Export the functions from your new DLL in the same way that the sample DLL does ?...

Make sure you have something similar to the sample projects "ExpertSample.def" file in your new project. This can cause an error 127.

 

TheForexDevMan

is right. you should use def files to define exported functions.

Also build your dll as Release, not debug

Reason: