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:
Thank you in advance for any suggestions and help
David
Macro ocx_test
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