Call an COM Server dispinterface C++
-
Hi All, I have a little tricky question for you all. Maybe (I hope so) someone can help me with my problem. I work in Visual Studio 2005 with an C++ project. This project does not support ATL + MFC and it should not be changed, if it’s possible. Now I should call an function / get an information out of an COM (.exe) server that is still running. Below you can see the code that was created by the MIDL Compiler / by the OLE/COM Object Viewer from my test_programm.exe(COM server). In the code of the Test.idl file you can see the following: dispinterface ICWOLEEvents { properties: methods: [id(0x00000001)] void OnConfigurationApply([in, out] VARIANT_BOOL* pAccept); [id(0x00000002)] void OnShowMessageDlg( [in] IMsgDlg* pIMsg, [out, retval] VARIANT_BOOL* Result); }; The problem now I have is that I must call / work with the OnConfigurationApply and the OnShowMessageDlg functions in my C++ project. I’ve implemented the three (Test_h.h / Test_i.c / Test.idl) files in my project and I could recompile it without any error messages. Now my questions are: - How can I work with these two functions(OnConfigurationApply and the OnShowMessageDlg) in my C++ project? - Is there anywhere an simple/complete c++ example project? - Can someone explain me how I must start to work / get some information with these functions? I’ve posted a few weeks a similar question. But now after my holiday I will post this question a little bit more detailed again. Let me know if you need any more information about these files. MANY MANY thanks for any hints. Juergen Test_h.h
.
.
.
MIDL_INTERFACE("6775FB91-B5BE-11D6-A996-0050BA24C7B9")
ICWOLEEvents : public IDispatch
{
};
.
.
.Test_i.c //Created with the MIDL Compiler
.
.
.
MIDL_DEFINE_GUID(IID, IID_ICWOLE2,0xF560F761,0x2948,0x11D7,0xA9,0xBF,0x00,0x50,0xBA,0x24,0xC7,0xB9);
MIDL_DEFINE_GUID(CLSID, CLSID_CWOLEv2,0xF560F763,0x2948,0x11D7,0xA9,0xBF,0x00,0x50,0xBA,0x24,0xC7,0xB9);
.
.
.Test.idl // Generated .IDL file (by the OLE/COM Object Viewer) // // typelib filename: test_programm.exe
[
uuid(90B4344B-90CD-4527-BC00-4F4D45C793D6),
version(2.13),
helpstring("CW CWOLE")
]
library CW_CWOLE
{
// TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
importlib("stdole2.tlb");// Forward declare all types d
-
Hi All, I have a little tricky question for you all. Maybe (I hope so) someone can help me with my problem. I work in Visual Studio 2005 with an C++ project. This project does not support ATL + MFC and it should not be changed, if it’s possible. Now I should call an function / get an information out of an COM (.exe) server that is still running. Below you can see the code that was created by the MIDL Compiler / by the OLE/COM Object Viewer from my test_programm.exe(COM server). In the code of the Test.idl file you can see the following: dispinterface ICWOLEEvents { properties: methods: [id(0x00000001)] void OnConfigurationApply([in, out] VARIANT_BOOL* pAccept); [id(0x00000002)] void OnShowMessageDlg( [in] IMsgDlg* pIMsg, [out, retval] VARIANT_BOOL* Result); }; The problem now I have is that I must call / work with the OnConfigurationApply and the OnShowMessageDlg functions in my C++ project. I’ve implemented the three (Test_h.h / Test_i.c / Test.idl) files in my project and I could recompile it without any error messages. Now my questions are: - How can I work with these two functions(OnConfigurationApply and the OnShowMessageDlg) in my C++ project? - Is there anywhere an simple/complete c++ example project? - Can someone explain me how I must start to work / get some information with these functions? I’ve posted a few weeks a similar question. But now after my holiday I will post this question a little bit more detailed again. Let me know if you need any more information about these files. MANY MANY thanks for any hints. Juergen Test_h.h
.
.
.
MIDL_INTERFACE("6775FB91-B5BE-11D6-A996-0050BA24C7B9")
ICWOLEEvents : public IDispatch
{
};
.
.
.Test_i.c //Created with the MIDL Compiler
.
.
.
MIDL_DEFINE_GUID(IID, IID_ICWOLE2,0xF560F761,0x2948,0x11D7,0xA9,0xBF,0x00,0x50,0xBA,0x24,0xC7,0xB9);
MIDL_DEFINE_GUID(CLSID, CLSID_CWOLEv2,0xF560F763,0x2948,0x11D7,0xA9,0xBF,0x00,0x50,0xBA,0x24,0xC7,0xB9);
.
.
.Test.idl // Generated .IDL file (by the OLE/COM Object Viewer) // // typelib filename: test_programm.exe
[
uuid(90B4344B-90CD-4527-BC00-4F4D45C793D6),
version(2.13),
helpstring("CW CWOLE")
]
library CW_CWOLE
{
// TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
importlib("stdole2.tlb");// Forward declare all types d
Is nobody out there who can help me? A link to a complete tutorial or anything else?
-
Hi All, I have a little tricky question for you all. Maybe (I hope so) someone can help me with my problem. I work in Visual Studio 2005 with an C++ project. This project does not support ATL + MFC and it should not be changed, if it’s possible. Now I should call an function / get an information out of an COM (.exe) server that is still running. Below you can see the code that was created by the MIDL Compiler / by the OLE/COM Object Viewer from my test_programm.exe(COM server). In the code of the Test.idl file you can see the following: dispinterface ICWOLEEvents { properties: methods: [id(0x00000001)] void OnConfigurationApply([in, out] VARIANT_BOOL* pAccept); [id(0x00000002)] void OnShowMessageDlg( [in] IMsgDlg* pIMsg, [out, retval] VARIANT_BOOL* Result); }; The problem now I have is that I must call / work with the OnConfigurationApply and the OnShowMessageDlg functions in my C++ project. I’ve implemented the three (Test_h.h / Test_i.c / Test.idl) files in my project and I could recompile it without any error messages. Now my questions are: - How can I work with these two functions(OnConfigurationApply and the OnShowMessageDlg) in my C++ project? - Is there anywhere an simple/complete c++ example project? - Can someone explain me how I must start to work / get some information with these functions? I’ve posted a few weeks a similar question. But now after my holiday I will post this question a little bit more detailed again. Let me know if you need any more information about these files. MANY MANY thanks for any hints. Juergen Test_h.h
.
.
.
MIDL_INTERFACE("6775FB91-B5BE-11D6-A996-0050BA24C7B9")
ICWOLEEvents : public IDispatch
{
};
.
.
.Test_i.c //Created with the MIDL Compiler
.
.
.
MIDL_DEFINE_GUID(IID, IID_ICWOLE2,0xF560F761,0x2948,0x11D7,0xA9,0xBF,0x00,0x50,0xBA,0x24,0xC7,0xB9);
MIDL_DEFINE_GUID(CLSID, CLSID_CWOLEv2,0xF560F763,0x2948,0x11D7,0xA9,0xBF,0x00,0x50,0xBA,0x24,0xC7,0xB9);
.
.
.Test.idl // Generated .IDL file (by the OLE/COM Object Viewer) // // typelib filename: test_programm.exe
[
uuid(90B4344B-90CD-4527-BC00-4F4D45C793D6),
version(2.13),
helpstring("CW CWOLE")
]
library CW_CWOLE
{
// TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
importlib("stdole2.tlb");// Forward declare all types d
To implement a connection point handler (for that is what you need to do), you need to implement a COM object that can receive those events. This CodeProject article[^] seems to explain it quite nicely without using ATL or MFC.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p