Click here to Skip to main content
14,662,524 members
Home » Discussions » Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: VC7 Preprocessor variables not working. Pin
Jonathan [Darka]13-Jul-06 4:10
professionalJonathan [Darka]13-Jul-06 4:10 
GeneralRe: VC7 Preprocessor variables not working. Pin
Dave_Roach13-Jul-06 4:57
MemberDave_Roach13-Jul-06 4:57 
GeneralRe: VC7 Preprocessor variables not working. Pin
Jonathan [Darka]13-Jul-06 5:10
professionalJonathan [Darka]13-Jul-06 5:10 
GeneralRe: VC7 Preprocessor variables not working. Pin
Dave_Roach13-Jul-06 5:20
MemberDave_Roach13-Jul-06 5:20 
Questioncannot convert void * to System::Data::DataColumn Pin
arvindbhateja13-Jul-06 1:04
Memberarvindbhateja13-Jul-06 1:04 
AnswerRe: cannot convert void * to System::Data::DataColumn Pin
Jun Du13-Jul-06 2:09
MemberJun Du13-Jul-06 2:09 
GeneralRe: cannot convert void * to System::Data::DataColumn [modified] Pin
arvindbhateja13-Jul-06 2:29
Memberarvindbhateja13-Jul-06 2:29 
GeneralRe: cannot convert void * to System::Data::DataColumn Pin
Jun Du13-Jul-06 3:52
MemberJun Du13-Jul-06 3:52 
Handle(^) walks through the managed heap, while pointer(*) walks through the unmanaged heap. They don't see eye to eye.

arvindbhateja wrote:
I need to convert void* to System::Data::DataColumn^


You can't.

arvindbhateja wrote:
Eariler I converted managed (^) to unmanaged (*)

pclFields->AddTail ((void *) pclFieldInfo);


This is wrong. By doing so, you may have corrupted GC (garbage collection) on the managed heap. On the other hand, the managed C++ provides a mechanism to pin an object on the managed heap. The pinning is a process to temporarily keep the contant address of an object on the managed heap. Here is some sample code extracted from the C++/CLI spec:
void f(int* p) { *p = 100; } 
int main() { 
 array<int>^ arr = gcnew array<int>(100); 
 pin_ptr<int> pinp = &arr[0]; // pin arr s location 
 f(pinp); // change arr[0] s value 
}

You could consider this as a temporary "conversion" from managed to unmanaged. But I'm not aware of any "conversion" in the reverse direction.

Best,
Jun
GeneralRe: cannot convert void * to System::Data::DataColumn Pin
arvindbhateja13-Jul-06 4:00
Memberarvindbhateja13-Jul-06 4:00 
GeneralRe: cannot convert void * to System::Data::DataColumn Pin
Jun Du13-Jul-06 4:55
MemberJun Du13-Jul-06 4:55 
GeneralRe: cannot convert void * to System::Data::DataColumn [modified] Pin
arvindbhateja13-Jul-06 5:00
Memberarvindbhateja13-Jul-06 5:00 
GeneralRe: cannot convert void * to System::Data::DataColumn Pin
Jun Du13-Jul-06 6:02
MemberJun Du13-Jul-06 6:02 
GeneralRe: cannot convert void * to System::Data::DataColumn Pin
arvindbhateja13-Jul-06 23:45
Memberarvindbhateja13-Jul-06 23:45 
GeneralRe: cannot convert void * to System::Data::DataColumn Pin
Jun Du14-Jul-06 8:38
MemberJun Du14-Jul-06 8:38 
QuestionMoving the DrawnRectangle with mouse on the Form [modified] Pin
Nagaraju_Focus12-Jul-06 19:36
MemberNagaraju_Focus12-Jul-06 19:36 
AnswerRe: Moving the DrawnRectangle with mouse on the Form Pin
Jun Du13-Jul-06 2:03
MemberJun Du13-Jul-06 2:03 
GeneralRe: Moving the DrawnRectangle with mouse on the Form Pin
Nagaraju_Focus13-Jul-06 23:02
MemberNagaraju_Focus13-Jul-06 23:02 
GeneralRe: Moving the DrawnRectangle with mouse on the Form Pin
Jun Du14-Jul-06 2:10
MemberJun Du14-Jul-06 2:10 
GeneralRe: Moving the DrawnRectangle with mouse on the Form Pin
Nagaraju_Focus14-Jul-06 20:16
MemberNagaraju_Focus14-Jul-06 20:16 
GeneralRe: Moving the DrawnRectangle with mouse on the Form [modified] Pin
mertadin21-Jul-06 3:00
Membermertadin21-Jul-06 3:00 
QuestionC++ .NET Exception Pin
Pavan Rao12-Jul-06 19:21
MemberPavan Rao12-Jul-06 19:21 
AnswerRe: C++ .NET Exception Pin
Jonathan [Darka]12-Jul-06 21:54
professionalJonathan [Darka]12-Jul-06 21:54 
GeneralRe: C++ .NET Exception Pin
Pavan Rao12-Jul-06 22:56
MemberPavan Rao12-Jul-06 22:56 
GeneralRe: C++ .NET Exception Pin
Jonathan [Darka]12-Jul-06 22:58
professionalJonathan [Darka]12-Jul-06 22:58 
QuestionReleasing Managed Direct3D Device Pin
kevinFields12-Jul-06 6:16
MemberkevinFields12-Jul-06 6:16 

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.