I am currently writing an application using C++ and MFC. For displaying the results of a certain operation, a new window is created. The window is represented by a class I created called COutputWindow. The base class of COutputWindow is CFrameWnd. I create the output window by doing the following operations:
1) Creating a new instance of COutputWindow by calling new.
2) Calling the member functions of COutputWindow: ShowWindow and UpdateWindow. Actually these
member functions are defined in the base class.
3) A define COutputWindow::OnPaint to display the results.
In my main window, I save a pointer to the output window. In addition, when the output window (window of type COutputWindow) is closed, I want the objected created by new in step 1 to be deleted. However, I cannot do this until the window is completely closed. Therefore, I believe that the pointer cannot be deleted on COutputWindow::OnClose. Therefore, where should I delete the pointer that represnets the object to the closed window.
You are not doing any polymorphic operations.
Also you do not need any runtime information for creating the window.
So I suggest you go for a stack variable instead of using new and simply show/hide the window.
This will also work faster.
«_Superman_» I love work. It gives me something to do between weekends.
This is a member function of a class (it is defined inline here) which has a member variable <ObjName> * firtemp;. firFile is a file-level const string variable.
The licensed software object <objName>> does provide an overloaded definition for the "<<" operator, and the example I'm following uses it in exactly the way I use it above to save the firtemp object to a file.
When I attempt to run this code, the firOut << *firtemp line results in a memory access violation which is fairly consistent ... it moves around very little, as in < 16 bytes or so.
One of the things i've noticed while trying to debug this error is that when I set firtemp as a watch (I'm using VS2005), and set break points at the start of the function then step through ... the value of firtemp changes wildly. Is this expected? Also, if I insert a cout statement for the value of firtemp, it does not agree at all with the value the debugger gives ... again, I'm not sure what to expect here.
Now, in the "Autos" field in the debugger, the "this" parameter has its value in red text for most of this function call ... is this normal? If not, what does it indicate? I searched online and could find no references for this simple question.
Primary Question: Is there anything obviously wrong with what I'm doing here, or is the error having to do with the licensed code/my interface to it? Any hints for trying to find the error, if it is in my interface?
A good question - the example is doing it because there are other member functions that might want to access the object and there is no default constructor for it, so you can't easily have a member variable of the actual object type ... having a pointer is comprise solution.
However, for my useage this is not needed, and I did rewrite it with a local variable/stack allocation. Unfortunately I get exactly the same error. What I may not have noted in the original post is that I can definitely write to the file this attempts to write to, and I can access other member functions of the object, for instance a size() function, with no errors.
Ok, let's say that we have an application that supports DLL calls, and on every routine call to the DLL, the application's main handle (HWND) is passed.
Example:int __stdcall TheFunction(HWND mWnd)
Now, let's say that the application has a dialog that I want to modify (IE: Change the caption or coloring of text inside an edit box within the dialog). How would I go about gaining control of the dialog handle?
There is no "resource" file for the program, but I have already acquired the dialog ID and control identifier as well, which is located at: http://pastebin.com/ffbc560f
I am unable to install platform SDK on Vista Operating System.
Each time a information bar is populated when i click on Default.htm file .
Is there any other way to Install Plateform SDK . I have used many hit and trial methods .
I have posted a query previously in the same forum . Naveen sir has suggested that Choose 'Run as administrator'.. I have also tried but same information bar which we normally see when a website tries to install some active x on computer . The information message displays 'Your security settings do not allow website to use Active X Controls installed on your computer. This page may not display correctly'.
I have clicked on this bar and done same changes in my security setting as seen in more information option .But still i am not able to install Plateform SDK..
Please tell me some way to overcome this problem..
How exactly are you trying to install the SDK and which one? I just recently installed the latest platform SDK and didn't have to do anything with default.htm, and in fact can't understand were you would have to. The download comes in ISO form and is about a 1.3GB file. You simply mount the iso with PowwerISO or something similar and run setup.exe.
I am trying to install
Windows SDK Windows .NET Server 2003 RC2 (October 2002). I am having an installation folder which contains diffrent html files , for starting the setup i clicked on default.html file which is suppose to install the whole setup displaying page by page information . The size of my installation folder is 570 MB ..
I have previously installed this platform sdk but on xp operating system..
I m referring to a tutorial book of database using ADO.
The problem is i have to get the result displayed in CListCtrlEx for which the tutorial book says i have to copy three files-CtrlExt.cpp, CtrlExt.h,
and CtrlExt.Inl-from the DAOVIEW example into the source code directory for my application.
I serached for these 3 files in the VC98\MFC\SRC\
But i could find the files there...so i even tried to download the files to the above folder and then added them to my project but still i get the
error : CListCtrl undeclared identifier
error : Cannot open the file CtrlExt.h
How do i use this CListCtrlEx class so that i can add columns and data to the client application ?
BackGround : Its a MDI with ListView as Base class .
Kindly tell me stey by step process to get rid of this error and use the CListCtrl class.
You've got several things going on here. Trying to do them all at once might not be your best bet. I would suggest first getting familar with a list control (in 'report' mode) and the related CListCtrl class. When you are able to add columns and items, then start looking at the CListCtrlEx class and the extra features that it offers (you may find it altogether unnecessary). That class can be found here.
There's also the issue with reading records from that database. That is an exercise in itself. You might want to start here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
Last Visit: 31-Dec-99 18:00 Last Update: 29-Sep-23 8:15