Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to enter string value in registry by RegSetValueEx? VB6

Status
Not open for further replies.

samkraju

Newbie level 5
Joined
Jul 20, 2004
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
58
registry functions

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.
 

Re: registry functions

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

Goodluck :D
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top