?
Solved

Remote call to OpenSCManager fails.

Posted on 2005-04-25
1
Medium Priority
?
499 Views
Last Modified: 2013-12-03
Hello Experts.

I am trying to install service on remote NT4 machine and
connect to this service.

The program, xCmd, connects to NT4, authenticates as Administrator, drops
service into WinNT\System32 folder and tries to install it.
The piece of code which fails is:

   SC_HANDLE hSCM = ::OpenSCManager( lpszMachine, NULL, SC_MANAGER_ALL_ACCESS);
   if (hSCM == NULL) {
       StdOutput( " OpenSCManage failed ..." );
      return FALSE;
   }

The exception handling code:
 ShowLastErrorText();
gives message: "This funciton is only valid in Win32 mode."

The full source code is here:
http://www.codeguru.com/Cpp/I-N/network/remoteinvocation/article.php/c5433

I've recompiled this code in VC6++ and connect to NT4 from Windows 98 using command:
xCmd.exe  \\NTMachine /user:Administrator /pwd:xxxxxxx cmd

Why code fails?

Thank you.


0
Comment
Question by:beaverton8770
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 13863361
>>connect to NT4 from Windows 98

Win9x does not implement the SCM functions/APIs at all, neither locally nor remotely, that's what this approach is bound to fail.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Suggested Courses

592 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