首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > WinCE >

关于CeCreateProcess的有关问题!

2012-03-18 
关于CeCreateProcess的问题!急!现在定义如下PublicDeclareFunctionCeCreateProcessLibrapi.dll (_ByVall

关于CeCreateProcess的问题!急!
现在定义如下
Public   Declare   Function   CeCreateProcess   Lib   "rapi.dll "(   _
    ByVal   lpApplicationName   As   String,   _
    ByVal   lpCommandLine   As   String,   _
      lpProcessAttributes   as   SECURITY_ATTRIBUTES,   _
      lpThreadAttributes   as   SECURITY_ATTRIBUTES,   _
    bInheritHandles   as   Boolean,   _
    ByVal   dwCreationFlags   As   Long,   _
    lpEnvironment   As   Any,   _
    ByVal   lpCurrentDirectory   as   String,   _  
      lpStartupInfo   as   STARTUPINFO,   _
      lpProcessInformation   as   PROCESS_INFORMATION   _
)   as   Boolean
难道写错了?总是不能通过编译,这个是VB6的代码!
这个函数执行后,还有什么要注意的地方吗?

[解决办法]
编译错误帖上来看看!
[解决办法]
总有个提示吧?? 要根据提示去找错误的啊!
[解决办法]
上面的应该是Dim R As Boolean
R = CeCreateProcess( "\\Program Files\\SetTime\\SetTime.exe ", " ", " ", False, 0, " ", " ", " ", " ", " ")
Command6.Caption = R
要双斜杠的吧??
[解决办法]
BOOL CeCreateProcess(
LPCWSTR lpApplicationName,
LPCWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPWSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation);
仔细看下,应该是你没用Unicode的缘故! 这样改试试:
Dim R As Boolean
R = CeCreateProcess(L "\Program Files\SetTime\SetTime.exe ", L " ", L " ", False, 0, L " ", L " ", L " ", L " ", L " ")
Command6.Caption = R
如果VB下也有类似TEXT这样的宏,则用宏比较好.

热点排行