Link to home
Start Free TrialLog in
Avatar of GiantMatrix
GiantMatrix

asked on

If statement question part 2

Hi All,

I have the following 2 problems in code, so can someone please tell me what exactly I am doing wrong in them:

A)
var
   SCM, SCH: SC_HANDLE;
begin
   SCM := OpenSCManager(Nil, Nil, SC_MANAGER_ALL_ACCESS);

   if SCM <> Nil then

In the above block of code I always get an error:
[Error] Unit1.pas(175): Operator not applicable to this operand type

So can someone please tell me what exactly I am doing wrong here?

B)
if ChangeServiceConfig(SCH, SERVICE_NO_CHANGE, SERVICE_AUTO_START,SERVICE_NO_CHANGE,Nil,Nil,Nil,Nil,Nil,Nil,PChar(ServiceName) ) <> 0 then

I always get Error: [Error] Unit1.pas(180): Incompatible types

So can someone please tell me what exactly I am doing wrong here?
ASKER CERTIFIED SOLUTION
Avatar of Russell Libby
Russell Libby
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial