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

Managed C++/CLI

 
AnswerRe: Avoid if else... Pin
led mike11-Jun-09 4:36
led mike11-Jun-09 4:36 
AnswerRe: Avoid if else... Pin
LionAM13-Jun-09 21:25
LionAM13-Jun-09 21:25 
GeneralRe: Avoid if else... Pin
vikasvds14-Jun-09 21:36
vikasvds14-Jun-09 21:36 
QuestionRun external executable file in C++ Pin
wael_r11-Jun-09 2:11
wael_r11-Jun-09 2:11 
AnswerRe: Run external executable file in C++ Pin
vikasvds11-Jun-09 2:28
vikasvds11-Jun-09 2:28 
AnswerRe: Run external executable file in C++ Pin
Luc Pattyn11-Jun-09 3:23
sitebuilderLuc Pattyn11-Jun-09 3:23 
QuestionBeginning C++/CLI Question Pin
Shadowsoal9-Jun-09 13:39
Shadowsoal9-Jun-09 13:39 
AnswerRe: Beginning C++/CLI Question Pin
N a v a n e e t h9-Jun-09 16:30
N a v a n e e t h9-Jun-09 16:30 
Sound like homework question. But here you go..

Shadowsoal wrote:
A C++/CLI program with a function that takes a string as an argument, writes it into every entry of an array of length 5, and returns that array to the caller.

typedef array<System::String^> StringArray;

public ref class Foo
{
public:
	StringArray^ GetStringArray(System::String^ str)
	{
		StringArray^ a = gcnew StringArray(5);
		for(int i = 0; i < 5; i++)
		{
			a[i] = str;
		}
		return a;
	}
};

int main(StringArray^ args)
{
	Foo^ foo = gcnew Foo();
	StringArray^ a = foo->GetStringArray("Test");
	for each(String^ str in a)
	{
		Console::WriteLine(str);
	}
    return 0;
}

Shadowsoal wrote:
A C# program which invokes the above program.


In your C# project, add reference to the assembly you got from the above code. You will get access to class Foo.

Smile | :)


GeneralRe: Beginning C++/CLI Question Pin
Shadowsoal9-Jun-09 16:37
Shadowsoal9-Jun-09 16:37 
GeneralRe: Beginning C++/CLI Question Pin
N a v a n e e t h9-Jun-09 17:47
N a v a n e e t h9-Jun-09 17:47 
GeneralRe: Beginning C++/CLI Question Pin
Shadowsoal9-Jun-09 18:02
Shadowsoal9-Jun-09 18:02 
GeneralRe: Beginning C++/CLI Question Pin
N a v a n e e t h9-Jun-09 18:04
N a v a n e e t h9-Jun-09 18:04 
GeneralRe: Beginning C++/CLI Question Pin
Shadowsoal9-Jun-09 18:11
Shadowsoal9-Jun-09 18:11 
GeneralRe: Beginning C++/CLI Question Pin
Shadowsoal10-Jun-09 5:14
Shadowsoal10-Jun-09 5:14 
GeneralRe: Beginning C++/CLI Question Pin
N a v a n e e t h10-Jun-09 18:12
N a v a n e e t h10-Jun-09 18:12 
GeneralRe: Beginning C++/CLI Question Pin
Shadowsoal10-Jun-09 18:44
Shadowsoal10-Jun-09 18:44 
GeneralRe: Beginning C++/CLI Question Pin
N a v a n e e t h10-Jun-09 20:33
N a v a n e e t h10-Jun-09 20:33 
GeneralRe: Beginning C++/CLI Question Pin
Shadowsoal22-Jun-09 5:40
Shadowsoal22-Jun-09 5:40 
Question[Message Deleted] Pin
Richard Andrew x649-Jun-09 7:59
professionalRichard Andrew x649-Jun-09 7:59 
QuestionUnlockBits releases my Byte-Array Pin
cherrymotion9-Jun-09 3:27
cherrymotion9-Jun-09 3:27 
AnswerRe: UnlockBits releases my Byte-Array Pin
Luc Pattyn9-Jun-09 3:48
sitebuilderLuc Pattyn9-Jun-09 3:48 
GeneralRe: UnlockBits releases my Byte-Array Pin
cherrymotion9-Jun-09 6:14
cherrymotion9-Jun-09 6:14 
GeneralRe: UnlockBits releases my Byte-Array Pin
Luc Pattyn9-Jun-09 6:43
sitebuilderLuc Pattyn9-Jun-09 6:43 
AnswerRe: UnlockBits releases my Byte-Array Pin
Mark Salsbery9-Jun-09 6:45
Mark Salsbery9-Jun-09 6:45 
AnswerRe: UnlockBits releases my Byte-Array Pin
Mark Salsbery9-Jun-09 6:54
Mark Salsbery9-Jun-09 6:54 

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.