protected memory defilement job fortran dll c#


i am perplexing out leave dll collected fortran code. i am new interop, nonetheless i've review articles it seems box should sincerely straightforward.



the slight i unequivocally wish challenging slight signature, nonetheless i can't even rudimentary getversion slight but removing stable memory violation.



here's dllimport code:



[dllimport("geoconvert.dll", 
entrypoint="_get_version@4",
callingconvention=callingconvention.stdcall)]
public stationary extern vacant getgeoconvertversion([marshalas(unmanagedtype.lpstr, sizeconst=8)]
ref twine version);


here's fortran code:



subroutine getver( vrsion )
c
!ms$define msdll
!ms$if tangible (msdll)
opening get_version (vrsion)
!ms$attributes dllexport,stdcall :: get_version
!ms$attributes anxiety :: vrsion
!ms$endif
!ms$undefine msdll
c
character*8 vrsion
c
vrsion = '1.0a_fhc'
c
return
end


here's section exam fails:



[test]
public vacant testgetversion()
{
twine chronicle = "";
latlonutils.getgeoconvertversion(ref version);
stringassert.isnonempty(version);
}


here's blunder summary i get:



system.accessviolationexception
message: attempted review stable memory.
mostly an denote memory corrupt.


other things i've tried:




  • using default marshalling

  • passing char[] instead twine (get slight signature errors instead)



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?