|
Trollslayer wrote:
Stroustrup is great if you want to get esoteric, but for 'everyday' C++ it is over the top !
Oops? What makes Stroustrup book 'esoteric'?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Figures his work would be accurate since he created the language.
|
|
|
|
|
Hmmm - I bought the C++ standard for $18 on the ANSI website - which isn't too expensive...
I wouldn't, however, say it's the best reference to have. It's got all the goodies in it (must have if it defines the language ), but digging out exactly what you want is tricky. Personally, I struggle on with Stroustup edition 3, Josuttis (The C++ Standard Library: A Tutorial and Reference) for Standard Library stuff and a smattering of Sutter (Exceptional C++ & More Exceptional C++) and Meyers(mainly Effective STL).
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Hi,
I'm trying to get my application to run but it keeps on getting run-time assertion failures. I've worked out that the offending code is in DoDataExchange where I check variables (doubles) retrieved from dialog edit boxes and change them to CStrings and format them depending on their size.
The assertions which fail in the MFC source are:
ASSERT (PWnd==NULL||pWnd->m_hWnd==hWnd);
in wincore.cpp and:
ASSERT (PLinkTop!=NULL);
in except.cpp.
Unfortunately, I have no idea what these lines mean. Any ideas what the problem is?
Thanks in advance,
Graham
|
|
|
|
|
Something is very wrong with your app. Are you calling UpdateData before DoModal?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Don't think so. I have a main dialog box/class which creates the other (sub)dialog boxes and calls DoModal on them depending on the user's selection from a Combo Box.
By commenting out certain parts of my code I've established that the problem definitely lies in the DoDataExchange method. I'm just not sure where.
|
|
|
|
|
When you'll get the assert, just check the call stack. You'll be able to pinpoint the error.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
It is most probably because you use DDX for a control that does not exist anymore. For example, if you used Class Wizard to create variables for your controls on a dialog, and then changed the ID of the control (or deleted the control but not the variable for the control); you will surely get this kind of assertion failures.
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
No, none of my controls are deleted or the IDs changed. I do however use the variable (double) for the edit box to Format 2 different CStrings in my code. So the first Format is
CString grstr;
grstr.Format(_T("%.20f"), m_nGrams);
in order to be able to deal with very small numbers. I then manipulate the CString in order to determine how many decimal places are required and then use:
CString grtemp;
grtemp.Format(_T("%%.%df"), signif); // signif is number of decimal places
grtemp.Format(grtemp, m_nGrams);
Would using the m_nGrams variable twice to format these two different CStrings cause my problem?
Thanks,
Graham
|
|
|
|
|
I have discovered the problem in my code. It was in the lines:
CString grtemp;
grtemp.Format(_T("%%.%df"), signif); // signif is number of decimal places
grtemp.Format(grtemp, m_nGrams);
For some reason, although the application ran fine on the desktop emulator, it threw assertion failures when run on the mobile device (Jornada 720 running HPC 2000).
This may be because the emulator was for H/PC Pro 2.11 ( as there is no emulator for HPC 2000 in the eMbedded Visual C++ IDE).
Anyway I changed the above lines to:
CString grtemp;
grtemp.Format(_T("%.*f"),signif, m_nGrams);
and it now runs perfectly.
Thanks for your help,
Graham
|
|
|
|
|
gm_coll wrote:
Thanks for your help,
No problem, though you find it on your own
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
I have a call that is to popup a dialog window but that dialog window doesn't popup until after another one that is popped up is cancelled. The extra or other dialog is one that I use in a setfocus operation in the new dialog. I have tried setting the focus to another control using the following in initdialog:
CEdit* pNextField = (CEdit*)GetDlgItem(IDC_MF_DEADSPACE);
pNextField->SetFocus();
But this other window always comes up.
What am I doing wrong? How can I just have the dialog popup without it doing anything else?
Thanks!!!!!!!!
|
|
|
|
|
Are you returning FALSE from OnInitDialog?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
I was returning TRUE changed it to false and now it seems to work. WHY!?
|
|
|
|
|
Check the WM_INITDIALOG docs - or - read MFC comments
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
hi
i'm desperately searching for code to concatenate wave files, something like A.wav + B.wav = C.wav
anybody??
|
|
|
|
|
I have no experience working with sound data type. My first thought is to load the two sound files into memory and then concatenate them. If they are big files, you can use other works memory technique such as memory mapping to concatenate the files.
Kuphryn
|
|
|
|
|
Have a look at mmioXXX functions - they support RIFF files and .wav format is implemented as RIFF.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
MS DirectX SDK.
And I swallow a small raisin.
|
|
|
|
|
thanks, i really appreciate the trouble, but could you just be a bit more specific?
|
|
|
|
|
I am creating my ActiveX control, this control has a child window of base CEdit, whenever I try to change to a font with size larger than the window created, the window size is changed. What can I do to make the window (edit) size fixed in spite of the font’s size?
I am using the following to create the edit window and to set the font text:
DWORD dwEditStyle = WS_CHILD|WS_VISIBLE|ES_AUTOHSCROLL;
DWORD dwExEditStyle = 0;
m_pEdit = new CEdit;
VERIFY(m_pEdit->CreateEx(dwExEditStyle, "Edit", "", dwEditStyle, crcRect, this, ID_ EDIT));
m_pEdit->SetFont(CFont::FromHandle(hNewFont));
m_pEdit->SetWindowText(“Hello”);
|
|
|
|
|
I'm not sure if you can, because all MFC dialogs are measured in units relating to the font size (so that the controls in your dialog will always fit no matter what the user sets their font size to).
I you need to keep changing the font size, then do a resize of the CWnd afterwards to scale it back to the size it was originally
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Seems that you are right, I didn’t find any way not to change the size of the window, even it didn’t trigger WM_SIZE message
|
|
|
|
|
Does any one know how to display a status bar in a status window panel? I was able to get so far as to instantiate a CProgressCtrl object. Now I need to show it on the panel. Thx,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Check KB article Q142202.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|