Click here to Skip to main content
15,902,939 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# in windows visat?! Pin
Dan Neely28-Jun-06 9:10
Dan Neely28-Jun-06 9:10 
GeneralRe: C# in windows visat?! Pin
Steve Maier28-Jun-06 9:51
professionalSteve Maier28-Jun-06 9:51 
GeneralRe: C# in windows visat?! Pin
Dustin Metzgar28-Jun-06 9:22
Dustin Metzgar28-Jun-06 9:22 
GeneralRe: C# in windows visat?! Pin
BoneSoft28-Jun-06 10:38
BoneSoft28-Jun-06 10:38 
GeneralRe: C# in windows visat?! Pin
Nader Elshehabi28-Jun-06 11:12
Nader Elshehabi28-Jun-06 11:12 
GeneralRe: C# in windows visat?! Pin
BoneSoft28-Jun-06 14:53
BoneSoft28-Jun-06 14:53 
GeneralRe: C# in windows visat?! Pin
Dan Neely29-Jun-06 2:21
Dan Neely29-Jun-06 2:21 
Questionunmanaged DLL access from C# Pin
farquem828-Jun-06 3:06
farquem828-Jun-06 3:06 
I am attempting to access functions from an unmanaged C DLL. One of these is generating an Unhandled Exception: "attempt to read or write protected memory".

I have examples similar to mine on the web, all of which come down to the need for manual intervention in Marshaling. However, the function causing the problem for me returns void, and I can find no examples which deal with this case. Is this because I am barking up the wrong tree?

DLL function prototype:

<br />
void GetRNGstate(void);<br />



C# Code:

<br />
class TestLink<br />
    {<br />
        [DllImport("X.dll")]<br />
        [return: MarshalAs(UnmanagedType.IUknown)]<br />
        public static extern void GetRNGstate();<br />
<br />
        ...<br />
<br />
        static void Main()<br />
        {<br />
<br />
            GetRNGstate(); // Unhandled Exception<br />
<br />
            ...<br />
        }<br />
    }<br />



Any assistance appreciated.
AnswerRe: unmanaged DLL access from C# Pin
Rojan Gh.28-Jun-06 3:33
professionalRojan Gh.28-Jun-06 3:33 
AnswerRe: unmanaged DLL access from C# Pin
leppie28-Jun-06 7:28
leppie28-Jun-06 7:28 
AnswerRe: unmanaged DLL access from C# Pin
Rojan Gh.28-Jun-06 11:08
professionalRojan Gh.28-Jun-06 11:08 
QuestionUrgent Pin
Shiv528-Jun-06 2:55
Shiv528-Jun-06 2:55 
AnswerRe: Urgent Pin
Dan Neely28-Jun-06 3:06
Dan Neely28-Jun-06 3:06 
GeneralClickety Police Pin
Colin Angus Mackay28-Jun-06 5:50
Colin Angus Mackay28-Jun-06 5:50 
AnswerRe: Urgent Pin
J4amieC28-Jun-06 3:44
J4amieC28-Jun-06 3:44 
AnswerRe: Urgent Pin
Josh Smith28-Jun-06 3:48
Josh Smith28-Jun-06 3:48 
GeneralRe: Urgent [modified] Pin
User 665828-Jun-06 3:58
User 665828-Jun-06 3:58 
GeneralRe: Urgent Pin
Josh Smith28-Jun-06 5:11
Josh Smith28-Jun-06 5:11 
GeneralRe: Urgent Pin
Paul Conrad28-Jun-06 8:00
professionalPaul Conrad28-Jun-06 8:00 
GeneralRe: Urgent Pin
BoneSoft28-Jun-06 10:34
BoneSoft28-Jun-06 10:34 
AnswerRe: Urgent Pin
stancrm28-Jun-06 3:58
stancrm28-Jun-06 3:58 
GeneralRe: Urgent Pin
_AK_28-Jun-06 4:01
_AK_28-Jun-06 4:01 
AnswerRe: Urgent Pin
_AK_28-Jun-06 4:03
_AK_28-Jun-06 4:03 
AnswerRe: Urgent Pin
Super Lloyd28-Jun-06 5:38
Super Lloyd28-Jun-06 5:38 
QuestionUrgent Pin
Shiv528-Jun-06 2:50
Shiv528-Jun-06 2:50 

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.