Hello World

This is a discussion on Hello World within the C++ Programming forums, part of the General Programming Boards category; Hi, I need to test some functionality between c++ and c#
I have this method
Code:
void SendOut(class std::basic_string<unsigned short,struct ...

Have you looked up "Hello world" in C++? That should give you some ideas.

Also, that is neither valid (class keyword not allowed in parameter lists, unnamed parameters technically allowed but a bad idea) nor a method (function not part of a larger class). Also, did you really try to build a string, not of characters, but of short ints? Why? (Or is that what the cool kids used these days instead of wchar_t?)

I am trying to use a 3rd party DLL interop with C#, problem is, there is no marshal for basic_string, so I need to create some kind of wrapper for it. My first attempt would be to simulate the class in order to see what is happening.

If you have a DLL, and they expect you to use it in C++, it should have a header file with it, which you would then #include. (If the functions are inside a namespace, you could do the using directive after that to save typing.) You would also need to make sure the linker knows about the DLL. (I have this vague recollection that it's #pragma import or something like that. You could search the forums since it's been asked before.)

You should probably lookup forward declarations if you're unclear on what they are. The simple solution is to add class MyListener; on a line above the myclass declaration. That might not work exactly for your real-world example, which is why it might be better for you to research that topic to understand better what is going on.

That's not a compile error. That's a linking error, which means everything is syntactically correct, but your program is in pieces. If you're in Visual Studio (which it looks like you are) then everything needs to be in one project (multiple files are fine, but one project) or you have to manually add the .obj files from the class into the current project.

No I mean in the project. If you have the .lib file, you don't have to put in the project; you merely need to add it to the linker commands (project properties, and then ... I forget where exactly. Poke around a little bit, you should see "additional libraries" or similar).