Solved

Class not registered, COM newbie

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Least Squares Curve Fitting 4 116
c++, dynamic object by json 1 60
How to Correctly derive class from CWinThread in MFC 4 89
boost::uuid crashes 17 40
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

733 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