Click here to Skip to main content
15,882,329 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
Questioncan anybody tell me where ....? Pin
Banks K21-Dec-06 1:35
Banks K21-Dec-06 1:35 
AnswerRe: can anybody tell me where ....? Pin
led mike21-Dec-06 4:46
led mike21-Dec-06 4:46 
QuestionValue classes and structs Pin
kristmun20-Dec-06 21:47
kristmun20-Dec-06 21:47 
AnswerRe: Value classes and structs Pin
led mike21-Dec-06 4:50
led mike21-Dec-06 4:50 
QuestionConverting a IntPtr to HWND ? Pin
Fritzables20-Dec-06 17:08
Fritzables20-Dec-06 17:08 
AnswerRe: Converting a IntPtr to HWND ? Pin
User 58385220-Dec-06 18:38
User 58385220-Dec-06 18:38 
GeneralRe: Converting a IntPtr to HWND ? Pin
Fritzables21-Dec-06 10:41
Fritzables21-Dec-06 10:41 
QuestionPassing Reference to Thread Delegate Pin
ricecake20-Dec-06 8:54
ricecake20-Dec-06 8:54 
I am using Managed C++ (VS .NET 2003 SP1), so I can't use any of the new features in C++/CLI (VS 2005).

I have a function that needs to take in a const reference to a native class, e.g.,
void MyManagedClass::f(const UnmanagedClass& u);
If I just call it straight, like (inside another member function of MyManagedClass):
UnmanagedClass u;
f(u);
then it works OK. However, I would like to call this function in another thread. I have something like this, but it doesn't work:
__delegate System::Void ThreadDelegate(const UnmanagedClass&);
// ...
UnmanagedClass u;
ThreadDelegate* td = new ThreadDelegate*(this, f);
Object* args[] = new Object*[1];
args[0] = &u;
Invoke(td, args);

The problem is passing the parameter to the delegate. I would rather not have to write a managed wrapper for my unmanaged class if it can easily be avoided. Is there any way to do what I want? I have tried putting in __nogc in various parts of the array declaration but I can't get it to compile.

--
Marcus Kwok

QuestionDispatching based on Names Pin
ComplexLifeForm19-Dec-06 21:33
ComplexLifeForm19-Dec-06 21:33 
AnswerRe: Dispatching based on Names Pin
bsaksida19-Dec-06 22:16
bsaksida19-Dec-06 22:16 
GeneralRe: Dispatching based on Names Pin
ComplexLifeForm20-Dec-06 0:15
ComplexLifeForm20-Dec-06 0:15 
AnswerRe: Dispatching based on Names Pin
led mike20-Dec-06 4:46
led mike20-Dec-06 4:46 
QuestionReading & Writing Config Files Pin
mactick19-Dec-06 20:36
mactick19-Dec-06 20:36 
AnswerRe: Reading & Writing Config Files Pin
bsaksida19-Dec-06 22:21
bsaksida19-Dec-06 22:21 
QuestionRe: Reading & Writing Config Files Pin
mactick19-Dec-06 23:22
mactick19-Dec-06 23:22 
AnswerRe: Reading & Writing Config Files Pin
bsaksida19-Dec-06 23:29
bsaksida19-Dec-06 23:29 
QuestionRe: Reading & Writing Config Files Pin
mactick19-Dec-06 23:34
mactick19-Dec-06 23:34 
AnswerRe: Reading & Writing Config Files Pin
bsaksida20-Dec-06 0:24
bsaksida20-Dec-06 0:24 
AnswerRe: Reading & Writing Config Files Pin
led mike20-Dec-06 4:33
led mike20-Dec-06 4:33 
QuestionHi!!! Pin
alijon19-Dec-06 18:39
alijon19-Dec-06 18:39 
AnswerRe: Hi!!! Pin
kristmun19-Dec-06 20:07
kristmun19-Dec-06 20:07 
AnswerRe: Hi!!! Pin
Mark Salsbery20-Dec-06 12:41
Mark Salsbery20-Dec-06 12:41 
QuestionCan a class object in Dialog based application serialized? Pin
Sunil Jampa19-Dec-06 15:54
Sunil Jampa19-Dec-06 15:54 
GeneralRe: Can a class object in Dialog based application serialized? Pin
prasad_som19-Dec-06 20:44
prasad_som19-Dec-06 20:44 
QuestionListView Headrs Pin
bsaksida19-Dec-06 10:23
bsaksida19-Dec-06 10:23 

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.