Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create Win32 window by a jni code

843829Feb 14 2008 — edited Aug 6 2010
Hi,

In my project, I have a player which should be included in a window in order to be visible. I tried to insert this player in a Java Frame but this is not possible because jawt.dll cannot be used in a Windows mobile 6-based device.
Right now I want to take the other approach. I want to create a Win32 window and insert this player in that window.
I will use java only as a bridge and for back-end logic.

I tried to create a window with this method:
CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);

But it doesn't work.
I don't even know what is HINSTANCE hInstance. This is used as a parameteer in the WinMain method in a C++ win32 project. I read that I can use the value 0 for it. But even so it doesn't work.

After 5 years of even not looking at any piece of C++ code, this is a pain in the ... for me.

Can someone help me with a snippet showing me how can I create a window in jni-based c++ code?

I will be glad to hear any advice.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 3 2010
Added on Feb 14 2008
5 comments
484 views