Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
GeneralRe: Running .net application as both windows and console mode. Pin
mhadamji6-Sep-06 6:46
mhadamji6-Sep-06 6:46 
GeneralRe: Running .net application as both windows and console mode. Pin
Colin Angus Mackay7-Sep-06 9:37
Colin Angus Mackay7-Sep-06 9:37 
AnswerRe: Running .net application as both windows and console mode. Pin
mhadamji9-Sep-06 1:16
mhadamji9-Sep-06 1:16 
Questionhow can i find for a particular file in any logical drive Pin
Parshant Verma6-Sep-06 3:34
Parshant Verma6-Sep-06 3:34 
AnswerRe: how can i find for a particular file in any logical drive Pin
Niiiissssshhhhhuuuuu6-Sep-06 4:03
Niiiissssshhhhhuuuuu6-Sep-06 4:03 
AnswerRe: how can i find for a particular file in any logical drive Pin
mikone6-Sep-06 4:07
mikone6-Sep-06 4:07 
AnswerRe: how can i find for a particular file in any logical drive Pin
Utkarshraj Atmaram6-Sep-06 4:08
Utkarshraj Atmaram6-Sep-06 4:08 
Questioninterop: char* to what? ref string? [modified] Pin
Utkarshraj Atmaram6-Sep-06 3:31
Utkarshraj Atmaram6-Sep-06 3:31 
I am using a DLL written in C in my C# project.

The original C function goes like this:

char* SomeFunction(const SomeClass someObj, const void* ptr, char*  str, size_t strSize);


The value of str is changed in the function. This is how I've written in C# interop file:
Using size_t = System.UInt32;
...
...
[DllImport(DLLNAME)]
public static extern string SomeFunction(SomeClass someObj, IntPtr ptr, ref string str, size_t strSize);


While calling the function in C#, I am passing some uint value such as 1024 in place of strSize.

I am getting FatalExecutionEngineError on running the code:
Message: The runtime has encountered a fatal error.
The address of the error was at 0x79ef067e, on thread 0xfb8.
The error code is 0xc0000005.
This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code.
Common sources of this bug include user marshaling errors 
for COM-interop or PInvoke, which may corrupt the stack.


I have two more functions with parameters as char* in C, and ref string in C#. The program simply terminates after the control comes to these functions.

I am wondering if there is something wrong with char* and ref string?


-- modified at 10:05 Wednesday 6th September, 2006

Ut

AnswerRe: interop: char* to what? ref string? Pin
mikone6-Sep-06 4:13
mikone6-Sep-06 4:13 
AnswerRe: interop: char* to what? ref string? Pin
Judah Gabriel Himango6-Sep-06 4:54
sponsorJudah Gabriel Himango6-Sep-06 4:54 
GeneralRe: interop: char* to what? ref string? Pin
Utkarshraj Atmaram6-Sep-06 18:57
Utkarshraj Atmaram6-Sep-06 18:57 
Questionstatic library Pin
erfi6-Sep-06 2:46
erfi6-Sep-06 2:46 
AnswerRe: static library Pin
mikone6-Sep-06 2:49
mikone6-Sep-06 2:49 
AnswerRe: static library Pin
Nader Elshehabi6-Sep-06 3:03
Nader Elshehabi6-Sep-06 3:03 
QuestionHow to accept ints only textbox Pin
Yustme6-Sep-06 2:26
Yustme6-Sep-06 2:26 
AnswerRe: How to accept ints only textbox Pin
mikone6-Sep-06 2:43
mikone6-Sep-06 2:43 
GeneralRe: How to accept ints only textbox Pin
Yustme6-Sep-06 2:52
Yustme6-Sep-06 2:52 
AnswerRe: How to accept ints only textbox Pin
Tamimi - Code6-Sep-06 3:09
Tamimi - Code6-Sep-06 3:09 
GeneralRe: How to accept ints only textbox Pin
Yustme6-Sep-06 3:16
Yustme6-Sep-06 3:16 
QuestionNot able to Edit Custom DataGrid Control Pin
jssandeep6-Sep-06 2:25
jssandeep6-Sep-06 2:25 
AnswerRe: Not able to Edit Custom DataGrid Control Pin
mikone6-Sep-06 2:40
mikone6-Sep-06 2:40 
AnswerRe: Not able to Edit Custom DataGrid Control Pin
Muammar©10-Sep-06 0:30
Muammar©10-Sep-06 0:30 
QuestionWindows Service problem Pin
ranandbe6-Sep-06 2:06
ranandbe6-Sep-06 2:06 
AnswerRe: Windows Service problem Pin
Nader Elshehabi6-Sep-06 2:58
Nader Elshehabi6-Sep-06 2:58 
GeneralRe: Windows Service problem Pin
ranandbe6-Sep-06 21:05
ranandbe6-Sep-06 21:05 

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.