Sorry, but is the only way to use the C++ functions in C# with DLL?
I dont want to generate a DLL, because I have to change the C-files (_dllexport....). And when I have to change the C-files, it´s better to invest the time to writte the Code in C#
I want only to copy the C-Files into the managed/unmanged C++ Project without any changes, and than using the functions in C#.
As far as I know there are two common ways to do this. One is as mentioned (not particularly helpfully) through P/Invoke and use of attributes such as DLLImport. Note, I do not thing you need to recompile it as a DLL to achieve this.
The other (probably preferred method) is to change if possible the C executable into a C++/CLI or managed assembly. This will still allow you to use C for everything but you can then expose managed wrappers around the necessary functions for C# to call easily. In this instance you can simply add a reference to the project in Visual Studio and use it like it were another assembly written in C#.
You can't change most aspects of the standard messagebox directly. You could always create a custom form class that mimics the messagebox in order to do this. There is a really good custom messagebox class in the form of an article. I suggest you search for it.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
Last Visit: 31-Dec-99 19:00 Last Update: 26-Jan-21 18:27