|
Hello,
I am doing a school project and I need to create a MFC application.
One of the buttons my application has is to restart the computer in Safe Mode with Netwokring.
I also need the computer to start normally after any kind of restart, without the user having to do anything special for this.
I already searched for solutions, but I have not found anything. Is this possible and if so, can anyone help me with the code?
Cheers!
|
|
|
|
|
I found this article How To Enter Safe Mode Using the System Configuration Utility[^] which tells you how to boot into Safe Mode with networking.
You could do this yourself by editing the boot.ini file and adding /safeboot:network and then restart the machine. You would off course needs the rights to edit the boot.ini file.
Have a try and see if you can get this to work.
0100000101101110011001000111001011101001
|
|
|
|
|
Thank you for taking the time to look into this. The method you suggest has no reason not to work.
The problem is that if I edit the boot.ini, it remains edited and keeps the user from starting their computer normally (i think).
Of course I can add the reverse button in my application, but it requires more action from the user.
I need Windows to start normally after it first restarts in Safe Mode with Networking.
I think a solution is to tell my app to start with Windows, only once, so I can revert that command automatically once it starts.
Now only if I can find out how to do that
|
|
|
|
|
There are several registry keys (http://support.microsoft.com/kb/314866[^]) where you can place your program to start after a reboot.
The article mentions that you can use the Run Once key to even start a program in Safe Mode by adding * in front.
0100000101101110011001000111001011101001
|
|
|
|
|
Thank you! I will try to do what you suggested and come back with the result
Cheers!
|
|
|
|
|
Just out of curiosity, what does MFC have to do with the underlying problem of restarting Windows (in a particular mode)?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I am trying to learn C++ and particularly MFC. This is what the project is about more than anything.
This is why my question is not specifically how to start windows in SMwN, but if there is a way to do this in C++/MFC via a button, so that it does what I want it to do.
I am a total newbie but with a big appetite for learning.
|
|
|
|
|
Fair enough.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hello,
I'm using Windows SDK for building an applications without Visual Studio
I've tried to build boost lib using "bootstrap.bat" from installation folder but got an error:
"program can't start because mspdb100.dll is missing..."
I see that dll is from VS installation.
do you how I can build boost without VS but using WinSDK free commandline compiler tools only?
|
|
|
|
|
As a note there is a boost forum at the boost site.
But possible solutions
1. You do have the library. So find it and then set the lib path.
2. You do not have the library but there is a MS source for it. Find it, download it, set the lib path.
3. It only exists in Visual Studio.
a. So buy Visual Studio
b. Find the code that uses that library, and use a macro to remove it. Remove the lib dependency.
|
|
|
|
|
Additionally to jschell's 3a point: you can try with Visual Studio Express[^], it is free but has limitations (like no MFC).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
|
Hi,
Has anyone written or seen any code to produce a surface plot or isometric (xyz) bar graph, preferably for 10000+ points, in a view? I've got a few ideas, but if the work's already been done, clearly it'd save a lot of pain, and I'm lacking ideas at the moment on the best way to make the plotting of 10000+ points efficient, given that only a fraction of them will effectively turn into pixels on the screen.
Any help would be hugely appreciated.
Thanks,
Phil.
He is no fool, who gives what he cannot keep, to gain that which he cannot lose.
|
|
|
|
|
Gday,
I've seen a openGL tute that makes a mesh then sticks a texture-map on it before displacing the flag with a sine wave along it's length.
It seems to be about the same thing, just that rather than using the sin function combined with a points distance from the flag origin to calculate the displacement, you apply your data-set to the dispalacement of each point.
You could just use Gouraud shading to interpolate the colour (instead of texture mapping, that is) between each point in the mesh, setting the colour of each vertex in the mesh based on it's height.
It's the first tute on the page here: http://nehe.gamedev.net/tutorial/lessons_11__15/28001/[^]
|
|
|
|
|
Brilliant! I've not really known about OpenGL, but the flood gates of 3D graphing are now open!! Lessons 34 and 47 also do similar things, so thanks very much for this introduction.
|
|
|
|
|
Hope you enjoy the series as much as so many of the rest of us already have.
One day you're playing with a triangle, the next with particles the day after you're trying to remember what you were supposed to be doing away from the computer.
|
|
|
|
|
sounds like fun
i'd do it by setting a minimum width for the bars, so it would typically show view_width / bar_min_width bars.
each bar shown will then represent a window of total_points / displayed_bars data points.
the height of each bar could be an average of the points in the window it represents, or the min, or the max. or, for sheer performance, just use the first sample from each window.
and if your input data is floating point, to speed the bar height calculations, you could generate an integer array that pre-scales the data points values into the 0..max_bar_height range.
|
|
|
|
|
Thanks Chris, very useful thoughts.
|
|
|
|
|
why the function strstr used in C ?
|
|
|
|
|
If you spend some time with the documentation[^] you will learn many useful features.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
why? Simply to search for a string in another string.
Watched code never compiles.
|
|
|
|
|
strstr() finds a substring in a string. use it to search inside string elements.
#include <stdio.h>
#include <string.h>
main()
{
char mainString[]="string to search";
char strstr_sub_string_to_search[]="to";
if ( strstr(mainString, strstr_sub_string_to_search)) puts("strstr() found Substring in main string\n");
else puts("strstr() did not find Substring in main string\n");
return 0;
}
|
|
|
|
|
|
I want to get the range of a line cursor in.
VBA code (word2010) looks like this:
================================================
ActiveDocument.Bookmarks.Item("\LINE").Range
C++ code looks like this:
================================================
CBookmarks oBookMarks = oDoc.get_Bookmarks();
VARIANT varName;
varName.vt = VT_BYREF|VT_I1;
char buff[6] = {"\\LINE"};
varName.pcVal = buff;
CBookmark0 oBookMark = oBookMarks.Item(&varName);
VBA code works perfectly but C++ code triggers some exception(required members does not exist).
Anyone knows why? I really appriciate for your help.
|
|
|
|
|
You are passing a string using the VARIANT pcVal member. Strings are usually passed using the bstrVal member with type VT_BSTR . When using MFC, you may use the COleVariant type which creates a VT_BSTR when passing a string:
CBookmark0 oBookMark = oBookMarks.Item(COleVariant(_T("\\LINE")));
Another error may be the name of the used function oBookmarks.Item() . Please check if this functions exists. If you have imported a typelib, see the generated header file. With C++ OLE automation, many item access function are named GetItem() and SetItem() .
|
|
|
|