471,854 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,854 software developers and data experts.

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 3584
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
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.