Solved

Class not registered, COM newbie

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

839 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