📄 com_testclass_com.cpp
字号:
#include "com_testclass_com.hpp"
#ifdef __cplusplus
extern "C" {
#endif
extern const unsigned char __MCC_com_test_public_data[];
extern const char *__MCC_com_test_name_data;
extern const char *__MCC_com_test_root_data;
extern const unsigned char __MCC_com_test_session_data[];
extern const char *__MCC_com_test_matlabpath_data[];
extern const int __MCC_com_test_matlabpath_data_count;
extern const char *__MCC_com_test_mcr_runtime_options[];
extern const int __MCC_com_test_mcr_runtime_option_count;
extern const char *__MCC_com_test_mcr_application_options[];
extern const int __MCC_com_test_mcr_application_option_count;
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
static void mlxEvent_test_event(int nlhs, mxArray *plhs[],
int nrhs, mxArray *prhs[])
{
g_EventMap.invokeA(mclGetActiveID(), "event_test", nrhs, prhs);
}
#ifdef __cplusplus
}
#endif
Ccom_testclass::Ccom_testclass()
{
if (!mclInitializeComponentInstance(&m_hinst, __MCC_com_test_public_data,
__MCC_com_test_name_data,
__MCC_com_test_root_data,
__MCC_com_test_session_data,
__MCC_com_test_matlabpath_data,
__MCC_com_test_matlabpath_data_count,
__MCC_com_test_mcr_runtime_options,
__MCC_com_test_mcr_runtime_option_count,
true, COMObject, LibTarget,
g_Module.getPath(), NULL, NULL))
Error("Could not create MCR instance");
if (!mclRegisterExternalFunction(m_hinst, "event_event_test_2e010447", mlxEvent_test_event))
Error("Error registering event functions");
RegisterListener();
}
Ccom_testclass::~Ccom_testclass()
{
UnregisterListener();
if (m_hinst)
mclTerminateInstance(&m_hinst);
}
HRESULT __stdcall Ccom_testclass::plot_test() {
return( CallComFcn( "plot_test", 0, 0, 0 ) );
}
HRESULT __stdcall Ccom_testclass::property_test(/* [in] */ long nargout,
/* [in,out] */ VARIANT* result) {
return( CallComFcn( "property_test", (int) nargout, 1, 0, result ) );
}
HRESULT __stdcall Ccom_testclass::get_A(/* [out, retval] */ VARIANT* A) {
return( GetProperty( "A", A ) );
}
HRESULT __stdcall Ccom_testclass::put_A(/* [in] */ VARIANT A) {
return( PutProperty( "A", &A ) );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -