none
VB.NET: Vendor API generating "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." RRS feed

  • Question

  • I'm uncertain as the correct forum for this question:

    Our VB project for years now has interacted with a vendor API. We declare the object to connect and call methods in the object library. Now when these methods when called are generating the "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." error. It doesn't matter the vendor method we are calling, it fails and generates the same error.

    We did some research and as suggested by most forums, we switched off the "Suppress JIT optimization on module load (Managed Only)" but still are having issues with this. We are uncertain what to try next. Any suggestions or thoughts? Below is the isolated code causing the issue:

    We are using Visual Studio 2013; Desktop machine, Windows 7 Enterprise

            Const PFEnter As String = "@E"
    
            Dim objVendor As atlVendorObject.atlVendor
            Dim objTool As atlVendorObject.IatlTool = Nothing
            Dim strError As String = Nothing
            Dim strScrape As String = Nothing
    
            objVendor = New atlVendorObject.atlVendor
    
            If objVendor.CreateTool("3270", 0, True, True, 0, objTool, strError) <> 0 Then
                Console.WriteLine("Tool Creation Failed")
                Console.ReadLine()
                Environment.Exit(0)
            End If
    
            If objTool.ClearScreen(True, strError) <> 0 Then MsgBox("ClearScreen method error: " & strError)
            If objTool.SendKeyStrokes(PFEnter, strError) <> 0 Then MsgBox("SendKeyStrokes method error: " & strError)
            If objTool.ReadScreen(1, 1, 77, strScrape, strError) <> 0 Then subDie(strError)
            If strScrape.ToUpper(System.Globalization.CultureInfo.CurrentCulture).Trim().StartsWith("COMMAND UNRECOGNIZED", StringComparison.CurrentCulture) Then subDie("The 3270 session appears to have timed out to the LPS logo screen.")
            If objTool.ReadScreen(23, 32, 5, strScrape, strError) <> 0 Then subDie(strError)
            If objTool.ClearScreen(True, strError) <> 0 Then subDie(strError)
            If objTool.SendKeyStrokes("SER1", strError) <> 0 Then subDie(strError)
            If objTool.SendKeyStrokes(PFEnter, strError) <> 0 Then subDie(strError)
    
            Console.WriteLine("DONE")
            Console.ReadLine()



    SV

    Tuesday, February 13, 2018 3:36 PM

Answers

  • There are many different things that can cause it, you need contact the vender that offers the API, they might help.

    Thanks for your understandings.

     

    Regards,

    Fletcher


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Wednesday, February 14, 2018 6:24 AM