Click here to Skip to main content
11,485,334 members (76,624 online)

C / C++ / MFC

 
QuestionDhcpRequestParams() Pin
Man in the mirror13-Jan-13 20:46
memberMan in the mirror13-Jan-13 20:46 
AnswerRe: DhcpRequestParams() Pin
Richard MacCutchan13-Jan-13 23:11
mvpRichard MacCutchan13-Jan-13 23:11 
QuestionSOLVED From HANDLE to BITMAPINFO - another basic question for gurus [modified] Pin
Vaclav_Sal13-Jan-13 6:30
memberVaclav_Sal13-Jan-13 6:30 
AnswerRe: From HANDLE to BITMAPINFO - another basic question for gurus Pin
Richard MacCutchan13-Jan-13 6:44
mvpRichard MacCutchan13-Jan-13 6:44 
// a DIB is in the clipboard, draw it out
GLOBALHANDLE      hGMem ;    // create a global handle
LPBITMAPINFO      lpBI ;     // a pointer to the resultant bitmap
void*             pDIBBits;  // a pointer to the contents of the bitmap

OpenClipboard() ;                   // open the clipboard
hGMem = GetClipboardData(CF_DIB) ;  // get a handle (pointer) to the data in the clipboard
ASSERT(hGMem);                      // make sure it is valid
TRACE("\nfills LPBITMAPINFO"); 
lpBI = (LPBITMAPINFO)GlobalLock(hGMem) ; // lock that memory block and return a pointer to the DIB
At this point you can copy the memory block pointed to by lpBI into your program's address space and process it as required. You should then unlock and release hGMem (which is a system resource), and release the clipboard so other applications can use it.
One of these days I'm going to think of a really clever signature.

GeneralRe: From HANDLE to BITMAPINFO - another basic question for gurus Pin
Vaclav_Sal13-Jan-13 7:08
memberVaclav_Sal13-Jan-13 7:08 
GeneralRe: From HANDLE to BITMAPINFO - another basic question for gurus Pin
Richard MacCutchan13-Jan-13 7:32
mvpRichard MacCutchan13-Jan-13 7:32 
QuestionHow to get detail error info from E_FAIL? Pin
Falconapollo11-Jan-13 22:23
memberFalconapollo11-Jan-13 22:23 
AnswerRe: How to get detail error info from E_FAIL? Pin
«_Superman_»12-Jan-13 0:43
member«_Superman_»12-Jan-13 0:43 
GeneralRe: How to get detail error info from E_FAIL? Pin
Falconapollo12-Jan-13 1:00
memberFalconapollo12-Jan-13 1:00 
GeneralRe: How to get detail error info from E_FAIL? Pin
Jochen Arndt13-Jan-13 22:05
memberJochen Arndt13-Jan-13 22:05 

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
Web04 | 2.8.150520.1 | Last Updated 25 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid