|
Hi,
I need to read up on unicode, typically UTF-8
could someone please suggest some links or articles ?
thanx in advance
Noman
|
|
|
|
|
I'm adding controls to a dialog, and then I cannot add any more, is there a finite number of controls that I can add to a dialog?? How do I increase this number....??
TIA
Senior Test Engineer
GLI Australia
www.gli.com.au
|
|
|
|
|
IIRC you can only have 255 (or 256?) controls in a dialog resource. If you need more, you must create the controls at runtime.
--Mike--
http://home.inreach.com/mdunn/
A recent survey reports that 1/4 of all internet users in England surf for porn.
The other 3/4 just didn't want to admit it.
|
|
|
|
|
Is it possible to register multiple file extensions with an SDI application?
I tried doing the following, but this strange box pops up (new document) but if I pick any choice but the first, an error occurs. Should I create a different document class to handle each file extension type? Or is there an easier way?
AddDocTemplate(new CSingleDocTemplate(IDR_FILETYPE1,
RUNTIME_CLASS(CTest2Doc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CTest2View)));
AddDocTemplate(new CSingleDocTemplate(IDR_FILETYPE2,
RUNTIME_CLASS(CTest2Doc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CTest2View)));
IDR_FILETYPE1 is "sdi app\n\n1\nfiles (*.txt)\n.txt\npart 6-1\npart 7-1"
IDR_FILETYPE2 is "sdi app\n\n1\nfiles2 (*.doc)\n.wsf\npart 6-2\npart 7-2"
--
Peace,
Amit Jain
|
|
|
|
|
Check the Microsoft Knowledge Base ( Q198538 ).
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Got it, thanks =)
--
Peace,
Amit Jain
|
|
|
|
|
How can I change the font of a CStatic control?
Thanks,
Joseph LeBlanc
unixd0od@hotmail.com
|
|
|
|
|
Hi...
Use the CStatic::GetDC() function to get the device context of the static control.
Then u can use the CDC's font manipulation functions to play with fonts.
Happy coding,
Regards,
Rejeesh
|
|
|
|
|
You can use CWnd::SetFont(), and I always use CFont::CreatePointFont() for convenience.
Cheers,
Bob.
|
|
|
|
|
Hi,
I am adding an automatically resizable dialogbar into my MFC program. But it can not automatically resize when the window size is changed. Can you tell me the reason and how to implement this? Thanks in advance.
Kidd
|
|
|
|
|
If I throw and catch an exception in VC++ I see something like this in the debug window:
First-chance exception in DF.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
Is there anyway to prevent this message from being displayed?
|
|
|
|
|
If I throw and catch an exception in VC++ I see something like this in the debug window:
First-chance exception in DF.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
Is there anyway to prevent this message from being displayed?
|
|
|
|
|
There might be a pragma, but what's the problem ?
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
I would like to get an answer as well. When a server program pops up one of those messages phones start ringing. If it is a regular program, all I usually have to do is clear the error message. If it is a service though, there is no visible message to clear and the only resort is to re-start the computer
|
|
|
|
|
Why would your server program run your code via Visual C++ in debug mode ? Unless I read you wrong, you're saying you get a trace message, right ?
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
I lead a team of developers of different skill levels. The assertions are the only way to let someone know where the problem is. We get all sorts of crap data sent from the users, which manages to set up "impossible" situations that were not trapped in the code. The asserts capture the condition, I just wish I could get them to write to a file and hopefully let the programs continue on their way
|
|
|
|
|
So, if you must, write your own replacement for assert. It's just a macro. Personally I'd never use assert in the way it sounds like you're using it.
Assert is supposed to be disabled as soon as you move out of a debug environment. It's for checking that your program is doing what you thought it was, not for checking your users are doing what they ought to do. That's input validation which, in a serious production application, is usually a significant proportion of the program code.
An assert failure ought to ring alarm bells.
However AFAIK an assert failure just raises an exception. You can probably catch it and do what you like with it.
|
|
|
|
|
I've written an application that plays AVI files, and has no problem opening them, with one exception:
I took some open-able AVI files and burned them onto a CD. Then, when I tried to open them directly from the CD or after copying them from the CD to the hard drive, AVIFileOpen returns the error AVIERR_FILEOPEN. The process of burning the files onto the CD did something to cause this, however the files still play fine in Windows Media Player. This is a big problem, and I haven't been able to find out anything about what causes the FILEOPEN error. If any of you have any ideas, I would greatly appreciate them
thanks,
Jake
|
|
|
|
|
Here's a good one... I want to get the number of decimal digits from a float Any suggestion would be greatly appreciated!!
Thanks
Stephane Denis
big_dog45@hotmail.com
|
|
|
|
|
Check out _fcvt (Converts a floating-point number to a string), take the resulting string's length and subtract the decimal-point position.
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
if you want the digits to the LEFT of the decimal point, use this:
char cString[128];
float myValue = 123.456;
sprintf(cString, "%.0lf", myValue);
int digits = strlen(cString);
If you want the numbers to the RIGHT of the decimal point, it's pretty much up to you how many there are, but I would try it this way:
char cString[128];
float myValue = 123.456;
sprintf(cString, "%lf", myValue - floor(myValue));
int digits = strlen(cString) - 2;
Now, which one were you after?
|
|
|
|
|
Would you know what's wrong with this code?
CArray<cbutton, cbutton&=""> m_COMOnlyButtonArray;
/ctrlRect 's height is 32
BOOL bOK = m_COMOnlyButtonArray[nDex].Create("ab",WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, ctrlRect, this, pCtrl->m_GuiCtrlId);
m_COMOnlyButtonArray[nDex].SetFont(&m_font);
//The button is created but I don't see the text on the button????
|
|
|
|
|
What happens if you comment this line? ->
m_COMOnlyButtonArray[nDex].SetFont(&m_font);
Do you need to set your custom font?
|
|
|
|
|
|
How can I hide the toolbar in some dialogs and display it in others?
Thanks!
Richard
|
|
|
|