Click here to Skip to main content
16,007,814 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Converting byte[] to System::Byte[] and vice versa Pin
Martin Haesemeyer3-Feb-03 4:33
Martin Haesemeyer3-Feb-03 4:33 
GeneralRe: Converting byte[] to System::Byte[] and vice versa Pin
Paul Selormey3-Feb-03 13:29
Paul Selormey3-Feb-03 13:29 
GeneralOptimizing Event Implementation in MC++ Pin
Paul Selormey30-Jan-03 14:59
Paul Selormey30-Jan-03 14:59 
GeneralRe: Optimizing Event Implementation in MC++ Pin
Jeff J31-Jan-03 12:00
Jeff J31-Jan-03 12:00 
GeneralRe: Optimizing Event Implementation in MC++ Pin
Paul Selormey31-Jan-03 23:59
Paul Selormey31-Jan-03 23:59 
GeneralSerial Communication threw .NET C++ Pin
megadith28-Jan-03 3:50
megadith28-Jan-03 3:50 
QuestionHow to call the ::MessageBox ? Pin
roy_a24-Jan-03 23:13
roy_a24-Jan-03 23:13 
AnswerRe: How to call the ::MessageBox ? Pin
Jeff J25-Jan-03 10:29
Jeff J25-Jan-03 10:29 
You do not need to wrap MessageBox (or any other API call) with DllImport marshaling in MC++, unless you need to make it visible to other .Net languages (or other MC++ code). Unmanaged C++ can call API stuff as usual.

However, here is a version of MessageBox I have tried successfully with both MC++ and C#:


[DllImport("user32.dll", CharSet=Auto)]  //Unicode or ANSI<br />
int<br />
MessageBox(IntPtr hWnd, String *pText, String *pCaption, unsigned uType);



I believe you can use HWND as you defined it within MC++, though I am not sure how other .Net classes would feel about it. An IntPtr is a managed version of void* anyway, so that's what I used. The extern "C" bit is not necessary, and might not even be allowed. I have always used DllImports within a namespace, not globally, but I have used them both within and outside of class definitions.

Cheers
GeneralManaged C++ to PDA Pin
pjm31323-Jan-03 6:30
pjm31323-Jan-03 6:30 
GeneralRe: Managed C++ to PDA Pin
Jeff J25-Jan-03 10:08
Jeff J25-Jan-03 10:08 
Generalvisual designing of the forms Pin
suka23-Jan-03 5:19
suka23-Jan-03 5:19 
GeneralRe: visual designing of the forms Pin
Jeff J25-Jan-03 9:55
Jeff J25-Jan-03 9:55 
GeneralCrystal Report Pin
Exceter20-Jan-03 18:58
Exceter20-Jan-03 18:58 
GeneralCursors in .NET Assembly DLL Pin
Paul Selormey19-Jan-03 13:19
Paul Selormey19-Jan-03 13:19 
Generalarm animation Pin
Anonymous17-Jan-03 14:58
Anonymous17-Jan-03 14:58 
GeneralNo output from << operator in console app Pin
malmi17-Jan-03 10:51
malmi17-Jan-03 10:51 
GeneralRe: No output from << operator in console app - code correction Pin
malmi17-Jan-03 11:08
malmi17-Jan-03 11:08 
GeneralRe: No output from << operator in console app - code correction Pin
Jeff J18-Jan-03 0:17
Jeff J18-Jan-03 0:17 
GeneralRe: No output from << operator in console app - code correction Pin
malmi18-Jan-03 6:02
malmi18-Jan-03 6:02 
GeneralStupid question about VC6 to VC.Net migration reason Pin
Member 13901616-Jan-03 0:23
Member 13901616-Jan-03 0:23 
GeneralSystem::String/StringBuilder as out parameter Pin
Paul Selormey14-Jan-03 22:23
Paul Selormey14-Jan-03 22:23 
GeneralRe: System::String/StringBuilder as out parameter Pin
Jeff J15-Jan-03 10:16
Jeff J15-Jan-03 10:16 
GeneralRe: System::String/StringBuilder as out parameter Pin
Paul Selormey15-Jan-03 15:40
Paul Selormey15-Jan-03 15:40 
GeneralRe: System::String/StringBuilder as out parameter Pin
Paul Selormey15-Jan-03 15:48
Paul Selormey15-Jan-03 15:48 
GeneralRe: System::String/StringBuilder as out parameter Pin
Jeff J16-Jan-03 13:29
Jeff J16-Jan-03 13:29 

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.