Click here to Skip to main content
15,886,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on a c++ mfc application which requires to open a c# form, where c# form should be the child of the c++ application. I passed the parent handle to the c# application.

What I have tried:

I tried to set the handle as parent using SetParent()(win32).The response is success but the c# form got embedded to the parent c++ application window. And also I cant access the form, where it look like it got freezed.

I appreciate any advice.
Posted
Updated 29-May-20 3:51am
v2
Comments
Richard MacCutchan 29-May-20 9:23am    
Given the different architecture of these two systems, it is unlikely you will get it to work. What problem are you actually trying to solve, and why does it need the C# form to be a child of the C++ Window?

1 solution

Quote:
I tried to set the handle as parent using SetParent()(win32).The response is success but the c# form got embedded to the parent c++ application window.

Yeah, SetParent is going to move the form to the container control you're setting it to. That's what SetParent does.

It seems you're trying to do something different from that, like setting your window as the OWNER of the C# form, perhaps? Owner and Parent are two different concepts.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900