您的位置:程序门 -> delphi -> windows sdk/api



使用regqueryvalue的問題


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


使用regqueryvalue的問題[已结贴,结贴人:takdick]
发表于:2007-03-26 16:55:40 楼主
var
str:string;
begin
regqueryvalue(hkey_local_machine, 'software\microsoft\windows   nt\currentversion\winlogon ',pchar(str),length(pchar(str))+1);

編譯不過,顯示為:[error]   unit1.pas(133):   types   of   actual   and   formal   var   parameters   must   be   identical,請問如何解決?

发表于:2007-03-26 17:08:351楼 得分:15
形式参数必须与实际参数一致
发表于:2007-03-26 17:11:122楼 得分:0
long   regqueryvalue(

        hkey   hkey, //   handle   of   key   to   query  
        lpctstr   lpsubkey, //   address   of   name   of   subkey   to   query  
        lptstr   lpvalue, //   address   of   buffer   for   returned   string  
        plong   lpcbvalue   //   address   of   buffer   for   size   of   returned   string  
      );
发表于:2007-03-26 18:04:213楼 得分:0
還是不明白,那應該怎樣改?
发表于:2007-03-27 10:51:244楼 得分:0
help,please.
发表于:2007-03-27 11:36:395楼 得分:0
关注
发表于:2007-03-27 21:37:216楼 得分:15
long   regqueryvalue(
        hkey   hkey,//   handle   of   key   to   query  
        lpctstr   lpsubkey,//   address   of   name   of   subkey   to   query  
        lptstr   lpvalue,//   address   of   buffer   for   returned   string  
        plong   lpcbvalue   //   address   of   buffer   for   size   of   returned   string  
      );

最后一个参数也是指针,指向一个long(dword)类型的缓冲区。

你改为这样试试
var
str:string;
dwstr:   dword;
begin
regqueryvalue(hkey_local_machine, 'software\microsoft\windows   nt\currentversion\winlogon ',pchar(str),&dwstr);

推荐使用regqueryvalueex这个api。
发表于:2007-03-28 12:06:577楼 得分:0
編譯時提示 'illegal   character   in   input   file:   '& '   [$26]
regqueryvalueex該怎麼用?謝謝.
发表于:2007-03-29 19:50:208楼 得分:0
up...


快速检索

最新资讯
热门点击