Click here to Skip to main content
16,007,163 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Pulling info from other apps Pin
RobJones4-Oct-01 11:22
RobJones4-Oct-01 11:22 
GeneralGrid probs Pin
Jon Hulatt4-Oct-01 7:03
Jon Hulatt4-Oct-01 7:03 
GeneralRe: Grid probs Pin
Christian Graus4-Oct-01 11:54
protectorChristian Graus4-Oct-01 11:54 
GeneralRe: Grid probs Pin
Jon Hulatt4-Oct-01 22:20
Jon Hulatt4-Oct-01 22:20 
GeneralBitmap and clipboard Pin
#realJSOP4-Oct-01 6:44
professional#realJSOP4-Oct-01 6:44 
GeneralRe: Bitmap and clipboard Pin
Chris Losinger4-Oct-01 7:00
professionalChris Losinger4-Oct-01 7:00 
GeneralRe: Bitmap and clipboard Pin
#realJSOP4-Oct-01 7:18
professional#realJSOP4-Oct-01 7:18 
GeneralRe: Bitmap and clipboard Pin
Chris Losinger4-Oct-01 7:29
professionalChris Losinger4-Oct-01 7:29 
that might be true..

i only metion that becaseu i find that doing something like this:
CDC memDC;
memDC.CreateCompatibleDC(pRealDC);
CBitmap memBMP;
memBMP.CreateCompatibleBitmap(memDC, ...);

will often fail (i get a monochrome bitmap or something equally perverse). To make it work I have to use pRealDC in the CreateCompatibleBitmap call. using the 'compatible' DC screws things up.

so, as a rule, i always use a real DC (from GetDC(NULL), or a paint DC or a CClientDC) in these functions.

just a thought.

also, when i copy DIBs to the clipboard, i do it like this:
HGLOBAL CISImage::MakeClipboardDIB()
{
   HGLOBAL hDIB = MakeDIB();
   
   HGLOBAL hCBDIB = NULL;
   if (hDIB)
   {
      DWORD dwSize = GlobalSize(hDIB);
      hCBDIB = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, dwSize);
      if (hCBDIB)
      {
         BYTE *pCBDIB = (BYTE *)GlobalLock(hCBDIB);
         memcpy(pCBDIB, (BYTE *)hDIB, dwSize);
         GlobalUnlock(hCBDIB);
      }
      
      GlobalFree(hDIB);
   }
   
   return hCBDIB;
}

...

if (OpenClipboard(AfxGetMainWnd()->m_hWnd))
{
   CISImage img; 

   ...put something in img...etc.

   HGLOBAL hDib = img.MakeClipboardDIB();
   
   HANDLE res = SetClipboardData(CF_DIB, hDib);
   ASSERT(res);

   CloseClipboard();
}

-c

------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
GeneralRe: Bitmap and clipboard Pin
#realJSOP4-Oct-01 7:57
professional#realJSOP4-Oct-01 7:57 
GeneralRe: Bitmap and clipboard Pin
Chris Losinger4-Oct-01 7:59
professionalChris Losinger4-Oct-01 7:59 
GeneralRe: Bitmap and clipboard Pin
#realJSOP4-Oct-01 8:19
professional#realJSOP4-Oct-01 8:19 
GeneralRe: Bitmap and clipboard Pin
Chris Losinger4-Oct-01 8:23
professionalChris Losinger4-Oct-01 8:23 
GeneralRe: Bitmap and clipboard Pin
#realJSOP4-Oct-01 8:42
professional#realJSOP4-Oct-01 8:42 
GeneralRe: Bitmap and clipboard Pin
Chris Losinger4-Oct-01 8:45
professionalChris Losinger4-Oct-01 8:45 
GeneralRe: Bitmap and clipboard Pin
#realJSOP4-Oct-01 8:49
professional#realJSOP4-Oct-01 8:49 
GeneralRe: Bitmap and clipboard Pin
Tomasz Sowinski4-Oct-01 7:10
Tomasz Sowinski4-Oct-01 7:10 
GeneralRe: Bitmap and clipboard Pin
#realJSOP4-Oct-01 7:16
professional#realJSOP4-Oct-01 7:16 
GeneralRe: Bitmap and clipboard Pin
Tomasz Sowinski4-Oct-01 7:17
Tomasz Sowinski4-Oct-01 7:17 
QuestionMCI CD Audio Mount and Eject? Pin
Bryan Anslow4-Oct-01 6:10
Bryan Anslow4-Oct-01 6:10 
AnswerRe: MCI CD Audio Mount and Eject? Pin
Tomasz Sowinski4-Oct-01 6:24
Tomasz Sowinski4-Oct-01 6:24 
GeneralRe: MCI CD Audio Mount and Eject? Pin
Bryan Anslow9-Oct-01 3:35
Bryan Anslow9-Oct-01 3:35 
QuestionAgain: Are there any methods to construct a CFtpConnection object from a HINTERNET handle? Pin
Chaos Lawful4-Oct-01 5:20
Chaos Lawful4-Oct-01 5:20 
AnswerRe: Again: Are there any methods to construct a CFtpConnection object from a HINTERNET handle? Pin
NormDroid4-Oct-01 6:58
professionalNormDroid4-Oct-01 6:58 
GeneralRe: Again: Are there any methods to construct a CFtpConnection object from a HINTERNET handle? Pin
Chaos Lawful4-Oct-01 8:04
Chaos Lawful4-Oct-01 8:04 
GeneralDeleting files in a program Pin
Paresh Solanki4-Oct-01 4:39
Paresh Solanki4-Oct-01 4:39 

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.