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

Managed C++/CLI

 
GeneralRe: Make executable file Pin
jucanpo5-Sep-06 6:23
jucanpo5-Sep-06 6:23 
GeneralRe: Make executable file Pin
toxcct5-Sep-06 21:31
toxcct5-Sep-06 21:31 
AnswerRe: Make executable file Pin
led mike5-Sep-06 6:28
led mike5-Sep-06 6:28 
QuestionGDI+ DrawPie problem? Bugs? Pin
moonreflection20005-Sep-06 5:23
moonreflection20005-Sep-06 5:23 
AnswerRe: GDI+ DrawPie problem? Bugs? Pin
Jun Du5-Sep-06 13:55
Jun Du5-Sep-06 13:55 
GeneralRe: GDI+ DrawPie problem? Bugs? Pin
moonreflection20006-Sep-06 10:17
moonreflection20006-Sep-06 10:17 
GeneralRe: GDI+ DrawPie problem? Bugs? Pin
Jun Du6-Sep-06 10:39
Jun Du6-Sep-06 10:39 
Questioncalling managed code from unmanaged code (vc6) Pin
Dragan Matic5-Sep-06 1:24
Dragan Matic5-Sep-06 1:24 
we have an older application that we would like to extend with managed code (written in c#). The extension was planned to be through a dll written in C++ that would call managed part - as proposed in the following article: http://www.codeproject.com/dotnet/bridge.asp

problem is that when I write a simple non-managed app in VC2005, I can call managed part without any problem, but when I try to call it from the same application compiled with VC6, it simply breaks.

here is the C# assembly code:

namespace ClassLibrary1
{
public class Class1
{
public static int ShowDialog(string sText, string sCaption)
{
System.Windows.Forms.MessageBox.Show(sText, sCaption);
return 0;
}
}
}

here is the wrapper C++ dll

using namespace System;
using namespace ClassLibrary1;
using namespace System::Windows::Forms;

extern "C" __declspec(dllexport) int __cdecl callDotNet(char *text, char *caption)
{
String ^sText = gcnew String(text);
String ^sCaption = gcnew String(caption);

// MessageBox::Show("about to enter Class1");
Class1::ShowDialog(sText, sCaption);
return 0;
}

and here is the simple console app that calls a DLL that calls C# code:

extern "C" __declspec(dllexport) int __cdecl callDotNet(char *text, char *caption);

int main(int argc, char* argv[])
{
callDotNet("sample text", "sample caption");
return 0;
}

This works if it is compiled in VS2005 but breaks when compiled in VC6 (unhandled exception in console2.exe (KERNEL32.DLL): 0xE0434F4D:(no name).)
Unfortunately it is not possible to recompile the old application with VC2005 since it is pretty old application with a lots of code written in cobol.

This may be a newbie question or has been discussed before, but I searched the message boards and could't find anything similar. I am not sure at all that it is possible to connect unmanaged code with managed code this way. Am I on the right track? Tnx in advance

Dragan Matic
AnswerRe: calling managed code from unmanaged code (vc6) Pin
led mike5-Sep-06 9:50
led mike5-Sep-06 9:50 
GeneralRe: calling managed code from unmanaged code (vc6) Pin
Dragan Matic5-Sep-06 21:56
Dragan Matic5-Sep-06 21:56 
GeneralRe: calling managed code from unmanaged code (vc6) Pin
led mike6-Sep-06 5:16
led mike6-Sep-06 5:16 
QuestionIcon information?? Pin
Sgg2453-Sep-06 19:12
Sgg2453-Sep-06 19:12 
AnswerRe: Icon information?? [modified] Pin
WillemM4-Sep-06 5:29
WillemM4-Sep-06 5:29 
Questionwhat is the implementation? Pin
robeelyn2-Sep-06 5:02
robeelyn2-Sep-06 5:02 
AnswerRe: what is the implementation? Pin
Jun Du2-Sep-06 5:44
Jun Du2-Sep-06 5:44 
GeneralRe: what is the implementation? Pin
bryce20-Sep-06 19:22
bryce20-Sep-06 19:22 
QuestionTricky bug in a VC 8.0 compiler (preprocessor) [modified] Pin
FilipStrugar1-Sep-06 15:32
FilipStrugar1-Sep-06 15:32 
AnswerRe: Tricky bug in a VC 8.0 compiler (preprocessor) Pin
FilipStrugar2-Sep-06 12:07
FilipStrugar2-Sep-06 12:07 
Questiongmtime on WinCE giving local time Pin
dummy80831-Aug-06 18:10
dummy80831-Aug-06 18:10 
QuestionDeclaring a String object as an automatic variable Pin
juju_hli31-Aug-06 8:41
juju_hli31-Aug-06 8:41 
AnswerRe: Declaring a String object as an automatic variable Pin
Nish Nishant31-Aug-06 9:00
sitebuilderNish Nishant31-Aug-06 9:00 
GeneralRe: Declaring a String object as an automatic variable Pin
juju_hli31-Aug-06 9:03
juju_hli31-Aug-06 9:03 
QuestionHow to combine all emls into a dbx via programming Pin
Parshant Verma30-Aug-06 2:24
Parshant Verma30-Aug-06 2:24 
QuestionSelecting an item in listview via windows api. Pin
Marco225030-Aug-06 2:16
Marco225030-Aug-06 2:16 
QuestionGetting Icon information from which application is run Pin
Sgg24530-Aug-06 0:14
Sgg24530-Aug-06 0:14 

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.