Reputation: 263
I am using a com DLL in the following manner:
#Region "API Function"
<DllImportAttribute("abc.dll", EntryPoint:="optcntl")> _
Public Shared Function optcntl(ByRef pBlocks As blocks) As Integer
End Function
#End Region
This DLL using the other four dlls to complete its processing. If I change the current directory path from the /bin/ folder to other folder in C or D drive which contains all the DLL. I get the following Error message: System.AccessViolationException: Atempted to read or write protected memory. This is often an indication that other memory is corrupt
Any help would be appriaciated..
Upvotes: 2
Views: 1871
Reputation: 15813
If I understand it correctly, this errors out whenever you change the current directory path to one NOT containing the four dlls that abc.dll calls. If so, it may be that abc.dll is always looking in the currect directory path for the other four dlls rather than the application directory or some specific place. However, this would normally give you a different error message, so make sure that there is not an old bug-ridden copy of the four dlls on the hard drive that is inadvertantly being picked up when you change the currendt directory.
Upvotes: 1