|
I don't think much of the title to your post!
|
|
|
|
|
Sorry, I was pretty frustrated when I wrote it.
|
|
|
|
|
Have you tried sticking a '\' at the back of pTo? eg. pTo = d:\jpg\.
|
|
|
|
|
Thanks. I tried that and it and with the extra "\", it's not a vailid file name and generates an error.
|
|
|
|
|
Then I guess that your only alternative is to set pTo to d:\jpg\pic1.jpg
|
|
|
|
|
I need help. How can I use Visual C++ to copy a bitmap to the clipboard using OLE?
|
|
|
|
|
|
I tried the following:
BOOL CMyFormView::PutDataToClipboard(CBitmap *pBmp)
{
COleDataSource *pods = new COleDataSource;;
HBITMAP hBmp = (HBITMAP) *pBmp;
int i = sizeof(*pBmp);
HANDLE hData = ::GlobalAlloc(GMEM_FIXED, sizeof(*pBmp));
CBitmap* pData = (CBitmap*) ::GlobalLock (hData);
pData = pBmp;
BOOL l = ::GlobalUnlock(hData);
STGMEDIUM stg;
stg.tymed = TYMED_GDI;
stg.hBitmap = hBmp;
stg.pUnkForRelease = NULL;
// Place the data object on the OLE clipboard.
CFormApp* ab = (CFormApp*)AfxGetApp();
pods->CacheData(CF_BITMAP, &stg);
pods->SetClipboard();
//ab->pods->CacheData (CF_BITMAP, &stg);
//ab->pods->SetClipboard ();
delete pods;
return TRUE;
}
I'm unable to paste the bitmap in mspaint (and other places). Any ideas?
-- modified at 15:20 Tuesday 29th August, 2006
|
|
|
|
|
Hi everybdody.
I got a simple question.
How could I load some html file that I already have as resource, into an CHtmlView???
My initial idea was load the file using the Navigate2 function from OnInitialUpdate() but I can't see how.
Thank you for your time.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Try looking into the res: protocol[^]. It's a way of specifying a URL that refers to a resource in a DLL or EXE.
Software Zen: delete this;
|
|
|
|
|
I'm running into a problem that seems like it must be solvable, but I can't find any documentation that explains it.
The basics: I have a custom control that uses a bitmap for a background (either created programmatically, or by loading a resource or file). This is done in an off-screen memory DC to avoid flickering. After the bitmap is rendered, I render some text onto it using DrawText() API. When it's done, the whole thing is blitted back onto the screen.
The problem: When ClearType is enabled, the text looks ugly, almost as if every letter has a black outline around it. I'm guessing this is the sub-pixel antialiasing stuff, which has somehow turned black when I blit from the memory DC to the screen.
Question: how can I allow and use ClearType in my control and still have it look okay? Apps like IE and Firefox handle ClearType correctly, and I'm pretty sure they're using some kind of off-screen double-buffering scheme for drawing, so it seems to me there should be a way to do it. But I'm darned if I can figure out how.
Thanks in advance for any help,
Warner Young
|
|
|
|
|
I had a similar problem the other day, i found the cause was when drawing of screen, I didn't create a compatible bitmap with the main DC. Have a look at how you are implememnting your double buffer, the problem may be there.
|
|
|
|
|
Is the bitmap that is selected in the memory dc a bitmap that is compatible with the screen? Or did you just select the bitmap that you created/loaded into the memory dc and try to draw the text that way? Some sample code would help since I don't have any problem drawing cleartype enabled text on my doublebuffered controls.
|
|
|
|
|
I am inferring some things from my learning experience with VC++. I'd like to check if I am correct.
1. Each file is compiled separately and independently. This means each .ccp and .h file is compiled as a stand alone unit.
2. If #1 is correct, then each file must contain all the class and function declarations to which any code in that file will refer.
3. The same header file with class declarations can be #included in several other files. In other words, trans.h can be included in both abc.ccp and xyz.cpp.
Is this correct? Thanks.
|
|
|
|
|
Oliver123 wrote: 1. Each file is compiled separately and independently. This means each .ccp and .h file is compiled as a stand alone unit.
*.cpp files are compiled, not *.h files. CPP files are where the implementation for classes, functions, etc are placed. H files are where they are defined. This allows other modules (classes, libraries, etc) to see the definition of a function or class without having to know how everything is implemented during the compilation.
Oliver123 wrote: 2. If #1 is correct, then each file must contain all the class and function declarations to which any code in that file will refer.
You can't use a function/class/variable/etc unless you know how it is defined.
Oliver123 wrote: 3. The same header file with class declarations can be #included in several other files. In other words, trans.h can be included in both abc.ccp and xyz.cpp.
This is correct. Though usually you place #pragma once or #ifdef/#define statements around the header file content to prevent a file from being included multiple times.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Oliver123 wrote: his means each .ccp and .h file is compiled as a stand alone unit.
it helps to think of #include "foo.h" as doing exactly what "include" implies: the preprocessor reads the contents of foo.h and, in effect, sticks that in the place of the #include line. the compiler doesn't really look at foo.h directly.
and, you can #include anything.
|
|
|
|
|
Hey,
how can I draw a rotated ellipse with MFC. The only way I found out to draw ellipse is to use CDC:Ellipse. The way requires a rect...
Is there any other way?
Thank you for your help
|
|
|
|
|
One way would be to draw it unrotated and then to use CDC::ModifyWorldTransform to do the rotation.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Is there online thorough and complete C/C++ manual with all minute details of abstract, virtual, overloading etc..
9ine
|
|
|
|
|
Have you tried Googling for the information?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
For online sources ... use Google.
For offline, check out books by Scott Meyers and Herb Sutter.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Yes, but you have to pay for it. The C++ standard is available in PDF from ANSI here[^] (costs $30).
|
|
|
|
|
|
From people that know, are skills in VC++ translateble to the embedded / mobile version? What are the main differences?
-- modified at 11:27 Friday 25th August, 2006
A cynic is a man who, when he smells flowers, looks around for a coffin. -H.L. Mencken
|
|
|
|