Friday, 14 June 2013
Symlinks in perforce in windows
Basically, if you are getting small files where symlinks should be, run perforce as administrator.
Fuller description here : http://answers.perforce.com/articles/KB_Article/Enabling-Symlinks-on-Windows
Thursday, 30 May 2013
Visual Studio 2012 - "Project file '' has been renamed or is no longer in the solution"
Sometimes when messing about with projects, this unhelpful popup will plague you.
To get some more info about the actual cause..
1. Build this - https://github.com/CoherentLabs/DumpReferencesAddIn
2. Create C:\Users\\Documents\Visual Studio 2012\Addins
3. Copy in there DumpReferencesAddIn.dll which you built and DumpReferencesAddIn.AddIn which you didn't.
4. Restart VS2012, load your troublesome solution.
5. Right click on the solution and select "Dump References".
6. Enjoy.
To get some more info about the actual cause..
1. Build this - https://github.com/CoherentLabs/DumpReferencesAddIn
2. Create C:\Users\
Saturday, 18 May 2013
Use a custom icon in a dialog box in windows
When creating a windows dialog, the icon in the top left corner is the dull standard one.
Add your own funky alternative by adding this code!
SendMessage(mainDialog,WM_SETICON,ICON_BIG,(LPARAM)::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_YOURICON)));
SendMessage(mainDialog,WM_SETICON,ICON_SMALL,(LPARAM)::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_YOURICON)));
SendMessage(mainDialog,WM_SETICON,ICON_SMALL2,(LPARAM)::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_YOURICON)));
Tuesday, 2 April 2013
Running commands after exe exit
Here's what I came across.
http://stackoverflow.com/a/3458433/2237946
so modified to my requirements..
std::string g_PostScript;
int main()
{
g_PostScript+="notepad.exe \"hello.txt\" & "; //add a command
g_PostScript+="uninstall.exe & "; //and another one..
//time to exit
ApplyPostScript();
return 0;
}
void ApplyPostScript()
{
if (g_PostScript.length()==0)
return;
g_PostScript="cmd.exe /C ping 1.1.1.1 -n 1 -w 3000 > Nul & "+g_PostScript;
STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};
CreateProcess(NULL, (LPSTR)g_PostScript.c_str(), NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
}
Monday, 25 March 2013
Why is this header being included?
Often I'll find a visual studio project not compiling as a header file generates an error. Then I realise there's no need for that header to be needed as it's totally unrelated.
So why is it being included?
It can take a lot of guesswork to track down the reason in a large project, but here's a quick method of showing the whole header tree for a cpp.
Add "/ShowIncludes" to the command line options for that cpp. A recursive list is displayed of each included file. Hopefully an unnecessary header file can be identified to enable this tree to be pruned.
Alternatively set the compile option:
http://msdn.microsoft.com/en-us/library/hdkef6tk(v=vs.80).aspx
So why is it being included?
It can take a lot of guesswork to track down the reason in a large project, but here's a quick method of showing the whole header tree for a cpp.
Add "/ShowIncludes" to the command line options for that cpp. A recursive list is displayed of each included file. Hopefully an unnecessary header file can be identified to enable this tree to be pruned.
Alternatively set the compile option:
http://msdn.microsoft.com/en-us/library/hdkef6tk(v=vs.80).aspx
Wednesday, 6 March 2013
Vijay World: P4EXP Windows Explorer Integration - Problem Solve...
Vijay World: P4EXP Windows Explorer Integration - Problem Solve...: There were lots of issues and i was struggling to use p4exp which come in bundle with p4v setup. i Couldn't configure it properly for a...
I forget this one every time when installing perforce explorer integration. Duh.
I forget this one every time when installing perforce explorer integration. Duh.
Subst drives only visible to some applications?
Well this had me stumped for a while. I have a Z drive mapped to a folder on C using VisualSubst.
Yet some applications would deny that the Z drive existed. Very odd.
Finally it dawned on me - the applications which could not see Z were running as administrator.
The solution? Run VisualSubst again, this time as administrator and the drive mapping will not be listed.. add it here and voilá. All applications can now see your mapped drive letter.
--
For a better solution, see http://en.wikipedia.org/wiki/SUBST#Method_3
Yet some applications would deny that the Z drive existed. Very odd.
Finally it dawned on me - the applications which could not see Z were running as administrator.
The solution? Run VisualSubst again, this time as administrator and the drive mapping will not be listed.. add it here and voilá. All applications can now see your mapped drive letter.
--
For a better solution, see http://en.wikipedia.org/wiki/SUBST#Method_3
Subscribe to:
Posts (Atom)