开发者

Using Managed class objects in Unmanaged

开发者 https://www.devze.com 2023-01-19 15:31 出处:网络
I\'m including one thirdparty reference to my coding.But when i use it my coding it shows error. My code:InTagInfo.h

I'm including one thirdparty reference to my coding.But when i use it my coding it shows error.

My code: In TagInfo.h

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

Im using it in my coding as In TagInfo.cpp

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

    CString name = GetTagName();
    System::String^ Tg开发者_开发问答Name  = 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);
}

But it shows error in line Globals::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 contains more class like, CTagbase,CTagController,CTagIndicator etc.,...I want to use this DualInOut in every class to get values


You should try to find out more about the error. You can google the error code, which comes up with this thread, maybe that helps?

0

精彩评论

暂无评论...
验证码 换一张
取 消