COM Interface -> C++ wrapper utility ?
-
Hi all, I want to find an utility that do something like that: Takes TLB (or whatever) and generates C++ wrapper classes for use these COM interfaces/objects. With ATL it could looking like: IDL: interface ITest { HRESULT GetName([out,retval] BSTR *bstrName); HRESULT DoSmth([in] BSTR str); } C++ (ATL) Wrapper: class CTest : public CComPtr { public: CString getName() { CComBSTR bstr; HRESULT hr = p->GetName(&bstr); if (FAILED(hr)) throw hr; return CString(bstr); } HRESULT doSmth(LPCTSTR str) { return p->DoSmth(CComBSTR(str)); } } Such wrappers allows to program COM in C++ much easier, almost like in VB, at the same time preserving all C++ power. Does anyone knows something similar ? Thanks in advance, vips
-
Hi all, I want to find an utility that do something like that: Takes TLB (or whatever) and generates C++ wrapper classes for use these COM interfaces/objects. With ATL it could looking like: IDL: interface ITest { HRESULT GetName([out,retval] BSTR *bstrName); HRESULT DoSmth([in] BSTR str); } C++ (ATL) Wrapper: class CTest : public CComPtr { public: CString getName() { CComBSTR bstr; HRESULT hr = p->GetName(&bstr); if (FAILED(hr)) throw hr; return CString(bstr); } HRESULT doSmth(LPCTSTR str) { return p->DoSmth(CComBSTR(str)); } } Such wrappers allows to program COM in C++ much easier, almost like in VB, at the same time preserving all C++ power. Does anyone knows something similar ? Thanks in advance, vips
The #import directive already does this for you automatically.
Ian Mariano - http://www.ian-space.com/
"We are all wave equations in the information matrix of the universe" - me -
The #import directive already does this for you automatically.
Ian Mariano - http://www.ian-space.com/
"We are all wave equations in the information matrix of the universe" - me