8.1.5.3 Function Load COM Object


   8.1.5.3 Function _load_COM_Obj


_load_COM_OBJ is a sample function that shows how to work with the LZNV SDK COM Object


int32_t LZNV_SDK_COM_Obj_MFC_App_Client_Dlg::_load_COM_Obj()

{

    CoInitialize(NULL);


    HRESULT hr = pLZNV_COM_Object_obj.CreateInstance(L"LZNV.SDK.COM.Obj");

   

    ASSERT(SUCCEEDED(hr));


    if (!pLZNV_COM_Object_obj)

    {

        MessageBox(L"COM Object registered? LZNV.COM.Object interface not found!", L"Error! Interface not found! ", MB_OK);

        return 1;

    }


    m_stStaticLZNV_DLL_Load_Status.SetWindowText(L"LZNV.COM.Object Found. Interface created!");


    return 0;

}