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

Managed C++/CLI

 
QuestionHELP: Fixed Length String ? Pin
Fritzables18-Jan-07 22:05
Fritzables18-Jan-07 22:05 
AnswerRe: HELP: Fixed Length String ? Pin
George L. Jackson19-Jan-07 0:24
George L. Jackson19-Jan-07 0:24 
GeneralRe: HELP: Fixed Length String ? Pin
Fritzables19-Jan-07 2:22
Fritzables19-Jan-07 2:22 
Questionlow language programing using c [modified] Pin
mervan18-Jan-07 22:04
mervan18-Jan-07 22:04 
AnswerRe: low language programing using c Pin
George L. Jackson19-Jan-07 0:27
George L. Jackson19-Jan-07 0:27 
AnswerRe: low language programing using c Pin
Christian Graus19-Jan-07 8:13
protectorChristian Graus19-Jan-07 8:13 
AnswerRe: low language programing using c Pin
Christian Graus21-Jan-07 0:36
protectorChristian Graus21-Jan-07 0:36 
QuestionCalling unmanaged methods with a managed delegate? Pin
Xpnctoc18-Jan-07 13:17
Xpnctoc18-Jan-07 13:17 
This is absolutely the most insane thing I've ever had to do in programming, and I don't even know if it's possible. Please help.

I have an app built with the /clr switch. I have a DLL that contains custom controls, built with the /clr:pure switch because building custom controls with the /clr switch freaks out the IDE designer and I get the message "Failed to load. Custom control will be removed from toolbox."

Now, the custom control in the DLL needs to trigger certain methods of an unmanaged class in the main app. If this was all managed code, I could use delegates. If this was all unmanaged code, I could use function pointers. But how do I pass the address of an unmanaged function to a managed class?

Right now, my unmanaged function signature is like:
public void MyClass::MyFunc(short);

My DLL control managed typedef is:
typedef void MyDllFunc(short); //matches the signature of the unmanaged main app method

My DLL control field is declared:
MyDllFunc *myCall;

In the main app I try to make the assignment:
myControl->myCall = &MyClass::MyFunc;

But I get the compiler error: "Cannot convert 'void(__thiscall MyClass::MyFunc::*)(short)' to 'void(__clrcall *)(short)'".

So what can I do to call an unmanaged function in the main app from a managed function in a DLL?
AnswerRe: Calling unmanaged methods with a managed delegate? Pin
Christian Graus18-Jan-07 13:41
protectorChristian Graus18-Jan-07 13:41 
AnswerRe: Calling unmanaged methods with a managed delegate? Pin
User 58385218-Jan-07 13:53
User 58385218-Jan-07 13:53 
AnswerRe: Calling unmanaged methods with a managed delegate? Pin
Mark Salsbery18-Jan-07 15:07
Mark Salsbery18-Jan-07 15:07 
GeneralRe: Calling unmanaged methods with a managed delegate? Pin
Xpnctoc18-Jan-07 15:24
Xpnctoc18-Jan-07 15:24 
QuestionDynamic event delegate and the 'this' pointer Pin
Peter JC18-Jan-07 12:55
Peter JC18-Jan-07 12:55 
QuestionForm1 to Form2, and Form2 to Form1 Pin
GSanchezDigitalProfile18-Jan-07 5:25
GSanchezDigitalProfile18-Jan-07 5:25 
AnswerRe: Form1 to Form2, and Form2 to Form1 Pin
Christian Graus18-Jan-07 10:09
protectorChristian Graus18-Jan-07 10:09 
GeneralRe: Form1 to Form2, and Form2 to Form1 Pin
GSanchezDigitalProfile18-Jan-07 22:13
GSanchezDigitalProfile18-Jan-07 22:13 
GeneralRe: Form1 to Form2, and Form2 to Form1 Pin
Christian Graus19-Jan-07 8:11
protectorChristian Graus19-Jan-07 8:11 
QuestionHow to Marshall (DLL::MyClass) object in a VS2005-C# App? Pin
jayart18-Jan-07 4:49
jayart18-Jan-07 4:49 
AnswerRe: How to Marshall (DLL::MyClass) object in a VS2005-C# App? Pin
led mike18-Jan-07 5:05
led mike18-Jan-07 5:05 
GeneralRe: How to Marshall (DLL::MyClass) object in a VS2005-C# App? Pin
jayart18-Jan-07 5:14
jayart18-Jan-07 5:14 
QuestionInsert dataset content into a local database table Pin
Vinod Moorkkan16-Jan-07 21:01
Vinod Moorkkan16-Jan-07 21:01 
AnswerRe: Insert dataset content into a local database table Pin
led mike18-Jan-07 5:07
led mike18-Jan-07 5:07 
QuestionRe-Compiling to utilize on different machines? New to CLI C++ Pin
bobbreton16-Jan-07 15:51
bobbreton16-Jan-07 15:51 
AnswerRe: Re-Compiling to utilize on different machines? New to CLI C++ Pin
Christian Graus17-Jan-07 9:30
protectorChristian Graus17-Jan-07 9:30 
QuestionOWL->MFC->C# Pin
StevenS_Dev16-Jan-07 10:37
StevenS_Dev16-Jan-07 10:37 

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.