Click here to Skip to main content
       

ATL / WTL / STL

 
QuestionIntermediate GUI Techniques Pinmemberbkelly132-Nov-12 3:21 
AnswerRe: Intermediate GUI Techniques PinmvpRichard MacCutchan2-Nov-12 6:20 
Questionproblem with sprintf_s() on win 7 PinmemberMember 93537761-Nov-12 21:34 
AnswerRe: problem with sprintf_s() on win 7 PinmvpRichard MacCutchan1-Nov-12 22:50 
GeneralRe: problem with sprintf_s() on win 7 Pinmemberbkelly132-Nov-12 3:16 
GeneralRe: problem with sprintf_s() on win 7 PinmvpRichard MacCutchan2-Nov-12 6:15 
GeneralRe: problem with sprintf_s() on win 7 PinmemberMember 93537764-Nov-12 16:34 
GeneralRe: problem with sprintf_s() on win 7 PinmvpRichard MacCutchan4-Nov-12 21:26 
AnswerRe: problem with sprintf_s() on win 7 PinmemberH.Brydon26-Nov-12 19:36 
Questionwsageterror() Pinmemberbkelly131-Nov-12 15:28 
AnswerRe: wsageterror() PinmvpRichard MacCutchan1-Nov-12 22:48 
QuestionSTL map issue in VS2010 PinmemberSubhash Madhukar30-Oct-12 3:47 
AnswerRe: STL map issue in VS2010 PinmvpRichard MacCutchan30-Oct-12 6:04 
Questionhow do i copy a CImage DIB to clipboard PinmemberMember 951640015-Oct-12 11:15 
im trying to copy a cimage dib to the clipboard. the second
memcpy fails with a read access violation. can anyone help?
 
CImage tmpImage = pDoc->m_imageArray[0];
     
    int w = tmpImage.GetWidth();
    int h = tmpImage.GetHeight();
    int Bpp = tmpImage.GetBPP();
     
    BITMAPINFOHEADER bmInfohdr;
    bmInfohdr.biSize = sizeof(BITMAPINFOHEADER);
    bmInfohdr.biWidth = w;
    bmInfohdr.biHeight = -h;
    bmInfohdr.biPlanes = 1;
    bmInfohdr.biBitCount = Bpp;
    bmInfohdr.biCompression = BI_RGB;
    bmInfohdr.biSizeImage = w*h*Bpp;
    bmInfohdr.biXPelsPerMeter = 0;
    bmInfohdr.biYPelsPerMeter = 0;
    bmInfohdr.biClrUsed = 0;
    bmInfohdr.biClrImportant = 0;
     
    BITMAPINFO bmInfo;
    bmInfo.bmiHeader = bmInfohdr;
    bmInfo.bmiColors[0].rgbBlue=255;
     
     
    void* pBits = tmpImage.GetBits();
    HANDLE hData = ::GlobalAlloc (GMEM_MOVEABLE, sizeof(BITMAPINFO) + w * h * 3);
    LPVOID pData = (LPVOID) ::GlobalLock (hData);
    LPBYTE p_imagebits;
    p_imagebits  = (LPBYTE)pData + sizeof(BITMAPINFO);
    
 
    memcpy(pData,&bmInfo,sizeof(BITMAPINFO));
     
           
    DWORD dwBytes = ((DWORD) w * Bpp) / 32;
    
    if(((DWORD) w * Bpp) % 32) {
       dwBytes++;
    }
    dwBytes *= 4;
   
    unsigned long m_dwSizeImage = dwBytes * h; // no compression
     
     
    memcpy (p_imagebits, pBits, m_dwSizeImage);
    
 
    ::GlobalUnlock (hData);
     
    COleDataSource* pods = new COleDataSource;
    pods->CacheGlobalData (CF_DIB, hData);
    pods->SetClipboard ();

AnswerRe: how do i copy a CImage DIB to clipboard PinmemberAndrew Cherednik15-Oct-12 11:41 
QuestionWhy does this fail - CFile / SeekToEnd? [modified] Pinmembercharlieg10-Oct-12 6:43 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pinmembercharlieg10-Oct-12 9:31 
AnswerRe: Why does this fail - CFile / SeekToEnd? PinmemberAndrew Cherednik10-Oct-12 11:23 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pinmembercharlieg11-Oct-12 2:20 
AnswerRe: Why does this fail - CFile / SeekToEnd? PinmvpRichard MacCutchan10-Oct-12 21:45 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pinmembercharlieg11-Oct-12 2:30 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pinmembercharlieg11-Oct-12 4:53 
GeneralRe: Why does this fail - CFile / SeekToEnd? PinmvpRichard MacCutchan11-Oct-12 11:19 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pinmembercharlieg11-Oct-12 11:34 
GeneralRe: Why does this fail - CFile / SeekToEnd? PinmvpRichard MacCutchan11-Oct-12 12:01 
GeneralRe: Why does this fail - CFile / SeekToEnd? Pinmembercharlieg12-Oct-12 5:54 
AnswerRe: Why does this fail - CFile / SeekToEnd? PinmemberStephen Hewitt11-Oct-12 12:58 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pinmembercharlieg18-Jan-13 1:47 
QuestionKeep program open and running PinmemberLucidation8-Oct-12 11:23 
AnswerRe: Keep program open and running PinmvpRichard MacCutchan8-Oct-12 22:14 
GeneralRe: Keep program open and running PinmemberLucidation9-Oct-12 11:14 
GeneralRe: Keep program open and running PinmvpRichard MacCutchan9-Oct-12 11:19 
AnswerRe: Keep program open and running PinmemberStephen Hewitt11-Oct-12 21:45 
QuestionUSBView Compile Error PinmemberJim Fell5-Oct-12 10:17 
AnswerRe: USBView Compile Error PinmemberWes Aday5-Oct-12 10:33 
GeneralRe: USBView Compile Error PinmemberJim Fell10-Oct-12 8:04 
QuestionFree memory allocated by std::multimap Pinmemberkhaliloenit4-Oct-12 2:41 
AnswerRe: Free memory allocated by std::multimap Pinmemberpasztorpisti6-Oct-12 15:26 
AnswerRe: Free memory allocated by std::multimap [modified] PinmemberStephen Hewitt11-Oct-12 21:53 
GeneralRe: Free memory allocated by std::multimap Pinmemberpasztorpisti11-Oct-12 22:53 
Questionhow to import COM interface methods in Win32 dll? Pinmemberlitu kumar30-Sep-12 19:58 
AnswerRe: how to import COM interface methods in Win32 dll? Pinmember«_Superman_»1-Oct-12 21:29 
GeneralOff topic PinmvpRichard MacCutchan2-Oct-12 2:55 
GeneralRe: Off topic Pinmember«_Superman_»2-Oct-12 3:00 
GeneralRe: Off topic PinmvpRichard MacCutchan2-Oct-12 3:23 
QuestionTooltip for ATL toolbar PinmemberSakhalean24-Sep-12 18:43 
QuestionCAsyncSocket Send( arguments ) [modified] Pinmemberbkelly1318-Sep-12 16:13 
AnswerRe: CAsyncSocket Send( arguments ) PinmvpRichard MacCutchan18-Sep-12 21:50 
GeneralRe: CAsyncSocket Send( arguments ) Pinmemberbkelly1319-Sep-12 12:13 
AnswerRe: CAsyncSocket Send( arguments ) Pinmemberpasztorpisti29-Sep-12 23:52 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 9 Apr 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid