Click here to Skip to main content
15,919,341 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unhandled exception when using acmFormatChoose. Pin
Bill Wilson14-Aug-02 9:04
Bill Wilson14-Aug-02 9:04 
GeneralRe: Unhandled exception when using acmFormatChoose. Pin
Daniel Lohmann14-Aug-02 14:02
Daniel Lohmann14-Aug-02 14:02 
Generaldoc/view problem -> destroying a window Pin
Anonymous14-Aug-02 7:00
Anonymous14-Aug-02 7:00 
GeneralRe: doc/view problem -> destroying a window Pin
Chris Losinger14-Aug-02 8:04
professionalChris Losinger14-Aug-02 8:04 
Questionopen a Document with invisible View? Pin
Jake Palmer14-Aug-02 6:54
Jake Palmer14-Aug-02 6:54 
AnswerRe: open a Document with invisible View? Pin
dazinith14-Aug-02 7:59
dazinith14-Aug-02 7:59 
AnswerClarification Pin
Jake Palmer14-Aug-02 9:54
Jake Palmer14-Aug-02 9:54 
GeneralImage field 3 Pin
Mazdak14-Aug-02 6:53
Mazdak14-Aug-02 6:53 
I have two problem here.I read image field from database and want to show it on my formview.I use this code:

COleVariant var;
var.vt = VT_UI1;
var = field.GetChunk(field.GetActualSize());

BITMAPINFO bmInfo;
memset(&bmInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
bmInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
bmInfo.bmiHeader.biWidth=120;
bmInfo.bmiHeader.biHeight=120;
bmInfo.bmiHeader.biPlanes=1;
bmInfo.bmiHeader.biBitCount=24;
//create a temporary dc in memory.
HDC pDC = ::GetDC(0);
HDC TmpDC= CreateCompatibleDC(pDC);
//create a new bitmap and select it in the memory dc
HBITMAP TmpBmp=CreateDIBSection(pDC,&bmInfo,DIB_RGB_COLORS,(void**)&var,0,0);
HGDIOBJ TmpObj=SelectObject(TmpDC,TmpBmp);

CRect rect;
GetClientRect(&rect);
int nX = rect.left + (rect.Width() )  / 3;
int nY = rect.top  + (rect.Height() + 500 ) / 2 ;

BitBlt( pDC, nX, nY , 200, 200 ,    TmpDC , 0 , 0 , SRCCOPY );


Only black rectangle appear on my form.I don't know if the problem from reading data from database or my setting for bitmap has some problem.Those who know bitmaps can tell me if it has correct setting.

My second problem is that I can't put bitmap in correct place.It goes out of the application.How can I manage it correctly?

Mazy

"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"
Kryptonite-3 Doors Down

GeneralCFindReplaceDialog Pin
RK_200014-Aug-02 6:37
RK_200014-Aug-02 6:37 
GeneralTFTP and RS232 Communications Pin
SanShou14-Aug-02 5:54
SanShou14-Aug-02 5:54 
GeneralRe: TFTP and RS232 Communications Pin
Stuart Dootson14-Aug-02 20:57
professionalStuart Dootson14-Aug-02 20:57 
GeneralContext menu in CHtmlView question. Pin
Michael Liu14-Aug-02 5:37
Michael Liu14-Aug-02 5:37 
GeneralRe: Context menu in CHtmlView question. Pin
Anonymous14-Aug-02 6:10
Anonymous14-Aug-02 6:10 
GeneralRe: Context menu in CHtmlView question. Pin
Michael Liu14-Aug-02 6:35
Michael Liu14-Aug-02 6:35 
QuestionPressed Enter ? Pin
Hadi Rezaee14-Aug-02 5:09
Hadi Rezaee14-Aug-02 5:09 
AnswerRe: Pressed Enter ? Pin
Andreas Saurwein14-Aug-02 5:40
Andreas Saurwein14-Aug-02 5:40 
AnswerRe: Pressed Enter ? Pin
KingsGambit14-Aug-02 5:50
KingsGambit14-Aug-02 5:50 
QuestionListen a port using CSocket class ?? Pin
Cris14-Aug-02 4:52
Cris14-Aug-02 4:52 
AnswerRe: Listen a port using CSocket class ?? Pin
User 665814-Aug-02 5:39
User 665814-Aug-02 5:39 
GeneralRe: Listen a port using CSocket class ?? Pin
Cris14-Aug-02 7:21
Cris14-Aug-02 7:21 
GeneralRe: Listen a port using CSocket class ?? Pin
User 665814-Aug-02 7:50
User 665814-Aug-02 7:50 
GeneralRe: Listen a port using CSocket class ?? Pin
Cris14-Aug-02 9:20
Cris14-Aug-02 9:20 
GeneralRe: Listen a port using CSocket class ?? Pin
User 665814-Aug-02 9:46
User 665814-Aug-02 9:46 
GeneralRe: Listen a port using CSocket class ?? Pin
Cris14-Aug-02 10:21
Cris14-Aug-02 10:21 
QuestionListbox, how to make only full items visible? Pin
Anonymous14-Aug-02 4:21
Anonymous14-Aug-02 4:21 

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.