?
Solved

Class not registered, COM newbie

Posted on 1998-12-23
5
Medium Priority
?
362 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 800 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

765 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