Click here to Skip to main content
15,906,626 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Multiple inheritance or what? Pin
SriKrishna26-Oct-02 8:46
SriKrishna26-Oct-02 8:46 
GeneralRe: Multiple inheritance or what? Pin
Chris Richardson26-Oct-02 13:42
Chris Richardson26-Oct-02 13:42 
GeneralRe: Multiple inheritance or what? Pin
SriKrishna26-Oct-02 15:06
SriKrishna26-Oct-02 15:06 
QuestionMultiple inheritance or what? Pin
SriKrishna25-Oct-02 13:36
SriKrishna25-Oct-02 13:36 
GeneralOverloaded and assignment operators Pin
mcgraw25-Oct-02 13:27
mcgraw25-Oct-02 13:27 
GeneralIPicture object duplication... Pin
nebbish25-Oct-02 12:43
nebbish25-Oct-02 12:43 
GeneralRe: IPicture object duplication... Pin
Michael Dunn25-Oct-02 14:51
sitebuilderMichael Dunn25-Oct-02 14:51 
GeneralRe: IPicture object duplication... Pin
nebbish25-Oct-02 15:05
nebbish25-Oct-02 15:05 
Hey Mike, yes i was using that and yes they were 1-bit black & white bitmap copies.

i don't have the time to go digging through MSDN for all the steps it will take to copy the bitmap through a DC........sooooo....i found another way Cool | :cool: --

<br />
void CopyPicture(IPicture *pOrig, IPicture **pCopy)<br />
{<br />
    HRESULT hr;<br />
<br />
    *pCopy = NULL;<br />
    IPicturePtr spOrig(pOrig);<br />
    IPicturePtr spCopy;<br />
<br />
    IPersistStreamPtr spPS(spOrig);<br />
<br />
    IStreamPtr spStream;<br />
    hr = CreateStreamOnHGlobal(NULL, TRUE, &spStream);<br />
<br />
    // Save the original picture into the stream<br />
    hr = spPS->Save(spStream, FALSE);<br />
<br />
    // Create the uninitialized new picture<br />
    hr = OleCreatePictureIndirect(NULL, IID_IPicture, TRUE, (void**)&spCopy);<br />
<br />
    // Reset the stream, and tell the new picture to load from the stream<br />
    LARGE_INTEGER li;<br />
    li.QuadPart = 0;<br />
    hr = spStream->Seek(li, STREAM_SEEK_SET, NULL);<br />
    spPS = spCopy;<br />
    hr = spPS->Load(spStream);<br />
<br />
    hr = spCopy->QueryInterface(pCopy);<br />
}<br />


(i know i don't do anything with 'hr', it's mostly for when i step through the code in a debugger, it would be very strange for any of this to actually not work)

...this proved much easier to wrap my mind around in the short run, avoiding the complexities of GDI. This way even the palette is copied from one image to the other.

thanks,
nebbish

Smart, Sexy, Sane. Pick two.
GeneralSDK vs MFC ownerdraw Pin
alex.barylski25-Oct-02 12:33
alex.barylski25-Oct-02 12:33 
GeneralRe: SDK vs MFC ownerdraw Pin
Ravi Bhavnani25-Oct-02 12:46
professionalRavi Bhavnani25-Oct-02 12:46 
GeneralRe: SDK vs MFC ownerdraw Pin
alex.barylski25-Oct-02 13:08
alex.barylski25-Oct-02 13:08 
GeneralRe: SDK vs MFC ownerdraw Pin
Ravi Bhavnani26-Oct-02 4:55
professionalRavi Bhavnani26-Oct-02 4:55 
GeneralNeed Help(CDC) Pin
Svin25-Oct-02 10:49
Svin25-Oct-02 10:49 
GeneralRe: Need Help(CDC) Pin
includeh1025-Oct-02 21:15
includeh1025-Oct-02 21:15 
GeneralBig thx Pin
Anonymous26-Oct-02 6:21
Anonymous26-Oct-02 6:21 
QuestionHow to write a code to increment by 4 Pin
needhelp5725-Oct-02 10:43
needhelp5725-Oct-02 10:43 
AnswerRe: How to write a code to increment by 4 Pin
Chris Losinger25-Oct-02 10:58
professionalChris Losinger25-Oct-02 10:58 
GeneralRe: How to write a code to increment by 4 Pin
needhelp5728-Oct-02 7:29
needhelp5728-Oct-02 7:29 
AnswerRe: How to write a code to increment by 4 Pin
Mel Feik25-Oct-02 11:09
Mel Feik25-Oct-02 11:09 
GeneralAuto-completion after . or -> doesn't work Pin
User 665825-Oct-02 10:34
User 665825-Oct-02 10:34 
GeneralRe: Auto-completion after . or -> doesn't work Pin
Chris Losinger25-Oct-02 10:56
professionalChris Losinger25-Oct-02 10:56 
GeneralRe: Auto-completion after . or -> doesn't work Pin
User 665825-Oct-02 11:24
User 665825-Oct-02 11:24 
GeneralInserting your own warnings into code Pin
nde_plume25-Oct-02 9:35
nde_plume25-Oct-02 9:35 
GeneralRe: Inserting your own warnings into code Pin
Michael Dunn25-Oct-02 14:57
sitebuilderMichael Dunn25-Oct-02 14:57 
GeneralRe: Inserting your own warnings into code Pin
nde_plume5-Nov-02 8:24
nde_plume5-Nov-02 8:24 

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.