简体   繁体   中英

How can I host a c# control in a win32 app?

I've developed ac# control, and I can reuse this in other c# apps and that works really well.

However I want to host this control in a Win32 c++ app, is there a way to do this?

I was wondering if it would work with managed c++, however I can't quite figure out if this is possible.

Any help would be gratefully received.

Cheers Rich

You can use the Com Interop Toolkit to solve this.

This is how I do it: I create my control in C# When I want to expose this control to another Win32 app, I expose this control via com. I create a new project using this com interop toolkit, create a new control, and put my C# version of my usercontrol on this new control.
Then, you should have a com-exposable version of that control. At least, that's in short how i do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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