C# and C++

  • Thread starter Thread starter yellowblueyellow
  • Start date Start date
Y

yellowblueyellow

Hi,

I have a main function in C++ that works with command line arguments..
I need to convert to to a static void function that takes String
arguments and can be called using a C# project . How do I do this.
Thanks
 
Hi,

I have a main function in C++ that works with command line arguments..
I need to convert to to a static void function that takes String
arguments and can be called using a C# project . How do I do this.

"Convert" as in "rewrite"?

The basic idea is simple: you rewrite the function in C#, making it a
static void function and taking the String arguments you want.

If you want anything less vague than that, you need to be less vague about
your question.

Pete
 
Ok . so , I need to re write the function in C++ itself since it
cannot be written in C#. Then I want to call the C++ function from C#
using String arguments.
 
I have a main function in C++ that works with command line arguments..
I need to convert to to a static void function that takes String
arguments and can be called using a C# project . How do I do this.

Link it to a Win32 DLL instead of an EXE with the main as exported
entry point and simply DllImport in your C# code.

Arne
 
Ok . so , I need to re write the function in C++ itself since it
cannot be written in C#. Then I want to call the C++ function from C#
using String arguments.

Ask again on microsoft.public.dotnet.languages.vc, where we C++ experts can
help you without having dozens of C# programmers tell you to rewrite in C#.
Targetting .NET from C++/CLI is really quite straightforward, barely any
more difficult than C# for brand-new code, and much better for interfacing
to old code, source or binary, than p/invoke.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top