• Welcome to Valhalla Legends Archive.
 

C++ 6 and C# window controls

Started by iNsaNe, April 12, 2009, 11:35 PM

Previous topic - Next topic

iNsaNe

I've been messing around with mixing unmanaged and managed code recently. I was wondering is it possible to affect a window control in C# through unmanaged code just by passing the control handle?

For example, i'm reading through a file in C++ and I have a progress bar I created in C#. I passed the window handle of the progress bar (ProgressBar.Handle) into C++ and tried using SendMessage to show the progress bar stepping but no luck.

iNsaNe

#1
Nevermind, I solved it and it was really simple. I had to make a delegate function to setting the value of the progress bar and giving it an UnmanagedFunctionPointerAttribute and then had to pass it to C++.