CreateMutexA 问题
-----问题------------------------------------------------------
在pb10.5中
无论多少次运行,ll_err 始终为122,就是得不到183;
将ls_mutex_name 改为任一字符串,ll_err 还是为122;
而在PB8程序中调用正常
请高手指点
--------API申明--------------------------------------------------
function ulong CreateMutexA (ulong lpMutexAttributes, int bInitialOwner, ref string lpName) library "kernel32.dll" alias for "CreateMutexA;Ansi"
function ulong GetLastError () library "kernel32.dll"
--------调用---------------------------------------------------------
ulong ll_mutex, ll_err
string ls_mutex_name
if handle (GetApplication (), false) <> 0 then
ls_mutex_name = this.AppName + CharA (0)
ll_mutex = CreateMutexA (0,0,ls_mutex_name)
ll_err = GetLastError ()
// MessageBox ("提示信息",string(ll_err)+'&'+ls_mutex_name+'&'+string(ll_mutex))
if ll_err = 183 then
MessageBox ("提示信息", "系统已经在运行中!")
Halt close
end if
end if
-----------等待------------------
???