Hello !
VB Code:
Public Sub SearchString() regkey = "Software\My Software" strname = Form1.text1.Text lngresult = RegOpenKeyEx(HKEY_CURRENT_USER, regkey, REG_SZ, keyallaccess, path) If lngresult = 0 Then lngresult=RegSetValueEx (path, "Search Now", 0, REG_SZ, ByVal strname, Len(strname) End If lngresult = RegCloseKey(path) Exit Sub
Now assume Text1 has no text. A blank text box.
when we execute SearchString() the Strname will be > strname=""
Problem is :
RegSetValueEx returns 87 in Windows98Se. So the function fail to set the value data.
RegSetValueEx returns 0 successfully on XP and 2K.
Friends! What is the problem?




Reply With Quote