Managed/Unmanaged .Net C++ CLR example
Budget: £40 – £70 GBP
I need someone to write a simple (ie as simple as possible) example .Net C# WinForms app, together with a managed C++ CLR dll and and unmanaged C++ dll.
The unmanaged C++ dll must be completely separate from the managed dll and .Net environment so that it can be run from a normal C++ console app (you should provide the console app too to show that the solution works without .Net).
The unmanaged dll just needs to have one function that starts a background thread which calls a callback every second. The callback can simply pass an integer value that is incremented each time the callback is called. I expect it will be necessary for the unmanaged function to accept a callback pointer so that the background thread knows what to call.
The managed dll will need to expose the same functionality to the .Net C# Winforms app and it must use the unmanaged C++ dll. I believe this will involve having a delegate in the managed C++ dll that is used in the WinForms app to accept the callback.
So when the unmanaged dll calls the callback, the managed dll needs to raise an equivalent callback to the C# app, passing the integer value up to the C# environment.
The C# app doesn't need to do anything with the integer value - it can just receive it, but it must be possible get the delegate to communicate with the main thread so that the integer value can be used to update a control. Maybe this could be demonstrated by just updating a simple TextBox on the WinForm app's main form.
The WinForm app just needs to have a single form with a button and a TextBox. The button will be used to call into the managed dll to start the background thread and the TextBox used, as described, to receive the integer value raised by the unmanaged dll.
Please note that I have quoted this project at 50GBP, and it should only be attempted by someone who is experienced with raising callbacks from unmanaged dlls to the .Net environment, to save time researching how this is done. If you don't know how to do this, then please do not apply.
For the right person who can definitely provide this solution, I am happy to negotiate on the price if you feel the time it will take is more than, say, an hour of your time.
The unmanaged C++ dll must be completely separate from the managed dll and .Net environment so that it can be run from a normal C++ console app (you should provide the console app too to show that the solution works without .Net).
The unmanaged dll just needs to have one function that starts a background thread which calls a callback every second. The callback can simply pass an integer value that is incremented each time the callback is called. I expect it will be necessary for the unmanaged function to accept a callback pointer so that the background thread knows what to call.
The managed dll will need to expose the same functionality to the .Net C# Winforms app and it must use the unmanaged C++ dll. I believe this will involve having a delegate in the managed C++ dll that is used in the WinForms app to accept the callback.
So when the unmanaged dll calls the callback, the managed dll needs to raise an equivalent callback to the C# app, passing the integer value up to the C# environment.
The C# app doesn't need to do anything with the integer value - it can just receive it, but it must be possible get the delegate to communicate with the main thread so that the integer value can be used to update a control. Maybe this could be demonstrated by just updating a simple TextBox on the WinForm app's main form.
The WinForm app just needs to have a single form with a button and a TextBox. The button will be used to call into the managed dll to start the background thread and the TextBox used, as described, to receive the integer value raised by the unmanaged dll.
Please note that I have quoted this project at 50GBP, and it should only be attempted by someone who is experienced with raising callbacks from unmanaged dlls to the .Net environment, to save time researching how this is done. If you don't know how to do this, then please do not apply.
For the right person who can definitely provide this solution, I am happy to negotiate on the price if you feel the time it will take is more than, say, an hour of your time.