If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
go
Posts: 28 Joined: Mon Oct 20, 2008 7:53 am
Post
by go » Thu Oct 30, 2008 6:28 am
hi I'm now using mfc for gui. but I can't pict irrlicht for mfc picturebox.
I can use irrlicht in m_hwnd like this.
Code: Select all
param.WindowId = reinterpret_cast<void*>(this->GetSafeHwnd());
but I can't in this code
Code: Select all
param.WindowId = reinterpret_cast<void*>(GetDlgItem(IDC_PICTURE));
I can do it for windows forms and win32 form, so I think it can do for mfc
do you know how to use this??
thanks
Acki
Posts: 3496 Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:
Post
by Acki » Thu Oct 30, 2008 9:41 am
you should be able to use any widget you get an handle (hwnd) of...
just a gues though, but MSDN says this:
HWND GetDlgItem(
HWND hDlg, // handle of dialog box
int nIDDlgItem // identifier of control
);
so maybe try this:
Code: Select all
param.WindowId = reinterpret_cast<void*>(GetDlgItem(this->GetSafeHwnd(), IDC_PICTURE));
go
Posts: 28 Joined: Mon Oct 20, 2008 7:53 am
Post
by go » Thu Oct 30, 2008 4:59 pm
thank you very much!!! and your fast reply!!!!!
i will try it !!
go
Posts: 28 Joined: Mon Oct 20, 2008 7:53 am
Post
by go » Thu Oct 30, 2008 6:04 pm
thanks, but i can't
GetDlgItem is
Code: Select all
CWnd* GetDlgItem(
int nID
) const;
void GetDlgItem(
int nID,
HWND* phWnd
) const;
hmm..
Lambda
Posts: 126 Joined: Wed Feb 27, 2008 3:00 pm
Location: Spain, Huelva
Contact:
Post
by Lambda » Thu Oct 30, 2008 6:30 pm
add a member variable for the picturebox and then do pictureboxclass->GetSafeHwnd()
go
Posts: 28 Joined: Mon Oct 20, 2008 7:53 am
Post
by go » Thu Oct 30, 2008 6:39 pm
thanks I can do it for under code !!
Code: Select all
HWND aho;
CWnd *tako;
tako = this->GetDlgItem(IDC_PICTURE);
aho = tako->GetSafeHwnd();
//param.WindowId = reinterpret_cast<void*>(aho);
Hwnd ⇔ CWnd* relation is very important.
and I found if i do not relate to Windows HWND to irrlicht. irrlicht application began standalone when i clicked!!
Johan
Posts: 32 Joined: Thu Jun 12, 2008 7:51 pm
Location: south africa
Post
by Johan » Mon Nov 03, 2008 8:23 pm
Hi ,1st sory if i take up space by replyin to something already dealt with.. cant remember if this works with picture control but will with button control ,ones you have a button placed on you dialog simply go to the classwizard and assign a member value to it as type control.now you can acces it easy with code by the name you named it and have easy acces to its members like this mybuttoncontrol->hwnd.way easier for me by the way..
compulsive compiler
go
Posts: 28 Joined: Mon Oct 20, 2008 7:53 am
Post
by go » Mon Nov 17, 2008 10:46 am
and the sample code related to this source is like this. and you may use it
Code: Select all
tako = this->GetDlgItem(IDC_PICTURE);
aho = tako->GetSafeHwnd();
param.WindowId = reinterpret_cast<void*>(aho);