Solved

Class not registered, COM newbie

Posted on 1998-12-23
5
352 Views
Last Modified: 2012-08-14
I am trying to use the new Microsoft Scheduling Agent API as demonstrated in their sa.cpp sample code.  I'm using VC++ 6.0 and the Sept 98 version of the Platform SDK.  I'm running NT Server 4.0 with Service Pack 3.

It compiles put when I run it returns -2147221164 which is really 0x80040154  CLASS_NOT_REGISTERED.

It happens HERE...

    hr = CoCreateInstance(
        CLSID_CTaskScheduler,
        NULL,
        CLSCTX_INPROC_SERVER,
        IID_ITaskScheduler,
        (void **) &g_pITaskScheduler);

It seems to me CLSID_CTaskScheduler is not a registered class, but I'm struggling trying to figure out how to do this.   The info I've found in the MSDN doesn't make sense ("If you run the REGEDT32.EXE program with the Win32 SDK...)
What the heck does that mean?  
I can go into the registry under HKEY_CLASSES_ROOT and see there is NOT an subkey labeled CLSID, but don't know how to create it.

Looking for guidance.

Thanks

0
Comment
Question by:jnearing
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 1180956
>>I can go into the registry under HKEY_CLASSES_ROOT and see
>>there is NOT an subkey labeled CLSID, but don't know how to
>>create it.

This is impossible, your shell wouldn't work if it wasn't there...
There must be an entry named 'HKEY_CLASSES_ROOT\CLSID\{148BD52A-A2AB-11CE-B11F-00AA00530503}' - if it doesn't exist, it means that the task scheduler indeed isn't registered, and you have to run 'regsvr32 mstask.dll' manually. If it exists, check the 'InProcServer32' key, the entry must point to 'mstask.dll'

0
 
LVL 1

Author Comment

by:jnearing
ID: 1180957
What OS are you running?   I found that registry entry on a Windows 98 PC, but not on any of our NT 4.0 servers.   There's no "mstask.dll" entry in the registry.

There is a key labeled HKEY_CLASSES_ROOT\CLSID\JobObject\CLSID
with a default entry of 148BD520-A2AB-11CE-B11F-00AA00530503
which may be the older scheduling interface using the NetSchedule API versus the newer Scheduling Agent API.  I am just guessing that.

I'll register mstask.dll manually if you indeed have that registry entry on an NT machine.

thanks

Jim



0
 
LVL 86

Expert Comment

by:jkr
ID: 1180958
Well, the machine i used when answering was WinNt 4.0 WkSta SP3 IE4... and it _was_ registered - i simply used 'Copy Key Name'  (or whatever it is on an english NT ;-) from the context menue of 'regedit.exe'...
0
 
LVL 86

Expert Comment

by:jkr
ID: 1180959
>>There is a key labeled
>>HKEY_CLASSES_ROOT\CLSID\JobObject\CLSID
>>with a default entry of
>>148BD520-A2AB-11CE-B11F-00AA00530503
>>which may be the older scheduling interface using the
>>NetSchedule API versus the newer Scheduling Agent API.  I
>>am just guessing that.

No. A version change definitely requires a change in the CLSID/IID also, this is a design principle of COM.

I assume (as mstask.dll comes with IE4, and not initially with NT4) it simply never has been installed on your servers...
0
 
LVL 1

Author Comment

by:jnearing
ID: 1180960
OK, thanks for you help.

Jim

0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question