469,326 Members | 1,351 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

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

1
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.

Expand|Select|Wrap|Line Numbers
  1. static int Main(string[] args)
  2. {
  3.  
  4. ClientVarDataSet vds = new ClientVarDataSet();
  5. vds.XML = "";
  6.  
  7. vds.AddField("x", 3); //"x" field name and 3 field type 
  8. vds.AddField("y", 3);
  9.  
  10. vds.Insert();
  11. vds.set_FieldValues("x", 1);
  12. vds.set_FieldValues("y", 2);
  13.  
  14. Console.WriteLine(vds.XML);
  15. return 0;
  16. }
  17.  
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
Jul 17 '08 #1
1 3449
Curtis Rutland
3,256 Expert 2GB
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
Jul 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Ryan Linneman via .NET 247 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.