|
I would like to add that some times ASSERT is applied in MFC when it would cause no problems, since the SDK method/function being called just returns with fialure/success value. Therefore, you should detemine if it realy is an error (are you checking return value).
Example:
Many methods/functions that take an HDC as an argument and will accept a NULL HDC (use screen DC instead).
For the most part MFC takes the above situation into account, but occationaly they did let a few through. In which case, the assert becomes an information only assert.
INTP
|
|
|
|
|
Hi!
I am currently trying to display small images in a dialog using a CStatic. I've created a static control in the dialog using the resource editor and set its style to SS_BITMAP. Then I created a variable for the static, m_stcImagePreview (type CStatic).
Then I tried to set the image using this code:
IMAGEINFO ii;
VERIFY(m_pParentImageList->GetImageInfo(m_nIconId, &ii));
m_stcImagePreview.SetBitmap(ii.hbmImage); It doesn't throw an assertion error, but unfortunately it also doesn't work... The image isn't displayed, it shows random crap. The m_pParentImageList is a pointer to the image list containing some 16x16 images, it is assured that m_nIconId is never greater than the image count.
Any idea what I am doing wrong?
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
I have an application with a single document; I use the doc/view architecture to manage the main views ( 3d views ), and I have a couple of other "views" ( not CView ) that display some data from the document.
When loading a document, I need to fill the other views ...
I'm not sure exactly where to do this.
I handle the void MyApp::OnFileOpen() to fill in the CFileDialog with a custom filter and extensions list, and call CWinApp::OpenDocumentFile (sPath);
void CBuild_itApp::OnFileOpen()
{
CWinApp::OpenDocumentFile (sPath);
FillInOtherViews();
}
I could add calls to the end of that method to fill in the other views, but it does not look kosher. I can also trigger a notification ( with observers that I already use elsewhere ) to make the other views handle themselves.
Any thoughts ?
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
I am doing a project on face facial detection and expression analysis
Presently, i have got the coordinates of the faces facial of both the eyes and the mouth
With these pts as output for a neutral expreeion, i can set control values group certain expression as happy or sad. e.g happy is seen by eyes smaller, smile wider.
how do i call these pts out again
|
|
|
|
|
Our application has RC Files for a couple of languages, and the framework loads the appropriate language according to OS version.
Though I would like to choose and change the language at run time.
Any clue?
-MyttO
|
|
|
|
|
Hello!
You may use:
1. LoadLibrary() along with AfxSetInstanceHandle() (for mfc app) on given resource dll (can be resource only but not must be)
2. You may try to use SetThreadLocale() and use only one resource dll with many resources, each defined for every language you may want to support. But SetThreadLocale is not supported under Windows9x
I propose to use 1st method.
|
|
|
|
|
I'm the second case, ie my dlls have resources defined in multiple languages.
I use SetThreadLocal() in InitInstance() with no error but resources are still loaded in OS Version language (working under Win2k)
Did i do something wrong?
-MyttO
|
|
|
|
|
Hello,
Can anyone help me how to load an extension dll explicitly or dynamically?
thanks..
sphynx
|
|
|
|
|
Either link with the import library (.lib) or use LoadLibrary()/GetProcAddress().
onwards and upwards...
|
|
|
|
|
Hello!
Use AfxLoadLibrary(). From MSDN:
"
Be sure to use AfxLoadLibrary and AfxFreeLibrary (instead of the Win32 functions LoadLibrary and FreeLibrary) if your application uses multiple threads and if it dynamically loads an extension DLL. Using AfxLoadLibrary and AfxFreeLibrary insures that the startup and shutdown code that executes when the extension DLL is loaded and unloaded does not corrupt the global MFC state.
"
and then use GetProcAddress() either by name, or by ordinal
|
|
|
|
|
I am working on a project in which we have to provide a UI to user in which all frames belonging to a selected mpeg2 video file are displayed. User then assign some attribute to each frame and then we have to store that video with those attributes added to each frame. Can any one give some idea about libraries or API's or controls which can help us.
|
|
|
|
|
Hello !
I'm facing a debugging problem: I have a class created dynamically (with new operator). When this object is deleted, an exception is thrown BUT, the destructor is called correctly and works fine, the error occurs after the last line of the destructor and before the next instruction in my program.
The error occurs at line 1062 in dbgheap.c (if that helps you).
So, my question is: how can I find the source of this error ?? The object is quite big and using memory window will be very a huge task...
Any idea ?
Thanks
|
|
|
|
|
hi guy,
the first thing that comes to my mind is that one :
isn't your class derived from one other?
if you forgot to specify the virtual keyword in such case, it must freeze...
TOXCCT
|
|
|
|
|
No, it isn't !
But I found the solution: I use the hard way. I comment almost all the code that has to deal with this class, then uncomment step by step and found at wich block of code the bug appear when the object is destroyed.
In fact I was writing something out of the bounds of a dynamically created array of my class and it doesn't fire an exception at this time neither when I destroy THIS array, but only when the object itself was destroyed.....
Uf, quite hard to find this one
|
|
|
|
|
Look in your CRT source code. C:\program files\Microsoft Visual Studio .NET 2003\vc7\crt\src for VC7.1, C:\program files\Microsoft Visual Studio\VC98\CRT\SRC for VC6.
Basically, it's telling you that one of your allocations went wrong. You may have freed the same block twice, or you may have overrun the allocation.
To help catch buffer overruns, you can enable page-level heap allocations in Windows. You can download the PageHeap tool as part of the Windows Application Verifier[^].
|
|
|
|
|
Thanks for reply but I found a solution (see previous post).
But thanks for the link !! I'll download this tool this will help me to catch further errors !
|
|
|
|
|
hi..
i have a problem here. I am making use of a tab control in a dialog box. Since I have 3 pages which all require edit boxes, i will need to have overlapping ones (in order to ensure that each tab page gets a edit box of its own).
However, i couldn't add edit boxes afer some time.
can anyone enlighten me? is there a restriction to the number of edit boxes that could be added?
is the way i do things correct? as in making edit boxes overlap each other so that they will be displayed correspondingly (in correct position) in the various tabs correctly. Hope You guys can help me out on this!!!
Thanks a lot!
|
|
|
|
|
Use the each tabl like an idependient Dialog.
For this you must to use CPropertySheet and CPropertyPage...
Best Reagrds
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
Sorrie right now what i'm not using CPropertySheet and CPropertyPage. Is it true that using tabs will always necessary need to use them?
So do i just need to modify my code or redo it entirely?Since my tabs are done in a overlapping fashion (do you get what i mean?) I hope I don't have to redo everything, cos it can be pretty tedious.
any hints on how to go about doing that???
Thanks for your help!
|
|
|
|
|
Yes, I know that is a very hard work....
If you want you can use the tabctrl with a lot of controls like editbox, labels, custom controls, in it, but is very dificult to use because you must to oredr the controls in the OnInitDialog. Other solution is to create the controls in OnInitDialog.
When you feel that you are going crazy, it's better to use Property Sheet and Property Pages, because you will have each control in its dialog....
Each Dialog that will be a tab must be derived from CPropertyPage and not from CDialog. Then When you need to principal dialog, with all the dialogs in it, you must to use the CPropertySheet class and use the funcion AddPage for add each dialog in the Property Sheet...
Regards
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
Yeah!! Thanks a lot for your help!!
i know that I have to make use of CPropertySheet etc but most of the books i referred to , dont give me any information on how to go about doing tabs at all...
Any good websites to recommend?
Hope i can manage to complete it on time.
Thank you very much!!!!!!!!!!!
|
|
|
|
|
I was looking here in CP, but each article about PropertySheet and PropertyPage are about special implementacion.
I pasted you a lines of code.....
Trie to start with it, and then read in MDSN....
Don't worry is very easy....
Rememeber: each dialog must be derived from CPropertyPage, not from CDialog
<br />
CPropertySheet dlgProperties("Properties", this);<br />
<br />
CMyPropertieDlg dlg1;
CMyPropertieDlg dlg2;
<br />
<br />
dlgProperties.AddPage(&dlg1);<br />
dlgProperties.AddPage(&dlg2);<br />
dlgProperties.m_psh.dwFlags |= PSH_NOAPPLYNOW;<br />
if(dlgProperties.m_psh.dwFlags & PSH_HASHELP) dlgProperties.m_psh.dwFlags ^= PSH_HASHELP;<br />
<br />
dlg1.m_strCubeName = m_strCubeName;<br />
dlg1.m_strCatalogName = strCatalogName;<br />
dlg1.m_strCreatedOn = strCreatedOn;<br />
dlg2.m_strLastUpdate = strDate;<br />
dlg2.m_strDescription = strDescription;<br />
if(dlgProperties.DoModal() != IDCANCEL)<br />
return;<br />
<br />
Regards
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
hello!!!!
I have finally understood what it means to use CPropertyPage and CPropertySheet... But then I realised that I couldn't display the tabbed page after adding a certain number of combo boxes...... I'm going crazy. How come does a problem with displaying the combo boxes??
thanks!
|
|
|
|
|
azure33 wrote:
is there a restriction to the number of edit boxes that could be added?
In the past, the resource editor was limited to 255 controls. Whether that is still the case or not, I do not know. I've never been in the position to require that many. Adding the controls dynamically is limitless, I think.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|