|
cdsmith wrote:
Will the the off-screen approach work for print preview and printing?
yep
cdsmith wrote:
Can this be done with 'print' DCs?
i've heard that the typical transparent-blt techniques don't work with printer DCs; and my experience agrees. but, you might get lucky and find a printer driver that can handle it.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
cdsmith wrote:
- Will the the off-screen approach work for print preview and printing?
It should do, but it may be possible that you could hit an upper limit on the size of the bitmap. As some printers work in very large resolutions (3000 by 3000 or larger), this can cause a very large bitmap to be created. I think there was some upper limit on the size in earlier versions of windows (9x)
cdsmith wrote:
the other problem I have is that some of the graphics I draw are transparent
In my experience, BitBlt works ok for the preview by does not produce output in the actual print for most printers. As you cannot guarantee what printer your user may have, I would suggest moving to the more generic StretchDIBBits() function which I haver never known not to work on a printer. The only issue you may have is that StretchDIBBits() may not support your transparanecy stuff. As I have never used it for that, you will have to investigate using the documentation.
Hope it works out for you. Printing can be hard work.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi,
Thank you for dropping by. I want to display a dialog box to the user so that they can choose a font. Now CFontDialog does this very nicely. However, all my programs options are in "tabbed Property sheets" so that the user can find all the config stuff in one place.
What I would like to do is to add the CFontDialog as a Property Page to the Property Sheet along with all the other config dialogs. Is this possible?
Thank you.
P.S. I am using VC++ v6
Michael Thomas
|
|
|
|
|
Consider adding the font dialog to the property sheet as though it is a property page. If that does not work, then derive a class from CFontDialog and CPropertyPage.
Kuphryn
|
|
|
|
|
Instead of using Multiple Inheritance and deriving your class from CPropertyPage and CFontDialog you should be able to create a dialog template and include the CFontDialog inside of it, much the same way as you can with CFileDialog. I don't have the method to do this handy right now, but it involves creating a dialog template, and including a static or group box with a special id stc=0x30 or something like that. There are several examples on the net.
That should work, allthough I have not tried it yet.
|
|
|
|
|
Take a look at "advanced programming with Microsoft Visual C++" from microsoft press, at it's chapter 7 it explains nicely/easily how to insert common dialogs inside a normal one.
If you want you can insert a common dialog into a property page (in the same way).
If you don't have the book, send me a mail so I can send you the code that's inside the CDROM that came with the book.
Regards.
|
|
|
|
|
I would like to find a good site to learn about the C++ implementation of binary heaps. Does anybody know what's a good site to learn about this. I would like to find a site, for a beginner. A super simple little program would be very helpful. I really want to understand how is it that it works, its implementation, and where it's usually used.. Thanks;)
GabyGirl
|
|
|
|
|
|
I'm a beginner here with probably a very easy question...
I'm looking to find how to get the largest value in a series of numbers, without using a function.
Any suggestions?
Thanks!
Sheshi
|
|
|
|
|
How about...
int nLargest = 0;
for( int i = 0; i < ARRAY_SIZE; i++ )
nLargest = __max( nLargest, ARRAY_ELEM[ i ] ); ???
|
|
|
|
|
Is is a programming question or a general "howto" question ?
Do you have a clue how you'd do it by telling me in your own word, without using code, just plain english ( or whatever human language we both understand )
If you can't derive a non-technical answer to this problem you need to think about it a bit more.
If it's a programming question, you have a bug with the code you wrote to solve this, then ask something a bit more precise.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Hi
There's a warning that is annoying me extremely, but I don't know how to get rid of it. Here it is:
Linker-Vorgang läuft...
Bibliothek Release/highlight.lib und Objekt Release/highlight.exp wird erstellt
highlight.exp : warning LNK4070: Die Direktive /OUT:hllaMIRC.dll in .EXP weicht vom Ausgabedateinamen "highlight.dll" ab; Direktive wird ignoriert
It is german, I try to translate it as far as I can:
"Library Release/highlight.lib and object Release/highlight.exp are being created
highlight.exp: warning LNK4070: the directive /out:hllaMIRC.dll in .exp differs from the output name "highlight.dll"; directive will be ignored."
thanks in advance
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I think it's saying that the output name specified in your .def file is different to the one in the project settings. Trying making them the same and see what happens.
Dave
|
|
|
|
|
Yeah, what a simple solution. Thank you VERY much
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
StartPage and EndPage are not working in print preview, but to printer.
The data is displayed only in the first preview page.
How can i solve that problem?
|
|
|
|
|
Hi
I'm developing an application which interfaces with Internet Explorer using COM.
I have a problem compiling my code due to typedef redefinitions. Whilst I understand the cause of the compiler error, I cannot figure a way around it. My application is #import'ing mshtml.tlb. This causes the compiler to automatically create 'mshtml.tlh', which redefines some existing typedefs. The worst thing, is that mshtml.tlh (which is not editable due it being regenerated every time you compile) defines UINT_PTR as an unsigned long *, so it differs with the existing definition which is of course unsigned int *.
None of these typedefs are mine, and i do not sepcifically include BaseTsd.h or WinGDI.h
I could really use some suggestions as to how i can resolve this problem.
Here's the output :
TestIEConnectWithCOM.cpp
c:\TestIEConnectWithCOM\Debug\mshtml.tlh(957) : error C2371: 'UINT_PTR' : redefinition; different basic types
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\BaseTsd.h(90) : see declaration of 'UINT_PTR'
c:\TestIEConnectWithCOM\Debug\mshtml.tlh(76516) : error C2011: 'tagLOGFONTW' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\WinGDI.h(1167) : see declaration of 'tagLOGFONTW'
Jase
|
|
|
|
|
I believe you can provide a different namespace name, to avoid the conflict. More info here[^].
|
|
|
|
|
Thanks for your reply. The article you linked me too has helped me fix the problem.
I'm not well acquainted with namespace's, and the article showed me you can exclude symbols as follows :
<br />
#import < mshtml.tlb > named_guids no_namespace exclude("UINT_PTR", "tagLOGFONTW")
Thanks again for you help.
Jase
|
|
|
|
|
I'm trying to take multiple small bitmaps, BitBlt them into a memory dc then
using a mask, draw them transparently to the screen. With one bitmap from a file it works fine, but when I combine them to an in memory DC and do the transparent blt, the colors get screwed up.
|
|
|
|
|
try to use TransparentBlt() , it uses chroma key to apply the transparency, and much easier
BOOL TransparentBlt(
HDC hdcDest,
int nXOriginDest,
int nYOriginDest,
int nWidthDest,
int hHeightDest,
HDC hdcSrc,
int nXOriginSrc,
int nYOriginSrc,
int nWidthSrc,
int nHeightSrc,
UINT crTransparent
);<pre>
if you are using VC++7 you will find it in the CDC class, otherwise you should use this API version
|
|
|
|
|
I try to set bitmap on button but without success?
CButton xxx;
xxx.SetBitmap(::LoadBitmap(NULL,MAKEINTRESOURCE(IDB_BITMAP1)));
why this does not work?
Best regards,
Axe.
|
|
|
|
|
if you set the button syte to BS_BITMAP and the LoadBitmap returned a valid handle this function should work, otherwise somthing else may be wrong
|
|
|
|
|
which function is in the middle of CAppWin::OpenDocumentFile() and CDocument::OnFileOpen()?
because app crashes after call CAppWin::OpenDocumentFile() and before reach to CDocument::OnFileOpen().
thx
includeh10
|
|
|
|
|
What about using the debugger call stack ?
|
|
|
|
|
hello
i would to find a function that can know if the CDROM DRIVER work or not or in other way if it read or no.
|
|
|
|