Click here to Skip to main content
14,606,525 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100