Using CObject in managed code
Hi All,
I facing a problem in using CObject in managed code(.NET)
As CObject is a base clall in MFC. There is a requirement for me to pass the CObject as a parameter for the function written in maganed code (.NET).Please provide some example links ans also provide the explanation.
Thanks in advance,
Siddireddy
This has little to do with .NET setup.
If you need to pass a CObject from managed code you must do it in several steps. You need to instantiate the CObject in unmanaged code and pass its reference to the managed code that then can pass it on to a the unmanaged API that requires it.
If you have a managed object that you want to pass off as a unmanaged object you should use marshalling to copy the data between managed and unmanaged scope. There is no shortcut between managed code and the CObject.