Click here to Skip to main content
15,895,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to enerate random numbers in C# Pin
CPallini6-Apr-07 1:52
mveCPallini6-Apr-07 1:52 
QuestionHow to use Windbg for windows Pin
Farhan Ali6-Apr-07 0:37
Farhan Ali6-Apr-07 0:37 
AnswerRe: How to use Windbg for windows Pin
rp_suman6-Apr-07 2:18
rp_suman6-Apr-07 2:18 
QuestionConfiguration error! Pin
Nafiseh Salmani5-Apr-07 23:55
Nafiseh Salmani5-Apr-07 23:55 
AnswerRe: Configuration error! Pin
SABhatti6-Apr-07 6:00
SABhatti6-Apr-07 6:00 
QuestionGDIPlus Thread safeness Pin
a.mulay5-Apr-07 23:34
a.mulay5-Apr-07 23:34 
QuestionHelp for Window Service. Pin
blue_arc5-Apr-07 23:07
blue_arc5-Apr-07 23:07 
QuestionUsing a C++ function (defined in a dll) with char* param [modified] Pin
jozsurf5-Apr-07 22:35
jozsurf5-Apr-07 22:35 
Hi All,

I'm reasonably new to C# and have recently been coding parts of a C# user interface which operates in tandem with a C/C++ back-end. Things have been going O.K. until I had to make use of a function, whose prototype looks like this:

int functionName (const char* param1, const char* param2, char* nastyParam)

In my C# code, I have been dealing with the const char* params by mapping them to C# strings...that has been working quite well. Now the problem with nastyParam above is the intention is for the function to (possibly) return some string value to the caller via nastyParam. The following is what I have done thus far for the function above:

...<br />
      private static extern int functionName(<br />
            [MarshalAs(UnmanagedType.LPStr)] param1,<br />
            [MarshalAs(UnmanagedType.LPStr)] param2,<br />
            [MarshalAs(UnmanagedType.LPArray)] IntPtr nastyParam);


I've been trawling the net for solutions and came across a suggestion which involved mapping the char* to a C# IntPtr (as above)...the explanation in that article made sense to me, so I gave it a go but no luck thus far.

Anyone have any ideas?

cheers!


-- modified at 4:44 Friday 6th April, 2007
AnswerRe: Using a C++ function (defined in a dll) with char* param Pin
CPallini6-Apr-07 2:06
mveCPallini6-Apr-07 2:06 
AnswerRe: Using a C++ function (defined in a dll) with char* param Pin
Luc Pattyn6-Apr-07 4:31
sitebuilderLuc Pattyn6-Apr-07 4:31 
GeneralRe: Using a C++ function (defined in a dll) with char* param Pin
jozsurf6-Apr-07 16:46
jozsurf6-Apr-07 16:46 
GeneralRe: Using a C++ function (defined in a dll) with char* param Pin
jozsurf8-Apr-07 15:28
jozsurf8-Apr-07 15:28 
QuestionWebpage load Pin
linhuu5-Apr-07 22:01
linhuu5-Apr-07 22:01 
AnswerRe: Webpage load Pin
Stefan Troschuetz5-Apr-07 23:45
Stefan Troschuetz5-Apr-07 23:45 
AnswerRe: Webpage load Pin
Obaid ur Rehman5-Apr-07 23:49
Obaid ur Rehman5-Apr-07 23:49 
QuestionHow can i make exe of my appliction? Pin
Nekshan5-Apr-07 20:24
Nekshan5-Apr-07 20:24 
AnswerRe: How can i make exe of my appliction? Pin
Obaid ur Rehman5-Apr-07 20:34
Obaid ur Rehman5-Apr-07 20:34 
Questionxml document Pin
Tauseef A5-Apr-07 20:23
Tauseef A5-Apr-07 20:23 
Questionwhat are the new softwares for screen capturing [modified] Pin
khema5-Apr-07 19:49
khema5-Apr-07 19:49 
AnswerRe: what are the new softwares for screen capturing Pin
shrinerainxp5-Apr-07 21:35
shrinerainxp5-Apr-07 21:35 
GeneralRe: what are the new softwares for screen capturing Pin
khema8-Apr-07 18:05
khema8-Apr-07 18:05 
GeneralRe: what are the new softwares for screen capturing Pin
khema8-Apr-07 18:31
khema8-Apr-07 18:31 
Questionhow to know if someone visited my site? Pin
Nekshan5-Apr-07 19:36
Nekshan5-Apr-07 19:36 
QuestionHow to solve"Cross thread operation not valid" error when programming with C#.net Pin
sweenySL5-Apr-07 19:34
sweenySL5-Apr-07 19:34 
AnswerRe: How to solve"Cross thread operation not valid" error when programming with C#.net Pin
Obaid ur Rehman5-Apr-07 20:31
Obaid ur Rehman5-Apr-07 20:31 

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.