|
|
I already answered that in reply to CEditCtrl in FrameWnd:
Frame windows do not contain user controls. Those should be part of views which in turn are hosted by frame windows.
|
|
|
|
|
You could use CEdit::Create method.
However, as already mentioned, there is rarely or maybe not at all a good idea to create control in the frame window.
|
|
|
|
|
Is there possible to run CFile::Open in order to write a text file, inside C:\Program Files\ location, with administrator rights, even the application who call this are not started with administrator rights ?
|
|
|
|
|
There is no way. A running process can not get higher privileges.
All you can do is starting another process using ShellExecuteEx with the "runas" verb which usually shows the UAC prompt.
Another option is running your application with sufficient priviliges and drop those when no longer needed. See permissions - Dropping privileges in C++ on Windows - Stack Overflow[^].
See also the CP article Riding the Vista UAC elevator, up and down[^].
But I suggest to rethink your request. An application should not modify data in the Program Files directory tree. That should be only modified by installation and update processes. Windows provides common directories for application specific data (shared and per user).
|
|
|
|
|
Ok, understood. Thank you.
|
|
|
|
|
|
|
#define FUNC_1(x) (x+1)
#define FUNC_2(x) (x+2)
#define FUNC_3(x) (x+3)
#define FUNC_4(x) (x+4)
#define FUNC_N(n, x) (FUNC_##n(x))
----------------------------------------
int result1 = FUNC_N(1, 100);//OK
but i want to below:
int a = 1;
int result2 = FUNC_N(a, 100);//NG
please help ~
|
|
|
|
|
Please don't cross-post. See my answer in Algorithms.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
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?
|
|
|
|