Buzzsaw General Discussion

Buzzsaw General Discussion

New Member
Posts: 2
Registered: ‎02-22-2011
Message 1 of 3 (787 Views)

VC++, Scripting API, Error at CreateInstance, Error code "800401F0" .

787 Views, 2 Replies
02-22-2011 10:10 PM

I allways have an error code "800401F0" with a program code, sts = spIPPSession.CreateInstance(clsid);

Can anyone give me an advice to avoid or fix this error?

How should I correct the program source?

Please see the program source as below. 



#include "stdafx.h"
//#include "stdio.h"

#import "C:/Program Files/ProjectPoint API Toolkit/ProjectPointClient.dll" no_namespace
//#import "c:\users\hondato\desktop\hondato\mhi nagasaki\bzs_2010\Debug\ProjectPointClient.dll" no_namespace

int bazlink(void);

int _tmain(int argc, _TCHAR* argv[])
 return 0;
int bazlink(void)
 CLSID   clsid;
 _bstr_t bstrSiteName = ""; //
 _bstr_t bstrUsername = "User1";         //
 _bstr_t bstrPassword = "Password1";        //
 _bstr_t resultString = "";

 HRESULT hr = CLSIDFromProgID(OLESTR("ProjectPointClient.PPScripting.1"), &clsid);
 IPPSessionPtr  spIPPSession;
 spIPPSession = NULL;
 long sts;
 char buf[10];

 sts = spIPPSession.CreateInstance(clsid); 

 sprintf(buf, "%X", sts);
 resultString = buf;

 //_bstr_t s = n.ToString("X2");

 spIPPSession->LogIn(bstrUsername, bstrPassword, bstrSiteName);
 spIPPSession->LogOut ();

 return 1;



New Member
Posts: 2
Registered: ‎02-22-2011
Message 2 of 3 (772 Views)

Re: VC++, Scripting API, Error at CreateInstance, Error code "800401F0&quot

02-24-2011 12:32 AM in reply to: hondato

I just found that I used "ProjectPoint.PPScripting.1" to get clsid, but used it for PPSession CreateInstance.

I also added CoInitialize and CoCreateInstance as below, then the program runs well!!





 HRESULT hr = CoInitialize(NULL);
 printf("CoInitialize %X\n", hr);


 hr = CLSIDFromProgID(OLESTR("ProjectPointClient.PPSession.1"), &clsid);
 printf("CLSIDFromProgID %X\n", hr);


 hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL, __uuidof(IUnknown), reinterpret_cast<void**>(&spIPPSession));
 printf("CoCreateInstance %X\n", hr);


 hr = spIPPSession.CreateInstance(clsid); 
 printf("CreateInstance %X\n", hr);


 hr = spIPPSession->LogIn(bstrUsername, bstrPassword, bstrSiteName);
 printf("CreateInstance %X\n", hr);


 hr = spIPPSession->LogOut();
 printf("CreateInstance %X\n", hr);


Posts: 19
Registered: ‎02-09-2007
Message 3 of 3 (703 Views)

Re: VC++, Scripting API, Error at CreateInstance, Error code "800401F0&

04-06-2011 04:03 PM in reply to: hondato


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New Buzzsaw Category!

The Buzzsaw forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.