简体   繁体   English

在Java窗口中嵌入c ++ opengl窗口

[英]Embed c++ opengl window in Java window

i am trying to embed a c++ opengl window in a java window. 我试图在Java窗口中嵌入c ++ opengl窗口。 I'm able to send the HWND of the opengl window to the java window through sockets. 我可以通过套接字将opengl窗口的HWND发送到Java窗口。 I'd rather not use JNI for it as i want to have 2 seperate process (the why doesn't matter). 我宁愿不使用JNI,因为我想使用2个独立的进程(为什么没关系)。 I made my search and found out this could be possible by using User32's function SetParent(HWND childWindow, HWND parentWindow). 我进行了搜索,发现可以通过使用User32的函数SetParent(HWND childWindow,HWND parentWindow)来实现。 However, i'm unable to use it properly or can't find the steps to use User32. 但是,我无法正确使用它,或者找不到使用User32的步骤。 So this might be an issue related to Embed HWND (Window Handle) in a JPanel which is quite what i want to do but i wasn't able to reproduce the solution as i wasn't able to use User32 (cannot be resolved) even if i made the following imports : import com.sun.jna.Library; 因此,这可能是与在JPanel中嵌入HWND(窗口句柄)有关的一个问题,这正是我想要做的,但是由于无法使用User32(无法解决),所以我无法重现该解决方案。如果我进行了以下导入:import com.sun.jna.Library; import com.sun.jna.Native; 导入com.sun.jna.Native; import com.sun.jna.Platform; 导入com.sun.jna.Platform; import com.sun.jna.Pointer; 导入com.sun.jna.Pointer;

I was also unable to use WComponentPeer but i haven't done much search on the subject. 我也无法使用WComponentPeer,但是我没有对此主题进行过多搜索。

Thanks in advance 提前致谢

You need the User32 interface mapping from JNA's platform.jar. 您需要JNA的platform.jar中的User32接口映射。

See these notes for getting started. 请参阅这些说明以开始使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM