how to use irrlicht for mfc picture box??

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.
Post Reply
go
Posts: 28
Joined: Mon Oct 20, 2008 7:53 am

how to use irrlicht for mfc picture box??

Post by go »

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 »

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));
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
go
Posts: 28
Joined: Mon Oct 20, 2008 7:53 am

Post by go »

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 »

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 »

add a member variable for the picturebox and then do pictureboxclass->GetSafeHwnd()
Image
go
Posts: 28
Joined: Mon Oct 20, 2008 7:53 am

Post by go »

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 »

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 »

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);
Post Reply