By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,574 Members | 3,021 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,574 IT Pros & Developers. It's quick & easy.

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

P: 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
Share this Question
Share on Google+
1 Reply


Curtis Rutland
Expert 2.5K+
P: 3,256
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.