为什么调用API失败呢?
我的系统是WIN XP,程序中用了下面的API,然后程序运行时报错:说找不到RegisterServiceProcess函数的入口。
请问,该怎样解决?
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Private Const RSP_SIMPLE_SERVICE = 1
Private Const RSP_UNREGISTER_SERVICE = 0
Private Sub Form_Load()
Call RegisterServiceProcess(GetCurrentProcessId, 1)
End Sub