Hi,
I'm a noob with C# .NET (in fact, I've only just started looking at it within the last 24 hours) so please excuse me.
[DllImportAttribute("test.dll", EntryPoint = "_test@24", CharSet = CharSet.Ansi, ExactSpelling = false, SetLastError = false, PreserveSig = true, CallingConvention = CallingConvention.Winapi, BestFitMapping = false, ThrowOnUnmappableChar = false)]
[PreserveSigAttribute()]
I am trying to use that with a DLL that is packed with yoda's protector 1.03.3 and I am getting the error quoted in the subject title when trying to call the function. I'm using code directly taken from a working project and all my debugging has shown the parameters and everything leading up to the function call to be completely correct.
I've been reading around and believe it could have something to do with the DLL relocs trying to access read-only memory or something similar to that? If so, how would I go about solving this? Editing the DLL is not really feasible, as the original author lost his source code a long time ago, and unpacking it is not the easiest of things. Also, I *believe* this code works fine in .NET 2003 as the original application used for the exact same DLL was compiled under .NET 2003, but in the 2008 version it's causing this error.
Any ideas?
Thanks,
Nick