I get an 'DBK_LINK2.EXE - Access Violation' error after adding mscorlib.dll as a reference and then building a DLL.
The following works when built as an executable, but cannot get it to work as a DLL due to receiving an Access Violation. Any suggestions on how to get around this error? Are there just certain references that cannot be made in a DLL?
WINAPP
PROGRAM Test
IMPLICIT NONE
! .NET Objects
OBJECT('System.Object') objGetValue
OBJECT('System.String') strGetValue
assembly_external (name='Microsoft.Win32.Registry.GetValue') GetValue
assembly_external (name='Microsoft.Win32.Registry.SetValue') SetValue
! Local Variables
CHARACTER*18 :: machineRoot
CHARACTER*37 :: subkey
CHARACTER*56 :: keyName
CHARACTER*200 :: regGetValue
! Initialize variables
machineRoot = 'HKEY_LOCAL_MACHINE'
subkey = 'Software\\Test1\\Test\\Paths\\SysPramPath'
keyName = machineRoot // '\' // subkey
regGetValue = ''
objGetValue = GetValue(keyName,'','Why no path')
strGetValue=CAST@(objGetValue,'System.String')
regGetValue = CHAR(strGetValue)
end program Test