Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HKEY Type for qm conversion
I am using an OCX component, and I am stuck with the registry data type conversion. The information displayed in the QM's help bar is as shown in the following image.

The following QM code execution results in the following error message:
0x80020005, Type mismatch, argument 1.

The help information for the SaveSettings function is as follows:
__declspec(dllimport) BOOL __stdcall ScnLib_SaveSettingsA(HKEY hKey, LPCSTR pcszSubKey);

DllImport("ScnLib.dll", CharSet = CharSet.Unicode)] public static extern bool ScnLib_SaveSettingsW(IntPtr RegKey, string SubKey); 

Public Declare Unicode Function ScnLib_SaveSettingsW Lib "ScnLib.dll" (ByVal RegKey As IntPtr, ByVal SubKey As String) As Boolean 

Save the current SDK settings to the Windows registry.

RegKey [in]
Handle to a currently open key or one of the following predefined keys: 
You may specify a currently open key if you would like to save the SDK settings to a different registry key than the predefined keys above.

On the systems with Windows UAC enabled (by default on Windows Vista and later), if you specify the HKEY_LOCAL_MACHINE as the RegKey, your program must run as administrator in order to be able to write to this registry key.

SubKey [in]
A sub-key under the RegKey where you would like to save the SDK settings to the Windows registry. Pass a zero value or an empty string to save to the SDK's default sub-key.

Return Value
If the SDK settings are saved successfully, the return value is TRUE. Otherwise, the return value is FALSE.

Thank you in advance for any suggestions and help

Macro ocx_test
Copy      Help
,case 6 ;;save
,sc3._getcontrol(id(3 hDlg))
,byte Key=HKEY_CURRENT_USER  ;;???
,sc3.SaveSettings(Key "subK")
Using the following code, still getting an error:  interface pointer variable is 0

Copy      Help
,case 6 ;;save
,;byte Key=HKEY_CURRENT_USER  ;;???
,sc3.SaveSettings(&hk "subK")
All handles in QM are int.
Thank you for your suggestions
The issue still hasn't been resolved;
I've already found a solution using other software

Forum Jump:

Users browsing this thread: 1 Guest(s)