Getting error "The memory could not be "read" while C# console application gets end.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kamcap
    New Member
    • Jul 2008
    • 1

    Getting error "The memory could not be "read" while C# console application gets end.

    I have referenced a COM dll (unmanagged code) in a C# console application and this DLL is referenced in C# program using Interop facility in .NET. This dll actually a dataset/table which is written in Borland Delphi.

    Code:
    static int Main(string[] args)
    {
    
    ClientVarDataSet vds = new ClientVarDataSet();
    vds.XML = "";
    
    vds.AddField("x", 3); //"x" field name and 3 field type 
    vds.AddField("y", 3);
    
    vds.Insert();
    vds.set_FieldValues("x", 1);
    vds.set_FieldValues("y", 2);
    
    Console.WriteLine(vds.XML);
    return 0;
    }
    The program gets failed when program ends (ending main() funtion) with the following error.

    ---------------------------
    Test.vshost.exe - Application Error
    ---------------------------
    The instruction at "0x03f62f8c " referenced memory at "0x04022ae8 ". The memory could not be "read".

    Click on OK to terminate the program
    ---------------------------
    OK
    ---------------------------

    and when I press OK button i got one more Run time error,

    ---------------------------
    Error
    ---------------------------
    Runtime error 216 at 00002F8C
    ---------------------------
    OK
    ---------------------------


    Can any one help me in this regard whether it is memory leak or string buffer size is exceeding??

    Regards
    Kamil
    Last edited by Curtis Rutland; Jul 17 '08, 01:37 PM. Reason: Added Code Tags - Please use the # button
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Welcome to Bytes!

    Please use the [code] tags when posting code snippets. This makes it easier for our experts to read and understand your code, and the easier they can read it, the easier they can help with your problem. You can insert them by clicking the # button in the editor. Please read the Posting Guidelines for more information.

    MODERATOR

    Comment

    Working...