diff options
Diffstat (limited to 'complus/main.c')
-rw-r--r-- | complus/main.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/complus/main.c b/complus/main.c index 221a66b0..519d2bc6 100644 --- a/complus/main.c +++ b/complus/main.c @@ -28,6 +28,8 @@ #include <time.h> #include <windows.h> +#include "obj_base.h" + #include "argparse.h" #include "main.h" @@ -71,6 +73,9 @@ static ARGPARSE_OPTS opts[] = { { oEmbedding, "Embedding" , 0, "@" }, {0} }; + + + static const char * my_strusage( int level ) { @@ -258,30 +263,23 @@ enter_complus () { HANDLE running; int reg; - void *factory; + IClassFactory *factory; + CLSID clsid; - /* CoInitializeEx (NULL, COINIT_MULTITHREADED); */ + CoInitializeEx (NULL, COINIT_MULTITHREADED); running = CreateEvent (NULL, FALSE, FALSE, NULL ); - #if 0 - factory = create_class_factory (); - CoRegisterClassObject (CLSID_gpgme, factory, + factory = gnupg_factory_new ( &clsid ); + CoRegisterClassObject (&clsid, (IUnknown*)factory, CLSCTX_LOCAL_SERVER, - REGCLS_SUSPENDED|REGCLASS_MULTIPLEUSE, ® ); + REGCLS_SUSPENDED|REGCLS_MULTIPLEUSE, ® ); CoResumeClassObjects (); - #endif WaitForSingleObject ( running, INFINITE ); CloseHandle (running); - #if 0 CoRevokeClassObject ( reg ); - factory->release (); - CoUnitialize (); - #endif + gnupg_factory_release (factory); + CoUninitialize (); } - - - - |