Hi Lert,
Commonly Access Violation is raised by following factors:
1. Reading/Writing invalid memory block.
2. Accessing memory that has not been allocated or has been freed already
3. Accessing memory address that is reserved (e.g. kernel use >0x7FFFFFFF)
4. Writing to memory block that is marked as “Read-Only�(immutable strings)
5. Wrapped as NullReferenceException/AccessViolationException in .Net
Could you give us native C++ function definition so that we can confirm that the managed signature is correct? Whether you can run this application in Windows7 or Windows2008 without problems (Because I haven't Vista SP2 computer, I want to know if this question occurs in Windows7 or Windows2008 so that I can reproduce your scenario if you can send me your C++ DLL). Commonly we need to use Debugger to investigate this question. Please have a look at this demo:
http://stackoverflow.com/questions/1331320/using-windbg-to-inspect-method-parameters-in-raw-memory-from-crash-dump We can directly attach Windbg to break at the Exception to investigate the question.
Best regards,
Riquel
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.