Click here to Skip to main content
15,912,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Making Combobox items visible? Pin
Abin20-Aug-03 14:04
Abin20-Aug-03 14:04 
QuestionCTreeCtrl Checkbox notification? Pin
Bob Stanneveld20-Aug-03 9:43
Bob Stanneveld20-Aug-03 9:43 
AnswerRe: CTreeCtrl Checkbox notification? Pin
peterchen20-Aug-03 10:39
peterchen20-Aug-03 10:39 
GeneralRe: CTreeCtrl Checkbox notification? Pin
Bob Stanneveld20-Aug-03 12:17
Bob Stanneveld20-Aug-03 12:17 
GeneralBitmap::FromResource Pin
arturapps20-Aug-03 9:37
arturapps20-Aug-03 9:37 
GeneralSorry people ... Pin
arturapps20-Aug-03 9:41
arturapps20-Aug-03 9:41 
GeneralRe: Sorry people ... Pin
PJ Arends20-Aug-03 16:40
professionalPJ Arends20-Aug-03 16:40 
GeneralRe: Sorry people ... Pin
arturapps21-Aug-03 2:44
arturapps21-Aug-03 2:44 
Hi PJ Arends ...Smile | :)

Yes I´m sure that it is loading a bitmap (At last it returns a non zero value). BOTAO is a integer that was defined in resource.h , so I´m a bit confuse because the documentation says:
=============================================================================
static Bitmap* FromResource(
HINSTANCE hInstance,
const WCHAR* bitmapName
);
Parameters
bitmapName
[in] Pointer to a null-terminated string that specifies the path name of the bitmap resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. You can use the MAKEINTRESOURCE macro to create this value.
=============================================================================
I´ve tried to pass the parameter as a string . Haven´t I?

I re wrote the code using a local variable for instance, and I used AfxGetInstanceHandle() . But the window is still clear...:D'Oh! | :doh:



void CBitmapsView::OnPaint()
{
CPaintDC dc(this); // device context for painting
HINSTANCE instance;
Graphics graphics(dc);
Bitmap *Bitmap_Res;
Bitmap_Res = NULL;
instance = NULL;
instance = AfxGetInstanceHandle() ;
if(instance==NULL)
{
MessageBox("instance=NULL","Error",MB_OK);
return;
}

Bitmap_Res = Bitmap::FromResource(instance,L"BOTAO");
if(Bitmap_Res==NULL)
{
MessageBox("Bitmap_Res=NULL","Error",MB_OK);
}
else
{
graphics.DrawImage(Bitmap_Res, 100, 100);
}

}
GeneralRe: Sorry people ... Pin
PJ Arends21-Aug-03 4:47
professionalPJ Arends21-Aug-03 4:47 
GeneralHelp with storing pointers.. Pin
RobJones20-Aug-03 9:07
RobJones20-Aug-03 9:07 
GeneralRe: Help with storing pointers.. Pin
Neville Franks20-Aug-03 10:39
Neville Franks20-Aug-03 10:39 
GeneralRe: Help with storing pointers.. Pin
John R. Shaw20-Aug-03 12:19
John R. Shaw20-Aug-03 12:19 
GeneralRe: Help with storing pointers.. Pin
RobJones20-Aug-03 13:19
RobJones20-Aug-03 13:19 
GeneralRe: Help with storing pointers.. Pin
RobJones21-Aug-03 4:23
RobJones21-Aug-03 4:23 
GeneralRe: Help with storing pointers.. Pin
igor196020-Aug-03 20:42
igor196020-Aug-03 20:42 
GeneralDisabling WinLogo Key on the KeyBoard Pin
ZarrinPour20-Aug-03 7:55
ZarrinPour20-Aug-03 7:55 
GeneralRe: Disabling WinLogo Key on the KeyBoard Pin
David Crow20-Aug-03 9:07
David Crow20-Aug-03 9:07 
GeneralRe: Disabling WinLogo Key on the KeyBoard Pin
John M. Drescher20-Aug-03 17:56
John M. Drescher20-Aug-03 17:56 
QuestionHow can I do simultaneous scrolling of 2 wnd? Pin
Sonin Nickolay20-Aug-03 7:25
Sonin Nickolay20-Aug-03 7:25 
AnswerRe: How can I do simultaneous scrolling of 2 wnd? Pin
John R. Shaw20-Aug-03 7:41
John R. Shaw20-Aug-03 7:41 
GeneralRe: How can I do simultaneous scrolling of 2 wnd? Pin
Sonin Nickolay20-Aug-03 19:06
Sonin Nickolay20-Aug-03 19:06 
GeneralRe: How can I do simultaneous scrolling of 2 wnd? Pin
John R. Shaw21-Aug-03 7:25
John R. Shaw21-Aug-03 7:25 
Generaldirect access to interrupts Pin
manusha20-Aug-03 7:12
manusha20-Aug-03 7:12 
GeneralRe: direct access to interrupts Pin
David Crow20-Aug-03 7:54
David Crow20-Aug-03 7:54 
GeneralRe: direct access to interrupts Pin
Ryan Binns21-Aug-03 0:08
Ryan Binns21-Aug-03 0:08 

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.