0
我遇到了一个奇怪的问题。C#Ctor不能新Com Com对象?
Public Class MyClass
{
Public MyClass()
{
// Some time the New Com Obj code will crush in Construcor
su.SUEvent += new _IaSystemMgrEvents_SuEventEventHandler(su_SuEvent);
su.SUEventSteps += new _IaSystemMgrEvents_SuEventIemsEventHandler(su_SuEventSteps);
su.SetHBCOMAddr();}
public void Init()
{
// If i inserted the three lines code to Init() fun, it worked very well.
su.SUEvent += new _IaSystemMgrEvents_SuEventEventHandler(su_SuEvent);
su.SUEventSteps += new _IaSystemMgrEvents_SuEventIemsEventHandler>(su_SuEventSteps);
su.SetHBCOMAddr();
}
}
素是从C++ 一个lib文件,为什么我不能在C#中创造的COM的OBJ的构造。