I am getting the following exception in the release build of my assembly.
{"Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."} System.Exception
{System.AccessViolationException}
I do not have any problems in debug. The problem occurs while
instantiating an unmanaged class.
Any idea what is causing the problem? Why would I get the problem in
release but not debug?
I have included the wrapper managed class below. The unmanaged class
GarXface4::UsbDeviceNameList enumerates USB devices using functions
found in Setupapi. The class works fine when called with unmanaged code.
public ref class UsbNames
{
public:
UsbNames()
{
m_pLst = new GarXface4::UsbDeviceNameList();
}
~UsbNames()
{
delete m_pLst;
}
private:
GarXface4::UsbDeviceNameList *m_pLst;
};
--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com