View previous topic :: View next topic |
Author |
Message |
silverdan
Joined: 14 May 2009 Posts: 29
|
Posted: Thu Mar 25, 2010 4:10 pm Post subject: Access Violation error after adding mscorlib as a reference |
|
|
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?
Code: |
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
|
|
|
Back to top |
|
 |
silverdan
Joined: 14 May 2009 Posts: 29
|
Posted: Sun Mar 28, 2010 11:58 pm Post subject: |
|
|
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? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Mon Mar 29, 2010 8:18 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
silverdan
Joined: 14 May 2009 Posts: 29
|
Posted: Mon Mar 29, 2010 1:07 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Tue Apr 20, 2010 1:05 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
|