A pointer to a double null-terminated array of null-separated names of services or load ordering groups that the system must start before this service. 
指向双null结束的null分割服务器名的数组或者载入负载顺序组的系统(必须先启动此服务)
确定服务启动了么?

解决方案 »

  1.   

    sqlserver肯定启动的啊,调用该函数后,我看注册表中DependOnService的值为MSSQLSERVER,还有些乱码。
      

  2.   

     "MSSQLSERVER/0/0"?
    不应该是“\”么?
      

  3.   

    vcleaner指出的问题很有道理,我再补充一下,是说结束符要有两个\0,该参数可指定多个服务,这些服务以\0分隔,所以最后要用两个\0来结束整个字符串。 
    char* ss = "Messenger";之所以能够成功,可能是后面全是0的缘故哦。 
    --------------------------------------------------------------- LPCTSTR   A 32-bit pointer to a constant character string that is portable for Unicode and DBCS. lpDependencies  
    Pointer to a double null-terminated array of null-separated names of services or load ordering groups that the system must start before this service. double null-terminated 两个结束符,呵呵