2010-10-13 113 views
0

我包含对编码的第三方引用。但是,当我使用它时,我的编码会显示错误。在非托管中使用托管类对象

我的代码:在TagInfo.h

ref class Globals 
{ 
public: 
    static DUAL_INOUTLib::DualInOut^ objVM; 
}; 

进出口使用它在我的编码为在TagInfo.cpp

void CTagController :: ReceiveLivePoints() 
{ 
     float PV,SV,MV,P,I,D;    

    CString name = GetTagName(); 
    System::String^ TgName = gcnew String(name); 
    double ds; 
    **Globals::objVM = gcnew DUAL_INOUTLib::DualInOut; 
    Globals::objVM->Open_InOut("ShareMemory", "FRACT", p); 
    Globals::objVM->Get_real(p, TgName, _T("PV"), ds);** 

    PV = float(ds); 
} 

但它显示了行全局错误:: objVM = gcnew DUAL_INOUTLib :: DualInOut as

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in FOPStation.exe Additional information: Retrieving the COM class factory for component with CLSID {52762B50-F702-11D2-9EB1-00C04F888C49} failed due to the following error: 8001010d.

TagInfo.cpp包含更多类像,CTagbase,CTagController,CTagIndicator等等,...我想在每个类中使用此DualInOut来获取值

回答

0

您应该尝试了解有关该错误的更多信息。你可以谷歌错误代码,这与this thread,也许这有助于?