Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I create a dll for the MetaTrader 4(an Forex Treader Software which has a C-like program language in it). I know how to import dll create by myself. But I don't know the best way to debug the dll created by vs2008. I just create a Script in MetaTrader to test the dll (every time I update the dll, I must copy the updated dll to the right place where the Script can import it.very tedious).

Is there a simpler way to do that things? Please tell me if there is, thanks.
Posted

You can debug a DLL just like any other application in Visual Studio. All you have to do is tell Studio what executable will load the dll and you'll be able to debug from there. Here's a description:
http://msdn.microsoft.com/en-us/library/605a12zt%28v=VS.90%29.aspx[^]

If you debug in this manner, you'll have all Studio's debug capabilities available to you (breakpoints, TRACE statements, output window, etc.).
 
Share this answer
 
Comments
virusx1984 2-Aug-11 9:19am    
where to find an example?
Albert Holguin 2-Aug-11 9:59am    
Would it kill you to do a little research now that I've told you this is possible? Sigh... Here's an example of someone doing it (in VS2005):
http://www.geotestinc.com/KnowledgeBase/KBArticle.aspx?ID=219[^]
Set the output path (project settings) to the target path where the DLL is loaded from.
Regards.
 
Share this answer
 
v2
You are out of luck.

It used to be that MT4 DLLs could be debugged. But newer versions of the Metatrader terminal have debugging protection by Themida and will crash on purpose when it detects a debugger. So the trick would be to find a debugger that Themida does not detect. (So far I havent found one, but I am not expert on debuggers).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900