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

Managed C++/CLI

 
QuestionString pass by reference Pin
carlo.andreoli2-Oct-09 0:32
carlo.andreoli2-Oct-09 0:32 
AnswerRe: String pass by reference Pin
teejayem2-Oct-09 5:28
teejayem2-Oct-09 5:28 
GeneralRe: String pass by reference Pin
carlo.andreoli5-Oct-09 2:20
carlo.andreoli5-Oct-09 2:20 
QuestionDual Linkage Possible with Managed DLL? Pin
Richard Andrew x6430-Sep-09 13:13
professionalRichard Andrew x6430-Sep-09 13:13 
AnswerRe: Dual Linkage Possible with Managed DLL? Pin
Luc Pattyn30-Sep-09 13:30
sitebuilderLuc Pattyn30-Sep-09 13:30 
GeneralRe: Dual Linkage Possible with Managed DLL? Pin
Richard Andrew x6430-Sep-09 13:35
professionalRichard Andrew x6430-Sep-09 13:35 
GeneralRe: Dual Linkage Possible with Managed DLL? Pin
Luc Pattyn30-Sep-09 13:45
sitebuilderLuc Pattyn30-Sep-09 13:45 
AnswerRe: Dual Linkage Possible with Managed DLL? Pin
N a v a n e e t h30-Sep-09 17:19
N a v a n e e t h30-Sep-09 17:19 
This is possible using conditional compilation. You need to create managed and unmanaged methods in the header files separated with _MANAGED preprocessor symbol.

Consider the following code.
C++
//MixedAPI.h

#ifdef _MANAGED
   using System;
   using System::Runtime::InteropServices;
#endif

#include <string>

class MixedAPI
{
public:
#ifdef _MANAGED
    void TakeAString(gcroot<String^>); // Managed callers can see this
#else
    void TakeAString(std::string);  // Native users can only see this
#endif
};

//MixedAPI.cpp

void MixedAPI::TakeAString(gcroot<String^> str)
{
    // implementation
}

void MixedAPI::TakeAString(std::string str)
{
   // implementation
}
Smile | :)


GeneralRe: Dual Linkage Possible with Managed DLL? Pin
Richard Andrew x6430-Sep-09 17:22
professionalRichard Andrew x6430-Sep-09 17:22 
GeneralRe: Dual Linkage Possible with Managed DLL? Pin
N a v a n e e t h30-Sep-09 17:48
N a v a n e e t h30-Sep-09 17:48 
Questionusing unmanaged lib in managed class [modified] Pin
carlo.andreoli29-Sep-09 22:50
carlo.andreoli29-Sep-09 22:50 
QuestionRe: using unmanaged lib in managed class [modified] Pin
carlo.andreoli30-Sep-09 22:56
carlo.andreoli30-Sep-09 22:56 
AnswerRe: using unmanaged lib in managed class Pin
Richard MacCutchan30-Sep-09 23:40
mveRichard MacCutchan30-Sep-09 23:40 
GeneralRe: using unmanaged lib in managed class Pin
carlo.andreoli30-Sep-09 23:59
carlo.andreoli30-Sep-09 23:59 
GeneralRe: using unmanaged lib in managed class Pin
Richard MacCutchan1-Oct-09 0:56
mveRichard MacCutchan1-Oct-09 0:56 
GeneralRe: using unmanaged lib in managed class Pin
Richard MacCutchan1-Oct-09 1:38
mveRichard MacCutchan1-Oct-09 1:38 
GeneralRe: using unmanaged lib in managed class [modified] Pin
carlo.andreoli1-Oct-09 2:03
carlo.andreoli1-Oct-09 2:03 
GeneralRe: using unmanaged lib in managed class Pin
Richard MacCutchan1-Oct-09 2:29
mveRichard MacCutchan1-Oct-09 2:29 
GeneralRe: using unmanaged lib in managed class Pin
carlo.andreoli1-Oct-09 3:34
carlo.andreoli1-Oct-09 3:34 
GeneralRe: using unmanaged lib in managed class Pin
Richard MacCutchan1-Oct-09 5:21
mveRichard MacCutchan1-Oct-09 5:21 
Questioncli::array&lt;any^&gt;^ Array Pin
jashimu29-Sep-09 7:12
jashimu29-Sep-09 7:12 
AnswerRe: cli::array&lt;any^&gt;^ Array Pin
N a v a n e e t h29-Sep-09 17:58
N a v a n e e t h29-Sep-09 17:58 
GeneralRe: cli::array&lt;any^&gt;^ Array Pin
jashimu30-Sep-09 4:32
jashimu30-Sep-09 4:32 
GeneralRe: cli::array&lt;any^&gt;^ Array Pin
Richard MacCutchan30-Sep-09 22:18
mveRichard MacCutchan30-Sep-09 22:18 
GeneralRe: cli::array&lt;any^&gt;^ Array Pin
jashimu1-Oct-09 6:50
jashimu1-Oct-09 6:50 

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.