Click here to Skip to main content
15,906,567 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help a noob C++ user with C# (union and bitfields) Pin
led mike6-Sep-06 9:29
led mike6-Sep-06 9:29 
QuestionUsing propertygrids Pin
Hampus@foi6-Sep-06 4:56
Hampus@foi6-Sep-06 4:56 
AnswerRe: Using propertygrids Pin
led mike6-Sep-06 6:50
led mike6-Sep-06 6:50 
GeneralRe: Using propertygrids Pin
Hampus@foi6-Sep-06 20:01
Hampus@foi6-Sep-06 20:01 
GeneralRe: Using propertygrids Pin
led mike7-Sep-06 4:44
led mike7-Sep-06 4:44 
GeneralCS0029: Cannot Implicitly Convert Type... Pin
code-frog6-Sep-06 4:47
professionalcode-frog6-Sep-06 4:47 
GeneralRe: CS0029: Cannot Implicitly Convert Type... Pin
g00fyman6-Sep-06 4:59
g00fyman6-Sep-06 4:59 
GeneralRe: CS0029: Cannot Implicitly Convert Type... Pin
S. Senthil Kumar6-Sep-06 6:17
S. Senthil Kumar6-Sep-06 6:17 
GeneralRe: CS0029: Cannot Implicitly Convert Type... Pin
code-frog6-Sep-06 12:29
professionalcode-frog6-Sep-06 12:29 
QuestionRunning .net application as both windows and console mode. [modified] Pin
mhadamji6-Sep-06 3:46
mhadamji6-Sep-06 3:46 
AnswerRe: Running .net application as both windows and console mode. Pin
mikone6-Sep-06 4:14
mikone6-Sep-06 4:14 
AnswerRe: Running .net application as both windows and console mode. Pin
Colin Angus Mackay6-Sep-06 4:21
Colin Angus Mackay6-Sep-06 4:21 
QuestionRe: Running .net application as both windows and console mode. Pin
Nader Elshehabi6-Sep-06 5:55
Nader Elshehabi6-Sep-06 5:55 
AnswerRe: Running .net application as both windows and console mode. Pin
Colin Angus Mackay7-Sep-06 9:36
Colin Angus Mackay7-Sep-06 9:36 
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 

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.