how can i enter string value in registry by "RegSetValueEx" function in VB6
Above API require ANSI string as input.
How can i convert unicode string to ANSI string in VB6
Please give me the Full code in VB6.
this function is a Win32API function and its declaration is available in the VB API viewer. Here it is :
Code:
Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Note :
if you declare the lpData parameter as String, you must pass it By Value.
the above function is the ANSI type function, so you don't need unicode conversion.
with the above declaration in the beginning of your module, just invoke the function as needed from within the module.
Always keep in your mind that the VB6 API viewer is your companion when dealing with win32API directly in VB6