replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Access Violation error after adding mscorlib as a reference
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Access Violation error after adding mscorlib as a reference

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
silverdan



Joined: 14 May 2009
Posts: 29

PostPosted: Thu Mar 25, 2010 4:10 pm    Post subject: Access Violation error after adding mscorlib as a reference Reply with quote

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
View user's profile Send private message
silverdan



Joined: 14 May 2009
Posts: 29

PostPosted: Sun Mar 28, 2010 11:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8211
Location: Salford, UK

PostPosted: Mon Mar 29, 2010 8:18 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
silverdan



Joined: 14 May 2009
Posts: 29

PostPosted: Mon Mar 29, 2010 1:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8211
Location: Salford, UK

PostPosted: Tue Apr 20, 2010 1:05 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group