copymemory in vb.net and C++


  • Hi, I'm trying to get a VB program and a native C++ program is communicate to each other.
    I'm trying to do this by using shared filemapping. I tried using copymemory on both programs but the VB program won't write if the C++ program has writen already and can't read what it has either giving the "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." error when debugging in VB

    I'm using VB 2008 express if that affects anything..

    Can anyone help me with this or provide me with a sample code of how to do it?
    It will be greatly appretiated, I really need to get this working.
    Sunday, April 27, 2008 8:22 AM


  • Hi Ftaka,

    If there are two windows applications, you can try using WM_CopyData message to implement the inter-process communication as the workaround. Read this thread about WM_COPYDATA for your reference. Or Read this thread by Jeffrey Tan about using memory mapping file in .Net. Hope this helps.

    Best regards,

    Tuesday, April 29, 2008 4:10 AM