code_junkie

Can someone explain the benefits of using a Primary Interop Assembly in .Net?

Nov 11th, 2011
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. object _comObject;
  2. Type _comObjectType;
  3. _comObjectType = Type.GetTypeFromProgID("MyCompany.MyApplication.MyObject", true);
  4. _comObject = Activator.CreateInstance(_comObjectType);
  5.  
  6. string name = (string)_comObjectType.InvokeMember("GetCustomerName", BindingFlags.InvokeMethod, null, _comObject, , new object [] { _customerId });
  7.  
  8. MyCompany.MyApplication.MyObject obj = new MyObject();
  9. string name = obj.GetCustomerName(_customerId);
Add Comment
Please, Sign In to add comment