Executable directory where application is running from?

This is the first post on google so I thought I’d post different ways that are available and how they compare. Unfortunately I can’t figure out how to create a table here, so it’s an image. The code for each is below the image using fully qualified names. My.Application.Info.DirectoryPath Environment.CurrentDirectory System.Windows.Forms.Application.StartupPath AppDomain.CurrentDomain.BaseDirectory System.Reflection.Assembly.GetExecutingAssembly.Location System.Reflection.Assembly.GetExecutingAssembly.CodeBase New … Read more

Windows CRT and assert reporting (abort, retry, ignore)

This works (for me atleast, on vs 2008): (Essentially, return TRUE from the hooked function) int __cdecl CrtDbgHook(int nReportType, char* szMsg, int* pnRet) { return TRUE;//Return true – Abort,Retry,Ignore dialog will *not* be displayed return FALSE;//Return false – Abort,Retry,Ignore dialog *will be displayed* } int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { _CrtSetReportHook2(_CRT_RPTHOOK_INSTALL, CrtDbgHook); assert(false); … Read more

Visual Studio 2008 with c++11

In short words, it’s impossible. VS2008 has no C++11 support and replacing the libraries would lead to chaos. In long words, you maybe could do something: Use another compiler: C++ compiler support (Updated Link) You could upgrade your visual studio, but even MSVC12 (visual studio 2013) is not supporting all of C++11 standard. You could … Read more

In Visual Studio (2008) is there a way to have a custom dependent file on another custom file?

There is VSCommands add-in which allow you to configure dependant files directly from IDE Link updated, previous was http://mokosh.co.uk/vscommands FYI: When VSCommands is installed, just select all the files you want to be Dependant and the root file, then Right Click -> Group Items… and VSCommands will ask which of the files you would like … Read more