Using ISyncMgrRegister
-
I'm trying to write my own customer SyncMgr component. I'm having some trouble loading up the ISyncMgrRegister object. I'm a little new to COM so I'm probably missing osmething obvious here. This is MC++ code. Can someone point me in the correct direction.
#include "stdafx.h" #include "mobsync.h" #using using namespace System; int _tmain() { HRESULT hr = CoInitialize(NULL); if ( FAILED(hr) ) { Console::WriteLine(S"Cannot Initilaize com"); goto error; } ISyncMgrRegister *reg = NULL; hr = CoCreateInstance( CLSID_SyncMgr, NULL, CLSCTX_LOCAL_SERVER, IID_ISyncMgrRegister, reinterpret_cast(reg)); if ( FAILED(hr) ) { Console::WriteLine(S"Could not create an instance of the Sync Mgr"); goto error; } reg->Release(); Console::WriteLine(S"Press Enter to Exit"); Console::ReadLine(); return 0; error: Console::WriteLine(S"Press enter to exit"); Console::ReadLine(); return 1; }
Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n -
I'm trying to write my own customer SyncMgr component. I'm having some trouble loading up the ISyncMgrRegister object. I'm a little new to COM so I'm probably missing osmething obvious here. This is MC++ code. Can someone point me in the correct direction.
#include "stdafx.h" #include "mobsync.h" #using using namespace System; int _tmain() { HRESULT hr = CoInitialize(NULL); if ( FAILED(hr) ) { Console::WriteLine(S"Cannot Initilaize com"); goto error; } ISyncMgrRegister *reg = NULL; hr = CoCreateInstance( CLSID_SyncMgr, NULL, CLSCTX_LOCAL_SERVER, IID_ISyncMgrRegister, reinterpret_cast(reg)); if ( FAILED(hr) ) { Console::WriteLine(S"Could not create an instance of the Sync Mgr"); goto error; } reg->Release(); Console::WriteLine(S"Press Enter to Exit"); Console::ReadLine(); return 0; error: Console::WriteLine(S"Press enter to exit"); Console::ReadLine(); return 1; }
Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477nreinterpret_cast<void**>(**&**reg)
The rest looks fine. Stability. What an interesting concept. -- Chris Maunder -
reinterpret_cast<void**>(**&**reg)
The rest looks fine. Stability. What an interesting concept. -- Chris MaunderWow that was a stupid mistake. Thanks Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n
-
I'm trying to write my own customer SyncMgr component. I'm having some trouble loading up the ISyncMgrRegister object. I'm a little new to COM so I'm probably missing osmething obvious here. This is MC++ code. Can someone point me in the correct direction.
#include "stdafx.h" #include "mobsync.h" #using using namespace System; int _tmain() { HRESULT hr = CoInitialize(NULL); if ( FAILED(hr) ) { Console::WriteLine(S"Cannot Initilaize com"); goto error; } ISyncMgrRegister *reg = NULL; hr = CoCreateInstance( CLSID_SyncMgr, NULL, CLSCTX_LOCAL_SERVER, IID_ISyncMgrRegister, reinterpret_cast(reg)); if ( FAILED(hr) ) { Console::WriteLine(S"Could not create an instance of the Sync Mgr"); goto error; } reg->Release(); Console::WriteLine(S"Press Enter to Exit"); Console::ReadLine(); return 0; error: Console::WriteLine(S"Press enter to exit"); Console::ReadLine(); return 1; }
Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477nHi Jared, I saw your post and was looking for some help, I am trying to write a Sync Manager component as well and I am having great difficulty with this as I am fairly new to C++ mostly VB, but I really need to hook into this interface, I to start with just wanted to get a hook in working, i.e register for synchronization and that sort of thing, do you have good samples you could share or point me in the right direction ? Cheers Michael