|
Yes but you miss the point. I understand how it works but let me explain that if someone overfloes the buffer with their code, that code is placed on the stack (near), when the app returns it will execute their code period. All they have to do is figure out how many bytes to oplace in the overrun.
Best Wishes,
ez_way
|
|
|
|
|
You're both saying the same thing. While it may be possible to break your older applications (only you know the answer to this), the bigger question you have to ask is "Would anyone bother?". If the payoff is small, a "hacker" is not going to bother.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi all:
please give me some information about using GDI+ in MFC model.
When I declare an Image pointer variabe 'myImage' in my XXDoc.h and,
I new an Image in XXDoc.c::OnOpenDocument() like that:
myImage = new Image (L"xxxxfilename", 0);
But I got an error message when compiling
error C2660: Gdiplus::GdiplusBase::operator new: no function declared in 3 parameters.
|
|
|
|
|
It only does that in DEBUG builds, one way around the problem is to use the ::new instead of DEBUG_NEW
myImage = ::new Image(L"xxxxfilename", 0);
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!
|
|
|
|
|
I would like to be able to distinguish Network Interface Cards installed on the system and Virtaul Adapters that are software or driver based (i.e. VMWare adapters). Does anybody know of a way to do this? Your help is greatly appreciated.
|
|
|
|
|
Hi,
How do you detect that a view window has been minimized (as by clicking on the view window's minimize button)? Should be an easy one, but none of the view's filtering functions like WindowProc and DefWindowProc seem to handle the WM_SYSCOMMAND messages. Is there a function you can call from the view to determine if it has been minimized or maximized?
Thanks for any help on this.
Terry
|
|
|
|
|
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.
|
|
|
|