584,846 active members*
4,630 visitors online*
Register for free
Login
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2017
    Posts
    1

    Fanuc VB.NET app

    Hello,

    I am trying to build a vb.net based application, that allows me to send and retrieve programs from the machine.

    When I try to alloccate the library I get the error "System.AccessViolationException". Can check the code on the attached image.

    Does anyone knows why this happens?

    Click image for larger version. 

Name:	VS_Error.jpg 
Views:	11 
Size:	16.3 KB 
ID:	377077

    Best regards

  2. #2
    Join Date
    Apr 2005
    Posts
    3634

    Re: Fanuc VB.NET app

    Maybe this webpage will help, specifically the 2nd solution at the bottom of the page that mentions the Fanuc 64-bit DLL If you're on a 64-bit PC.
    Free DXF - vectorink.com

  3. #3
    Join Date
    Jan 2022
    Posts
    6

    Re: Fanuc VB.NET app

    This is often an indication that another memory is corrupt.YoWhatsApp APK Download

  4. #4
    Join Date
    Aug 2023
    Posts
    1

    Post Re: Fanuc VB.NET app

    The System.AccessViolationException error occurs when you try to access memory that is not allocated or that you do not have permission to access. In your code, you are trying to allocate a library using the statement: try below solution and share with me on tm

    Dim lib As New Marshal.LoadLibrary(dllPath)
    However, the dllPath variable is not initialized, so it is not pointing to a valid file. This is why you are getting the error.

    To fix this error, you need to initialize the dllPath variable to the path of the library file that you want to load. For example:

    Dim dllPath As String = "C:\MyLibrary.dll"
    Dim lib As New Marshal.LoadLibrary(dllPath)
    Once the dllPath variable is initialized, the code should be able to allocate the library without any errors.

    Here are some other possible reasons why you might be getting the System.AccessViolationException error:

    You are trying to access a memory address that is outside of the bounds of the allocated memory.
    You are trying to write to a memory address that is read-only.
    You are trying to access a memory address that is already in use by another process.
    If you are still getting the error after fixing the above mentioned issues, you can try the following:

    Use a debugger to step through the code and see where the error is occurring.
    Check the documentation for the library that you are trying to load to make sure that you are using it correctly.
    Contact the library's author for help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •