CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Guest

    Registry Editing--problem

    Hi,
    Environment : vc+=5.0 and winNT,

    I want to write from my application in to the registry. I tried using WriteProfile String and this is writing in to Win.ini file and Win NT registry
    is not getting updated.

    Please let me know how to solve this problem.

    Thanx in advance.


  2. #2
    Join Date
    Apr 1999
    Posts
    38

    Re: Registry Editing--problem

    Hi,
    The function you used is updating the ini. For registry there are set of function available. For eg. there is one function to set the value of particular key, SetRegistryKey().

    try this ou.


  3. #3
    Guest

    Re: Registry Editing--problem

    Hi

    The problem is I want use Win32 API to do this more over WriteProfileString() takes section name and key name as args.I think this should also work.

    Bye.





  4. #4
    Join Date
    Apr 1999
    Posts
    3

    Re: Registry Editing--problem

    Hi,

    You can direcly write in to registry?


  5. #5
    Guest

    Re: Registry Editing--problem

    I want to upadte the registry only from my application and not directly.


  6. #6
    Guest

    Re: Registry Editing--problem

    The WritePrivateProfileInt & WriteProfileInt (& corresponding string functions) were for Win16 systems and are designed to write to the ini file. In Win NT, these functions can reference the registry depending on system configuration. The best bet is to use the actual Registry API. Here is one to start with:

    LONG RegSetValueEx(
    HKEY hKey, // handle to key to set value for
    LPCTSTR lpValueName, // name of the value to set
    DWORD Reserved, // reserved
    DWORD dwType, // flag for value type
    CONST BYTE *lpData, // address of value data
    DWORD cbData // size of value data
    );


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured