Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Unable to Invoke .net Com method when running it in framework4.0.

$
0
0
                                               

SetupController m_comSetup = new SetupController();

ReturnValue ret = m_comSetup.OpenScript(null, null, null, m_comData);

OR

Type objType = m_comSetup.GetType();
ReturnValue ret = (KfxReturnValue)objType.GetType().InvokeMember("OpenScript", System.Reflection.BindingFlags.InvokeMethod, null, m_comSetup, data);

Both the above code snipets works fine in 3.5 framework but in framework 4.0 they fail. The 'openscript' is a c++ method(calling via interop) & on tracing looks like GetTypeFromProgID is not returning correct object due to that InvokeMember always returns -3.

Some blogs say it could be a bug in framework, but coudnt find any fix or alternatives..

Anyone has any solution or suggestion for this issue? Pl help



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>