Solved

Class not registered, COM newbie

Posted on 1998-12-23
5
346 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now