|
I have used Visual C++ for many years without trouble.
But in the last few days, an automatic upgrade came: it shows a MessageBox that says "One-way upgrade. Visual Studio will automatically make functional changes to the following projects in order to open them. ...".
With one of my projects (called 'dragclip_vc'), today, however often I open it and look in it and close it, the new upgrade system shows and needs attention, every time I open that project, and it does not preserve the display of opened files. Please how can I stop that from happening? (I know that the automatic upgrade needs doing once for each of my projects.)
(Another of my projects (called 'makeobj_vc') auto-upgraded correctly and did not ask again for upgrading, and it preserves the display of opened files.)
dragclip_vc is a very small project; all that it does is that if I drag a file into it from a directory display, it puts that file's full pathname in the Windows clipboard. It is useful.
makeobj_vc is a big project.
The '_vc' on the ends of their names means "for Visual C++"; it is to distinguish from old versions that I had written for Borland C.
modified 29-Jul-18 2:41am.
|
|
|
|
|
The affected project ('dragclip_vc') is still doing it this morning (5.37 a.m. by UK time), and wanting this upgrade every time that I open it.
The other mentioned project ('makeobj_vc') opened correctly this morning and did not ask for this upgrade again.
If needed, I have old backup copies of all my Visual C++ projects on an offload-disk.
modified 29-Jul-18 0:47am.
|
|
|
|
|
This is not that unusual. The upgrade system in Visual Studio can have problems for a variety of reasons. Your best bet is just to create a new project, and then copy the source files into the new project location and add them manually to the project.
|
|
|
|
|
Anthony Appleyard wrote: But in the last few days, an automatic upgrade came: it shows a MessageBox that says "One-way upgrade. Visual Studio will automatically make functional changes to the following projects in order to open them
What VS version are you using?
In what version is it about to upgrade?
|
|
|
|
|
Victor Nijegorodov wrote: What VS version are you using?
In what version is it about to upgrade?
When I run my project makeobj_vc , the initial black panel shows "Visual Studio / Community 2015".
When I opened its help just now, a top panel said "We recommend using Visual Studio 2017 / Download now"; but will that cause a quick replacement of my VS 2015 by VS 2017, or will there be a long complicated process?
|
|
|
|
|
Please be patient when posting messages. New messages often go into the moderation queue and need to be verified by a human. And it is Sunday, so lots of people are taking things easy.
|
|
|
|
|
When I run my project makeobj_vc , the initial black panel shows "Visual Studio / Community 2015".
When I opened its help just now, a top panel said "We recommend using Visual Studio 2017 / Download now"; but will that cause a quick replacement of my VS 2015 by VS 2017, or will there be a long complicated process?
|
|
|
|
|
Fix your existing problems first. Once you have all your projects successfully building in VS2015 then you can consider upgrading to 2017.
|
|
|
|
|
Thanks for your help. I am sorry if I have caused any problems.
I tried uploading VS 2017; it installed itself alongside my VS 2015 and did not obliterate it.
I used my desktop "Visual C 2015 devenv.exe" icon to access my VS 2015, and I tried to access several of my projects. All but one of them that I tried came up and recompiled successfully, and there was no "One-way upgrade. Visual Studio ..." nuisance.
The only project that caused trouble was dragclip_vc, which kept on showing the "One-way upgrade. Visual Studio will automatically make functional changes to the following projects in order to open them. ...". MessageBox. So I remade this project as a new VS 2015 project dragclip2 using copies of dragclip_vc's source files, and this new project behaves OK. I suspect that the "One-way upgrade. Visual Studio ..." nuisance persisted because dragclip is such a small project that it does not have some feature that "One-way upgrade. Visual Studio ..." looks for to see if it has already been called on that project.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Next step for me, I suppose, is to find how to run VS 2017. It looks very different from VS 2015.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I keep pointers to all my Visual C++ projects in a folder called C:\Visual_C\Visual_C_pointers\
modified 29-Jul-18 12:25pm.
|
|
|
|
|
No problem, just pointing out how the system works. And, for some odd reason, most of your messages were going to moderation as potential spam.
|
|
|
|
|
Thanks. Do you want me to send to you a copy of the old form of my 'dragclip' program?, so that you can investigate why "One-way upgrade. Visual Studio ..." repeatedly asked to upgrade it?
|
|
|
|
|
No thanks. You should report it to Microsoft though.
|
|
|
|
|
I am using VS 2015. When I opened its help just now, a top panel recommended using VS 2017; will that cause a quick replacement of my VS 2015 by VS 2017, or will there be a long complicated process?
|
|
|
|
|
I have VS 2015. Its help recommends upgrading to VS 2017.
|
|
|
|
|
I have now upgraded to VS 2017. I have used it to remake my project 'dragclip_vc'. In it, the top menu has entries for "File, Edit, View, Project, Team, Tools, Windows, Help", but none of then seem to lead to an option letting me compile or run the source file. What should I do?
|
|
|
|
|
I have been using Visual C++ for many years to develop programs, without trouble.
Today, a new automatic upgrade system shows up whenever I call one of my Visual C++ projects.
In one of them, the automatic upgrade showed and operated, asking me to click on things, OK, and I had to re-open the component files that it displays, and I saved the run, and exited, and after that, it comes up OK when called.
In another of them, however often I open it and exit from it, every time I open it, the automatic upgrade shows, and I must run it, and it wipes the display of the program's files that I had opened. What causes that?
|
|
|
|
|
[See below the original question for the solution.]
I have been struggling with this for a while now, and I can't seem to figure it out.
Here's my declaration:
std::unique_ptr<BYTE*, std::function<void(BYTE**)>> _VersionData{};
And here's where I attempt to instantiate it:
_VersionData = std::make_unique<BYTE*>(new BYTE[_VersionDataLength], [](BYTE** ptr) {delete *ptr; });
The errors I receive are:
error C2440: 'initializing': cannot convert from 'initializer list' to 'unsigned char *'
note: The initializer contains too many elements
I'm probably way off in my interpretation of the documentation. Can someone show me how this is supposed to work?
[SOLUTION]
Turns out I was really way off with the attempt shown above.
Here's the working code.
The declaration in the class header file:
std::unique_ptr<BYTE, void(*)(BYTE*)> _VersionData;
The instantiation in the source file:
auto CustomDeleter = [](BYTE* ptr) {delete[] ptr; };
_VersionData = std::unique_ptr<BYTE, decltype(CustomDeleter)>(new BYTE[_VersionDataLength], CustomDeleter);
And the most important part, the constructor initializer list:
CFileVersionInfo::CFileVersionInfo()
: _VersionData(nullptr, [](BYTE* ptr) {delete[] ptr; })
{
}
The difficult we do right away...
...the impossible takes slightly longer.
modified 28-Jul-18 11:42am.
|
|
|
|
|
Now that you understand it, how about writing an article for the rest of us?
|
|
|
|
|
Thanks for the vote of confidence, Richard!
I can't say that I completely understand it. Getting it to work was partly just trying different things until I hit upon the magic combination!
I do understand some parts of it better now, but hardly well enough to write an article.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Where I can learn about using wsprintf? I using Visual Studio 12 with plain C Code Lines.
For examples, this lines give me 2 different results depending on the
formatting I believe but I can't find any practical info about it.
For example what the " >>6" or " >>12" do?
Thanks, check the code below and you see what I mean
DWORD DVALE=19542016;
wsprintf(BUFF, "Version is %d \n Good Night",DVALE >>6 & 0xff);
MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 192
wsprintf(BUFF, "Version is %d \n Good Night",DVALE >> 12 & 0xff);
MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 163
|
|
|
|
|
|
|
Auch, you think I can remember those days?
That's a lot of math, if I start experimenting I may get it back.
But for now, that page got me hungry!!!
But I did catch the idea of shifting, all this because
a code that I posted here, that some one tested and said works correctly
and got the right values, however I don't, I do not see how may code
works correctly on his computer, but on mine I get big numbers, far for what
I am looking for. Go ahead and check it, and tell me what you think if you please....
Thanks
Look for "No-Errors-but-wrong-values-on-return"
|
|
|
|
|
Sorry, I can't diagnose what happens on your computer.
(And whatever you are doing elsewhere is pointless and bad practice. Errors in your code have been identified. Just check the windows version and end it there.
To clarify: DON'T check the versions of system DLLs. There are multiple versions of many DLLs and you have no idea which DLL is actually being used.)
modified 26-Jul-18 23:55pm.
|
|
|
|
|
But you can tell the studio whichone too look for or use, I think.
|
|
|
|