Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HKEY Type for qm conversion
#1
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.
https://i.ibb.co/2MkfzFf/save.png

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:
Quote:SaveSettings()
C++
__declspec(dllimport) BOOL __stdcall ScnLib_SaveSettingsA(HKEY hKey, LPCSTR pcszSubKey);

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

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

Description
Save the current SDK settings to the Windows registry.

Parameters
RegKey [in]
Handle to a currently open key or one of the following predefined keys: 
HKEY_CURRENT_USER 
HKEY_LOCAL_MACHINE 
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
David



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

Code:
Copy      Help
,case 6 ;;save
,;byte Key=HKEY_CURRENT_USER  ;;???
,RegKey hk=HKEY_CURRENT_USER
,sc3.SaveSettings(&hk "subK")
#3
All handles in QM are int.
#4
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)