Click here to Skip to main content
15,914,594 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAppearance of ActiveX Control at Design-time Pin
hhh18-Sep-08 5:46
hhh18-Sep-08 5:46 
Questionpublic struct in a class Pin
Cengine18-Sep-08 5:38
Cengine18-Sep-08 5:38 
AnswerRe: public struct in a class Pin
toxcct18-Sep-08 5:52
toxcct18-Sep-08 5:52 
GeneralRe: public struct in a class Pin
Cengine18-Sep-08 5:58
Cengine18-Sep-08 5:58 
GeneralRe: public struct in a class Pin
toxcct18-Sep-08 6:02
toxcct18-Sep-08 6:02 
GeneralRe: public struct in a class Pin
Cengine18-Sep-08 6:06
Cengine18-Sep-08 6:06 
AnswerRe: public struct in a class Pin
Matthew Faithfull18-Sep-08 6:12
Matthew Faithfull18-Sep-08 6:12 
QuestionBitBlt does not work in print preview Pin
theCPkid18-Sep-08 5:29
theCPkid18-Sep-08 5:29 
I am trying to draw something into memory DC and then copy it to screen or printer DC. I get the correct output drawing on screen or when directly taking the print out on printer. BUt while viewing print preview, it does not show any output.
CMyView::OnDraw(CDC* pDC)
{
    CTestDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    if (!pDoc)
        return;

    CRect rcClient;

    if (pDC->IsPrinting()) 
    {
        rcClient = m_rcPrintRect; //obtained from CPrintInfo
    }
    else
    {
        GetClientRect(&rcClient);
    }    

    CBitmap bmp;
    CDC memDC;
    
    memDC.CreateCompatibleDC(pDC);
    bmp.CreateCompatibleBitmap(pDC, rcClient.Width(), rcClient.Height());
    memDC.SelectObject(&bmp);

    memDC.DrawText(L"Hello", &rcClient, DT_CENTER | DT_VCENTER);
    pDC->BitBlt(0,0,rcClient.Width(), rcClient.Height(), &memDC, 0, 0, SRCCOPY);

    bmp.DeleteObject();
    memDC.DeleteDC();

    return;
}


I suspect something is wrong with creating compatible DC. pDC represents printer dc but the display is on screen. How to remove this problem? Sigh | :sigh:
AnswerRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 5:49
Mark Salsbery18-Sep-08 5:49 
GeneralRe: BitBlt does not work in print preview Pin
theCPkid18-Sep-08 5:54
theCPkid18-Sep-08 5:54 
QuestionRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 5:57
Mark Salsbery18-Sep-08 5:57 
AnswerRe: BitBlt does not work in print preview Pin
theCPkid18-Sep-08 6:03
theCPkid18-Sep-08 6:03 
GeneralRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 6:34
Mark Salsbery18-Sep-08 6:34 
GeneralRe: BitBlt does not work in print preview [modified] Pin
theCPkid18-Sep-08 7:01
theCPkid18-Sep-08 7:01 
GeneralRe: BitBlt does not work in print preview Pin
Mark Salsbery18-Sep-08 7:25
Mark Salsbery18-Sep-08 7:25 
GeneralRe: BitBlt does not work in print preview Pin
theCPkid18-Sep-08 22:44
theCPkid18-Sep-08 22:44 
GeneralRe: BitBlt does not work in print preview Pin
Mark Salsbery19-Sep-08 5:17
Mark Salsbery19-Sep-08 5:17 
GeneralRe: BitBlt does not work in print preview Pin
theCPkid19-Sep-08 19:49
theCPkid19-Sep-08 19:49 
AnswerRe: BitBlt does not work in print preview Pin
Roger Allen18-Sep-08 14:37
Roger Allen18-Sep-08 14:37 
GeneralRe: BitBlt does not work in print preview Pin
theCPkid18-Sep-08 22:42
theCPkid18-Sep-08 22:42 
QuestionHow can i lock the internet from a C++ program Pin
SNArruda18-Sep-08 5:04
SNArruda18-Sep-08 5:04 
AnswerRe: How can i lock the internet from a C++ program Pin
David Crow18-Sep-08 5:21
David Crow18-Sep-08 5:21 
JokeRe: How can i lock the internet from a C++ program Pin
Iain Clarke, Warrior Programmer18-Sep-08 5:22
Iain Clarke, Warrior Programmer18-Sep-08 5:22 
AnswerRe: How can i lock the internet from a C++ program Pin
Bram van Kampen18-Sep-08 14:55
Bram van Kampen18-Sep-08 14:55 
QuestionRatio result placing a square not working - when resizing window Pin
simon alec smith18-Sep-08 5:01
simon alec smith18-Sep-08 5:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.