|
CWnd::IsIconic()
CWnd::IsZoomed()
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
CWnd::IsIconic()
CWnd::IsZoomed()
How are these functions used? I've tried putting the IsIconic function in the view's Idle (On Update)function, "minimize=IsIconic();" and it always returns 0, whether the view is minimized or not. Very frustrating that a simple thing like this is so obscure in MFC.
Terry
|
|
|
|
|
PJ Arends wrote:
CWnd::IsIconic()
CWnd::IsZoomed()
Well, it turned out to be slightly more complicated than this. IsIconic does work for views, but only if you use it in GetParentFrame->IsIconic().
Terry
|
|
|
|
|
I am fairly new (again) to VC++, I have seen alot of posts on memory leaks here, what do you use to check memory leaks? Is it a program that comes with VC? and does it tell you what lines the leaks accur in?
Thanks,...
Josh
|
|
|
|
|
If you run the application in debug mode,and then dismiss it, you will get fair bit of information about the memory leak in the debug window at the bottom, if you want detail analyis of memory leaks, rational purify is a good tool for that.
The World is getting smaller and so are the people.
|
|
|
|
|
|
I am new to programming and I am in a class right now, a beginners course to programming with C++, I usually would never ask for help like this, but I have a group project due tonight, and none of the other team members have posted their part of the project, so I have written all of them, except one, and I am sure it is simple, but I can't seem to get it, if anyone could show me this code, I would owe you big time.
Problem: a while loop to obtain and display the sum of sqaured even integers between a given range.
The mimimum aqnd maximum integer values of the rane are input by the user.
The program uses a subprogram to read the two integers.
The program uses a function with two parameters (the mimimum and maximum value of the range) to compute the result.
The program uses a subprogram to output the result.
I know this is a long shot, and not expecting a thing, but if you can help, I would greatly apprectiate it. Thank you in advance.
Cory renfrow
|
|
|
|
|
I assume you already know how to do a loop. To check if a number is even, use:
if ((x % 2) == 0)
{
...
} C does not have subprogams. It only has functions. They do not have to return a value, however.
Use cin to obtain input from the user. Use cout to display data.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
David,
Thank you for the response, I think my frustration has completly blocked everything I have learned. Trying to do everyone's part of the project is killing me. I am not good with loops at all, but I will take your advice and see what I can do. Thanks again.
|
|
|
|
|
Cory Renfrow wrote:
Trying to do everyone's part of the project is killing me.
If your ultimate goal is to someday be a programmer, this is a great opportunity.
Cory Renfrow wrote:
I am not good with loops at all...
while (some_condition)
{
statement;
...
}
for (initialization; condition; loop)
{
statement;
...
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
As a hint, if your step between the lower value and higher value in a loop like this:
int minEven = min + (min % 2);
int maxEven = max - (max % 2);
int value = minEven;
while (val <= maxEven)
{
val += 2;
}
% is the MOD operator, which returns the remainder after dividing one number by the other. x % 2 will return 0 for even numbers and 1 for odd numbers.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Hi,
I'm trying to serialize my document; it's going just fine up to a point, then I hit problems. My main Document contains an array of objects which are essentially sections or folders. I can serialize these without an issue.
However, each section object holds a further array of a different object type. Whenever I try to restore a file with these little fellas in, I get errors. Mostly CArchive end-of-file errors. It sounds like this could be a simple thing but I can't figure it out.
Any help would be greatly appreciated.
Simon
|
|
|
|
|
I suspect that you try to save and load different things, that 's why you get EOF errors.
What I mean is:
void CYourObject::Serialize( CArchive& ar )
{
CObject::Serialize( ar );
if( ar.IsStoring() )
ar << m_nParam1 << m_nParam2;
else
ar >> m_nParam1 >> m_nParam2 >> m_nParam3;
}
Storing should go fine with this object.
Even on loading the first two params, they are filled OK. The problem arises when the loading part of serialization expects a third parameter which does not exist in the serialized file, and EOF error is shown.
I think your complicated data structure triggers the same effect.
Check it again for storing and loading conformance including the number, sequence and type of variables.
Peter Molnar
|
|
|
|
|
Is there any way to set so that only ceratain columns are availbale for input
in CDataGrid?
Thanks in advance.
Shin
|
|
|
|
|
where or how could I download iptypes.h?
Thanks
|
|
|
|
|
Is it that time of year again ?
iptypes.h is part of the platform SDK. If you get that particular header file, you'll get a lot of typedefs and #defines ( 9 k of them, apparently ), but I doubt they will be of much use to you, you'd need to also link to the dlls that contain the functions that use them. In other words, download the platform SDK.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
ok, nowadays I only have installed microsoft visual c++. If I download SDK platform and I make a program with visual c++ and I include SDK dll´s, will it works in any computer?
Thanks again
|
|
|
|
|
You don;t include SDK dll's, you include SDK lib files. You need to read MSDN, it will tell you what version of Windows introduced the API's you are trying to call. I presume you're using VC6, between VC6 and .NET, several versions of Windows were released, they all came with new API's and the SDK is how the older compiler knows how to compile code that calls functions that exist in the new dlls already on the machines of the people with a newer OS. No, you cannot distribute the dlls to make the API's work with older versions of Windows.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Thanks I'll try it and if doesn't work I'll ask again.
|
|
|
|
|
So...I want users to be able to create an unlimited number of CStatics dynamically in my program, and save & load them. Right now, I'm just defining 20 of them in OnCreate, then serializing data about those 20 (blank data for those not yet created). My problem is: how do I create dynamically any number of them, yet still have a way of say painting/updating them, or even knowing how to refer to them from a function other than the one in which they were created (my only guess on how to make unlimited is just to have the same variable name for each one as it's created, then store the data, but then I'd have to re-create each one on EVERY update or painting for the user to be able to see all of them? Wouldn't this be a horrible waste of resources?) Or, is there nothing to be done, and I should just define like 200 from the beginning and hope they don't want to go crazy with creating things?
halblonious
|
|
|
|
|
Put them in a vector, and I believe that if they are created so that your window is their parent, they will get their proper update calls, etc.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
You'll have to pardon my ineptitude, but can you tell me what a vector is, and how to use them? I figured there must be some well-known way to do what I want, I just didn't know about it.
halblonious
|
|
|
|
|
A vector is a dynamic array, part of the stl ( standard template library ). If you search for 'vector STL', there are plenty of articles on the site on how to use them.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Just a simple example of what Christian suggested:
CStatic m_Statics[1000];
for (int i = 0; i < 1000; i++)
{
m_Statics[i].Create(...);
m_Statics[i].LoadBitmap(...);
m_Statics[i].ShowWindow(SW_HIDE);
}
You can acces the m_Statics[] member variable of your dialog from any function of your dialog.
void CYourDialog::ShowMeOneStatic(void)
{
m_Statics[112].ShowWindow(SW_SHOW);
}
But my problem is with your design. A dialog window has a very limited space. How do you wanna show dozens of control on it at a time?
Is it possible that you don't need them all at a time? Do you just wanna use those CStatic's to store data, and show a FEW of them on your dialog?
Give more details about your project so that we can provide you with more help.
Peter Molnar
|
|
|
|
|
I'd first like to say that this website and you people who help me out are amazing and wonderful, and I'm thankful for you. Well, the program I'm making is a report generator for doctors. Basically, the visual part for the user will be kinda like Microsoft Publisher. They can make squares, rectangles, and lines, each with whatever thickness or color, and the shapes will have borders and frames. Plus, there'll of course be text boxes. The reason I want to change how I'm doing it is: if I have to plan ahead for ANY possible way someone might want to use this, I'd have to setup at least like 10 of each type of thing from the get go, which I'm assuming uses more overhead than would be good. But, then what if they want 11 text boxes, or 11 ovals? Well, maybe I should create 20 of each? See the issue, there? So, I figured that a dynamic way of creating them would be better, so I'm only using the space needed for what the user wants, and they can create as many whatevers as they so desire.
A question: CStatic m_Statics[1000];
Wouldn't that use a ton of memory, or is there really no way to avoid it? Is this an stl vector? Or is that something different?
halblonious
|
|
|
|