|
Hello.
I am setting up a C console application under VS.net. I have various printf statements. If some type of error condition occurs I would like to change the color of the text to RED that the printf statement prints to the console.
I dont know how to change the colors for this situation.
Can someone help me with this?
Jerry
|
|
|
|
|
printf() knows nothing of color. Check out SetConsoleTextAttribute() and WriteConsole() instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Ok thanks, I got it all working.
Jerry
|
|
|
|
|
Hi every body,
Do you know if I want to keep both Express Edition 2005 and VC++6
then mybe the best way would be:
--name VC++6.0 cpp files with notepad
-- and then, ? does the VC++ Express Edition 2005 gives a different extension for cpp files?
==> then both plateforms can be used separately with no problems?
Thanks for any feedback!
Regards
|
|
|
|
|
The project files are different: VC6 uses dsw and dsp files and VC Express uses vcproj files (I think). So, you can use two different projects with the same source files.
|
|
|
|
|
well in fact no,
I tried yesterday but all the cpp files from VC6 projects where automatically renamed with Expres Edition logo and no way to recover my projects in VC++ 6....Until I unintalled Express edition 2005.
But..... if you mangage *.cpp files, how to keep them? in notepad? wordpad?
or just used developper VC++6.0?
Same question with Express Edition 2005?
thanks a lot.
|
|
|
|
|
.cpp and .h files are just plain text files (only the extension changes). So, you can still use them in VC6 even you install VC Express. What can happen is that you change things in the file and these changes are not supported by the VC6 compiler.
thierrypp wrote: no way to recover my projects in VC++ 6
Don't convert your project. Instead create a new project and add the files manually. This way you will keep your VC6 project intact and you can still work on it.
|
|
|
|
|
tss, you are confusing between extension and explorer registered program to use this type of file. simply right click on the workspace file, ,select "open with..." and choose "developer studio" (visual studio 6).
to change the icons, open an explorer, select Tools > Folder Options... > File types tab...
there, reach the type you waznt to modify and click "Advanced" button.
|
|
|
|
|
yes, so you suggest that:
1) Vc ++ 6.0 I change properties for txt files ?
2) and for VC express edition 2005, I leave as it comes?
However, *.h files remain unchanged in the original format of creation,
Thanks a lot for your kindness,
regards
|
|
|
|
|
Hello !
I need to find a library that implement the "probability error function" of a gaussian distribution. Basically, I need to retrieve the probability for a certain value of X (integration under the curve until a certain X value).
Does anybody knows where I can find that ?
Thanks
|
|
|
|
|
I recently read about QuantLib. It has some statistics library functions. I have not tried it yet, so I can't say for sure if it has what you need.
QuantLib[^]
|
|
|
|
|
If you have access to Matlab type edit erf , or edit erfcore
and you will get the right code to implement the needed function(s) by yourself.
It looks quite easy.
Hope this helps
Have a nice code day
|
|
|
|
|
|
Hello,
I'm working with boost::wave and I need to set all macro definitions for the project (like _WIN32, _DEBUG etc )
How can I get ALL macros defined for project?
|
|
|
|
|
I hav a dataset object which i would like to link to an access file upon verification of input from user. Can someone Please help me on this. TKS in advance...
|
|
|
|
|
how to open the exe after a particular time?
JAYARAJ
|
|
|
|
|
set a timer and in that timer use function
ShellExecute
or
CreateProcess
nave
|
|
|
|
|
There are a few ways to do that.
1- Keep the main window hidden until the time to show. Using the Timer.
2- Keep another small application running (hidden) to run the main program. (using timer, or thread, etc).
3- Install a service that runs a thread, which checks the system time after certain Sleep() intervals. (Could create problems, while reading the registry etc).
4- Use some form of the task scheduler.
5- Some other way.
this is this.
|
|
|
|
|
Khan++ wrote
"5- Some other way"
Like that, I would use this method
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
Phil.Benson wrote: Like that, I would use this method
Which Method
|
|
|
|
|
hai friends,
i have got a problem with multi-line editbox control.i want to display some of the lines in a multiline editbox with a different color.so how to change the color of the text in an editbox?
sathish
|
|
|
|
|
this might be possible if u r using richedit contol. In that case u can change the color using the functions
SetDefaultCharFormat and SetSelectionCharFormat
nave
|
|
|
|
|
I can compile my C++ MMC app non-unicode with no errors.
If I make it unicode I get one linker error:
uafxcwd.lib(afxinl2.obj) : error LNK2005: "public: __thiscall
AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)"
(??1AFX_MAINTAIN_STATE2@@QAE@XZ) already defined in mmc.lib(apimfc.obj)
The release version links correctly, but not the debug version.
Any ideas?
simwall
|
|
|
|
|
Hi
Is Gdiplus Image considers each image as color image when creating or taking from another Bitmap. If not why it is increasing the size of the image? Please help me.
Thanks
|
|
|
|
|
I have a client application that works fine provided that the user hits the connect/disconnect button. If the connection gets severed, my application will detect this and notify the user and allow them to reconnect by hitting the connect/disconnect button.
I have a requirement to have my application reconnect automatically, which will be used on an un-manned test later on.
I have one class that inherits from CAsyncSocket and a class for the dialog that contains the GUI/data that needs to be sent to the server. I have been trying to use this code:
int error = pSocket->Send( (char*)&CServerMsg, sizeof( CServerMsg));
if(error == SOCKET_ERROR )
{
m_pMainApp = ::AfxGetApp();
CMainDlg* dlg;
dlg = (CMainDlg *) m_pMainApp->GetMainWnd();
dlg->m_ConnectButton.SetCheck(TRUE);
dlg->OnConnectButton();
}
but I keep getting an error that causes my app to die. I stepped through and it dies on the socket Create() method in my OnConnectButton, which is the same method I call when the user hits the connect button. It then throws me to the method
void* CMapPtrToPtr::GetValueAt(void* key) const
When I do a GetLastError(), I get the error code 10038 which says I am performing a socket operation on a non-socket.
The strange thing is that the send works perfectly fine if the server doesn't go down and I am connected to the server the entire time.
Please help, this has been driving me crazy for 3 days! Thanks!
|
|
|
|