Вниз
Скачать: CL | DM;

Ошибка при работе с RegQueryValueEx   Найти похожие ветки 

← →
Alexis ©   (2004-06-12 15:37) [0]

procedure TRestrictionsForm.FormCreate(Sender: TObject);
var
OPENED : HKEY;
Buffer : Pointer;
ValType, BuffSize : DWORD;
begin
RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer", 0, KEY_EXECUTE, OPENED);
Buffer := nil;
if RegQueryValueEx(OPENED, "NoDrives", nil, @ValType, PByte(Buffer), @BuffSize) = ERROR_SUCCESS then
  if (ValType = REG_DWORD) or (ValType = REG_BINARY) then
   ShowMessage( IntToStr(Integer(Buffer)) );
end;

Постоянно выдается 0, даже при ненулевом значении.
Где ошибка?
Заранее спасибо.


← →
Cobalt ©   (2004-06-13 13:52) [1]

А память под буфер выделять не собираетесь?


← →
Cobalt ©   (2004-06-13 13:53) [2]

If the function fails, the return value is a nonzero error code defined in WINERROR.H. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
(GetSysError, если не ошибаюсь)



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.026 c
14-1089226754
oblom
2004-07-07 22:59
2004.07.25
помогите найти работу в Донецке


9-1081776891
Werwolf
2004-04-12 17:34
2004.07.25
Сохранки


14-1089115718
Акуля
2004-07-06 16:08
2004.07.25
есть mdb


14-1088970778
ИМХО
2004-07-04 23:52
2004.07.25
Американские тэги к фильмам


9-1080911413
Cash
2004-04-02 17:10
2004.07.25
Collision на каждом кадре анимации




   Наверх