Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've recently experienced the following issue :

I have a VS C++ MFC based solution, let's name it Solution0. It contains two projects ( Project0, Project1 ). I need to create a new solution out of it, initially having everything the same as the original one except names. So I rename Solution0 to Solution1 and Project0 to Project01, Project1 to Project11 - using Visual Studio's GUI and its Rename functionality.

Then I have the following code snippet :

C#
struct Pos3d
{
  Pos3d() { x = y = z = 0; }
  DFloat     x, y, z;
};

Pos3d ** pos = new Pos3d*[ 361434 ];

  INT_PTR i;
  for( i = 0; i < 361434; i++ )
    pos[ i ] = new Pos3d();

  for( i = 0; i < 361434; i++ )
    ::delete pos[ i ];

delete pos;


In the original Solution0 the code executes in an instant. In the renamed one it takes something like 10 seconds to perform the deletes.

Any idea what could be a reason of such funny behavior ?
Posted

Their is no reason for that. You should also rename the pathes such as temp and bin directory and than run an "Rebuild all" and than all should be fine.
 
Share this answer
 
Comments
Member 10800620 22-Apr-15 1:31am    
Are you sure ? I've been renaming files/paths all around and rebuilding too, but the problem stayed.

Anyway, maybe I was not clear enough - the point of my question wasn't how to clone the solution, the last resort would be ( and probably will be ) that I build the new one from the scratch, although I wanted to avoid that because there are hundreds ( maybe over one thousand ) files involved and a lot of specific settings, too. It seemed to me that it would be easier to copy the whole solution directory and then just rename things and edit solution/project files manually.

My point actually was that I perform a few perfectly valid operations upon the solution/projects in VisualStudio 2012 and things just go wild, so I am interested if anybody else experienced such issue and if so, if they know what's causing it.
OK, the thing is this : the name of the exe is important. Of course it has been changed when I had changed the project name.

And the link to the exe name is the registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\your_exe_file_name.exe

If the key exists ( even empty ), the deletes in the VisualStudio debugger are fast. If it does not, deletes are slow.

I don't know why it is so, there does not seem to be any decent documentation about it anywhere but that's how it is.
 
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