|
You can if the window class has the CS_PARENTDC style set.
From MSDN:
CS_PARENTDC
Sets the clipping rectangle of the child window to that of the parent window so that the child can draw on the parent. A window with the CS_PARENTDC style bit receives a regular device context from the system's cache of device contexts. It does not give the child the parent's device context or device context settings. Specifying CS_PARENTDC enhances an application's performance.
Steve
|
|
|
|
|
Yes I agree.
Thank you very much, you did let know why I have this bug and how I can fix it.
I used SelectClipRgn() to fix it, which is similiar to your GetDCEx.
|
|
|
|
|
That looks like an optimization that made sense when our computers were running at 4.77 MHz.
|
|
|
|
|
i want to use imagehlp.h for a test program,but if i include imagehlp.h,there would be a number of errors occur,these are:
>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wincrypt.h(37) : error C2146: syntax error : missing ';' before identifier 'HRESULT'
1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wincrypt.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wincrypt.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wincrypt.h(249) : error C2146: syntax error : missing ';' before identifier 'HCRYPTPROV'
... ... too many,i almost can't paste all.
Any advice?
|
|
|
|
|
Hi,
Try to include "Imagehlp.lib" with or without including the header file.
What function you want to use in ur test program?
Thanks,
Suman
|
|
|
|
|
oh,i see the problem now,i should include <windows.h> before imagehlp.h.
here,i wanna to use MapAndLoad() function. but i find its parameters such as imageName and dllPath are all LPSTR type,it seems that,this function has only one ascii version but no unicode version,right?
|
|
|
|
|
Hope You're right, try it anyways. Dont understand how that can give a missing ';' though. Do understand how that can foul at run time. Manifest Constants??
Regards
Bram van Kampen
|
|
|
|
|
Nothing to do with this particular code, but:
Missing ; before (type) means exactly that. You left out a ';' before the type, or you wrote something that the compiler interprets as needing to end in a ';', the compiler got lost. Can be messy if your error occurs in an included header.( as in your case) Ignore the other errors, I once created 2347 errors by leaving out a single comma in a bad place. An enum not terminated with a ';' is a famous way of causing this.
You left out one piece of information. Prior to the lines above you have a line stating:
compiling: C\\....\\MyFile.cpp. Go through this cpp file like a dose of salts, and replicate what the compiler reads, find out what was hit Prior to 'wincrypt.h'. The first error occurs in Line 37. That seems to indicate something wrong in the file immediately preceeding 'wincrypt.h'. If the preceeding file is a compiler include, the question arrises: Are all the Manifest Constants correct.
I am aware of the annoyance of this sort of error. Can literally take days, but there's no shortcut. When you discover the error of your ways it's typically a 'Kick yourself'case.
Bram van Kampen
|
|
|
|
|
yeah. the errors are not in my files,but in vc included files.
when i include windows.h before imagehlp.h,all the errors dispear.
Thanks.
Regards.
|
|
|
|
|
Well, the jury is out on that one. At least you got going.
Regards,
Bram van Kampen
|
|
|
|
|
pardon? I don't know what you did you mean? Would you like to explain it?(I am sorry for my poor english).Thanks
|
|
|
|
|
Well,
'The Jury is still out means in the anglosaxon court system, that the jury is still out to decide who was right or wrong.
In your case, you seem to blame VC by accusing it of not telling you to include 'Windows.h'
I would not consider this a VC Fault, you neglected to insert 'Windows.h'
Why should the Compiler tell you.
This is worthy of a long desertationn starting with what a compiler does. Do you know what the Linker does. How do you link a DLL.
Thank God it Did not. The compiler can be used for many purposes. VC and MFC are distinct and exceptional applications, within the Compiler Environment.
In my opinion, if 'Windows.h' was ommitted by you. That was your fault. Nothing to do with vc
But, as I said before Never mind the theory, you got running.Learn the Lesson.
Regards
Bram van Kampen
|
|
|
|
|
OK,thanks for your reply.
In addition,I think I should learn english much harder in future.
Regards.
|
|
|
|
|
Hi,
How to assign the set of points of a polygon to a HRGN.
|
|
|
|
|
|
Hi,
Thanks for the help!!
Rgds,
Suman
|
|
|
|
|
I need to Encrypt/Decrypt a small, approx 4k block of data and would like to use Asymetric keys of at least 256 byte. Anybody aware of PD Code that can do that with a minimum of fuss. Ofcourse, I also need to generate the two keys, Public Decryption, and Private Encryption. Alternatively, Is it possible to use one of the Windows Encryption Services for that, if so, how, and how do I create the keys.
Regards,
Bram van Kampen
|
|
|
|
|
|
|
Using C++ MS Word Automation (Word 2002 / MSWORD.OLB )
Trying to programatically - and silently - implement "ConvertToPDFandEmail" macro. Need to supply "SaveAs" file name and suppress SaveAs file dialog - to eliminate user response requirement.
Is there a way to pass a target File name and, if necessary, other parms to the macro?
I've been unable to find any information about this macro anywhere (including Adobe site).
Can anyone point me to docs?
Thanks
|
|
|
|
|
After two days of banging my head against the wall with coding attempts - I found the answer. .. as usual - something simple that I overlooked.
An Adobe menu option setting in the Windows installation - "Change Conversion Settings" - unchecked "Prompt for Adobe PDF Name".
|
|
|
|
|
I have to create a class called controller. I do not know what I need to include in this class: attributes and methods/getters/setters/operations?????? I understand the other classes involved in hangman, but not this one?????
Demonstrate the use of a class. It is strongly recommended that you choose a class to implement from the Hangman Tutorial, such as the Controller class.
Class must have a constructor.
Class must have two class member variables of different data types and getters and setters to access these variables.
Program must have 3 files, one header file, one .cpp file for that class and one Main.cpp.
#ifndef CONTROLLER_H
#define CONTROLLER _H
#include <string>
using namespace std;
class Controller
{
private:
string filename; // stores name of file where words are stored
// Add other member variables here
public:
Controller();
void start();
// Add accessor and mutator methods here for your member values
};
#endif // CONTROLLER_H
Now add the source file (Controller.cpp) & code the constructor.
#include "Controller.h"
Controller::Controller(string filename)
{
cout << "Inside the Controller Default Constructor << endl;
}
// Finish implementing methods here
First compile and execute the project to make sure you have typed everything correctly. Then modify your main() function to access your Controller class and use all methods.
Here is an example main() function*:
int main(int argc, char *argv[])
{
Controller controller;
// Call accessor and mutator methods for setting filename
// Start the game
return 0;
}
The Menu is not part of the actual hangman game itself, but rather allows us to add words to the game, play the game, and exit so it is a good candidate for its own class. The game itself can be a separate class so that we are not writing all of the code in main(). As a matter of a fact, let's plan on having very little code in main(), and let a separate class manage the interactions between the menu, game and the dictionary. We will call this class "Controller".
|
|
|
|
|
djrasa wrote: Class must have two class member variables of different data types and getters and setters to access these variables.
For example:
class Controller
{
public:
void setFilename( const char *s ) { filename = s; }
string getFilename( void ) { return filename; }
};
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I do not see how this will control the menu, dictionary, and game/ and no attributes (I am trying to understand, not trying to imply that it is incorrect{you would know before me : ) }). I thought that I needed two attributes (eg. int, char) and two functions for each to manipulate them. Sorry I am pretty new to this (retorical). Thank you for the fast response, much abliged.
|
|
|
|
|
djrasa wrote: I do not see how this will control the menu, dictionary, and game...
It won't. I was just providing you an example of how to add "getters and setters" to your existing class.
djrasa wrote: I thought that I needed two attributes (eg. int, char) and two functions for each to manipulate them.
Which is what I showed you, only using the single member variable you already had.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|