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
i m using SQL server 2005.in this i have a field "Place". i have made a form in which i have used drop down list in which these Place field is shown.in C# i want a code so that if user select the particular place from that drop down list, that should be entered in the database of SQL server 2005.i have made a add button on the form for the user to add the selected place in the database.the required coding i have to write in this add button.Please reply me urgently........