Unless it is managed C++ you cannot import the class. If it is managed C++ then what you have as an Assembly which can be added by adding a reference to it in the project and by putting a using myNamespace at the top of the C# file you want to use the managed C++ class in.
128 bit encrypted signature, crack if you can
I usually create a bridge written in C++ managed which creates one managed class and namespace that could be later imported into C#, but underneath this managed C++ class works with that actual and normal C++ class any way it is expected to work with this class, either I compile them together or I import dll and call this class internally.
This bridge serves several good purposes: to test what actually I need in C# from that C++ class. Only those things pass the bridge. Second the bridge is an excellent place to check if parameters are passed correctly and if some of them have to be arranged differently: pointers, arrays... all need different treatment in C# and C++.
If you don't have this bridge, but you directly call a C++ procedure from C# then you have to think about this inside C# code every time you call a specific C++ function. And then if you want to use the same C++ class again, the same problem. With bridge you just import it and everything is tested.
How can i find out process path?
i am using following code for getting process file name. i need to get the path of that file also. Can any one help me??
Process arrProcesses = Process.GetProcesses();
for (int i = 0; i <= arrProcesses.Length - 1; i++)
Process objProcess = arrProcesses[i];
if (objProcess.ProcessName == "WINWORD" && !(objProcess.MainWindowHandle == IntPtr.Zero))
string FileNameDefault = objProcess.MainWindowTitle;
str1 = FileNameDefault.Split('-');
// System.IO.Path pt=objProcess.exe
FileNameDefault = str1;
GetProcessesByName() returns an array, just like GetProcesses() does; it probably will be a shorter array, but you may still want to enumerate it.
Luc Pattyn [Forum Guidelines][My Articles] - before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
I have using sockets to communicating with our client applications. In the server application Listener i mentioned backlog 200 but most of the times the connection queue holds below 100 requests only. In this case some times when client try to connect .Net throw an error which says the queue was full. After that Listener will not take any new connections and it just close socket immediatly.
ListenSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint ipLocal = new IPEndPoint(IPAddress.Any, 4098);
ListenSocket.BeginAccept(new AsyncCallback(OnClientConnect), null);
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
I dont understand what is happening there............
I need to insert a char in the beginning of the XML file. Char is “?”.
Tried with binary writer but it inserted few extra characters also.
Has anybody faced similar issue?
Or is there any other way to do it ?
I solved that problem now i using a sql query for retrieving a record from a student table i am selecting class from drop down like Class A and then the data of class A name of students will display in list box and then i select one name of class A from list box and want to display data in grid view i am writing query like
string rec = "select * from student_biodata where student_name = '" + liststudent.Text + "' ";
But one problem is that if i am selecting name like 'a' then two record displayed in grid view like 'a' of class A and 'a' of Class B so what should i do please guide me correct query as i can get only one record.