Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: CoCreateInstance problem
Conf: (P-PDF) Developers, Msg: 103752
From: Vovin
Date: 1/13/2004 04:00 AM


Can anyone help me with this. I have a small external test program that tests the interface on my plugin. It used to work fine but today it's stopped working for some reason.

It basically fails on the CoCreateInstance method with a return value of -2147024770.

Can anyone tell me why this is happening. Any help would be much appreciated. Thanks in advance. My code is shown below:

void CDigitalSignatureDlg::OnGettestvalue()

const IID IID_IDigitalSignature = {0x81258C34,0xA7BD,0x4AD2,{0xA4,0x53,0xB2,0x51,0xC9,0x0E,0xD0,0xCA}};
const IID LIBID_DIGSIGLib = {0xCB8337D2,0x00D9,0x4813,{0xBC,0xAE,0x76,0x24,0xCC,0xE9,0xB4,0xEA}};
const CLSID CLSID_DigitalSignature = {0x1FA1F023,0x96DF,0x43F6,{0xBD,0xDB,0x34,0x9B,0x4C,0xCA,0x40,0x36}};

// Declare and HRESULT and a pointer to
// the Simple_ATL interface
IDigitalSignature *pIDigitalSignature = 0;

// Now we will intilize COM
hr = CoInitialize(0);

// Use the SUCCEEDED macro and see if
// we can get a pointer
// to the interface
hr = CoCreateInstance( CLSID_DigitalSignature, NULL,
IID_IDigitalSignature, (void**) &pIDigitalSignature);

// If we succeeded then call the AddNumbers
// method, if it failed
// then display an appropriate message to the user.
long testResult = 0;
// display message
// display failure message
AfxMessageBox( "CoCreateInstance failed: REGDB_E_CLASSNOTREG", MB_OK);
AfxMessageBox( "CoCreateInstance failed: CLASS_E_NOAGGREGATION", MB_OK);
else if (S_OK == hr)
AfxMessageBox( "CoCreateInstance failed: Unspecified return value", MB_OK);
// Uninitialize COM
if (pIDigitalSignature)


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.