Silverfrost Forums

Welcome to our forums

Access Violation error after adding mscorlib as a reference

25 Mar 2010 3:10 #6216

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
28 Mar 2010 10:58 #6221

Weird, but after I removed the System.Xml reference in the dll I'm building it built and worked. I added System.Xml back in and it failed with the Access Violation error. Is there some sort of limit as to how many or what references can be added?

29 Mar 2010 7:18 #6223

Clearly dbk_link should not give an access violation and I can aim to fix this bug but in the end you will not be able create a DLL from a main program.

29 Mar 2010 12:07 #6228

Yeah, I know I cant create a DLL with a main layout. Was just showing that it worked in a Main layout.

Ok, thanks for looking into why mscorlib.dll and system.xml cannot be referenced together in a DLL.

Sincerely, Dan

20 Apr 2010 12:05 #6311

I have looked at this but I cannot reproduce this behaviour. I get a reported failure first when I try as a DLL project and also when I fool it into compiling and then try to link.

Please login to reply.