Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
AnswerRe: How is it possible to access private members of a class becoz the property of the field is made protected internal ? Pin
Christian Graus18-Jun-09 20:32
protectorChristian Graus18-Jun-09 20:32 
AnswerRe: How is it possible to access private members of a class becoz the property of the field is made protected internal ? Pin
Vikram A Punathambekar18-Jun-09 20:34
Vikram A Punathambekar18-Jun-09 20:34 
GeneralRe: How is it possible to access private members of a class becoz the property of the field is made protected internal ? Pin
Christian Graus18-Jun-09 21:39
protectorChristian Graus18-Jun-09 21:39 
GeneralRe: How is it possible to access private members of a class becoz the property of the field is made protected internal ? Pin
Vikram A Punathambekar19-Jun-09 0:01
Vikram A Punathambekar19-Jun-09 0:01 
AnswerRe: How is it possible to access private members of a class becoz the property of the field is made protected internal ? Pin
PIEBALDconsult19-Jun-09 5:36
mvePIEBALDconsult19-Jun-09 5:36 
QuestionMouseHover Event Pin
deepseeindeepsy18-Jun-09 19:55
deepseeindeepsy18-Jun-09 19:55 
AnswerRe: MouseHover Event Pin
musefan18-Jun-09 21:56
musefan18-Jun-09 21:56 
QuestionSystem.AccessViolationException Pin
siddy1718-Jun-09 19:13
siddy1718-Jun-09 19:13 
Hi All,

I am trying to do something like this:

I have a C++ dll, this dll has a function which accepts filename(String) ,dataTobewritten(char array) and the length of the char array(long). The function then creates a file with the specified name and writes the data to it.

I am trying to call this function from C# code using P/Invoke.
The problem is that whenever the function is invoked it throws an exception as follows:

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

I have tried the following options:

1) Setting the application as a trusted application in application properties.
2) Checked the C++ code so as to make sure there are no memory leaks due to bad pointers or missing 'Dealloc' statements.
3) Verififed that the signatures match exactly.

I am at my wits end, as there seems to be no solution for this.

Can anyone please throw some light on any other options?
It would be of really great help.

P.S: I am using VS 2008 express edition (if that makes a difference, as I am aware that MS had released a patch for the same problem for its 2.0 version.)

Thanks in advance.
Siddy
AnswerRe: System.AccessViolationException Pin
Christian Graus18-Jun-09 19:29
protectorChristian Graus18-Jun-09 19:29 
GeneralRe: System.AccessViolationException Pin
siddy1718-Jun-09 19:57
siddy1718-Jun-09 19:57 
GeneralRe: System.AccessViolationException Pin
Christian Graus18-Jun-09 21:28
protectorChristian Graus18-Jun-09 21:28 
QuestionGUI interface for launching a ethernet packet Pin
moniska18-Jun-09 16:55
moniska18-Jun-09 16:55 
AnswerRe: GUI interface for launching a ethernet packet Pin
Rajesh Anuhya18-Jun-09 18:11
professionalRajesh Anuhya18-Jun-09 18:11 
GeneralRe: GUI interface for launching a ethernet packet Pin
moniska21-Jun-09 16:59
moniska21-Jun-09 16:59 
QuestionWindows service Stop issue Pin
mark_me18-Jun-09 16:11
mark_me18-Jun-09 16:11 
AnswerRe: Windows service Stop issue Pin
Mycroft Holmes18-Jun-09 17:57
professionalMycroft Holmes18-Jun-09 17:57 
GeneralRe: Windows service Stop issue Pin
mark_me14-Jul-09 17:29
mark_me14-Jul-09 17:29 
QuestionPhone Pin
ellllllllie18-Jun-09 12:23
ellllllllie18-Jun-09 12:23 
AnswerRe: Phone Pin
Henry Minute18-Jun-09 12:44
Henry Minute18-Jun-09 12:44 
AnswerRe: Phone Pin
Luc Pattyn18-Jun-09 13:15
sitebuilderLuc Pattyn18-Jun-09 13:15 
AnswerRe: Phone Pin
Not Active18-Jun-09 13:15
mentorNot Active18-Jun-09 13:15 
JokeRe: Phone Pin
musefan18-Jun-09 22:01
musefan18-Jun-09 22:01 
AnswerRe: Phone Pin
Christian Graus18-Jun-09 19:30
protectorChristian Graus18-Jun-09 19:30 
GeneralRe: Phone Pin
EliottA19-Jun-09 2:53
EliottA19-Jun-09 2:53 
QuestionC++ in C# Pin
Omar Gameel Salem18-Jun-09 10:11
professionalOmar Gameel Salem18-Jun-09 10:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.