Integrate C code with C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, All
I am new to improving user interface. I have some questions for all the experts here who could help me out in this aspect.

Now, I am in the early stage of developing a new user inteface for a computation intensive application program which has a character-based user interface now. The original program was written in C. For the new graphical interface, I am thinking of using C#. But I am not sure whether it is feasible or too tedious to integrate all the functions written in C with the new interface that will be written in C#.

Is C# the right choice? Or another language will be a better idea to develop a new graphical user interface

Thanks a lot in advance for any help on the subject

Alison
 
Alison,

C# would be as good a .NET language as any other. The functionality is
in the System.Windows.Forms assembly, and its object model, not in the C#
language itself. That being said, you could use any .NET language you
wished.

As for accessing the functionality in the C code, if your code exposes
the functions that are exported through DLLs, then you should be able to
access those functions though the P/Invoke layer.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alison said:
Hello, All,
I am new to improving user interface. I have some questions for all the
experts here who could help me out in this aspect.
Now, I am in the early stage of developing a new user inteface for a
computation intensive application program which has a character-based user
interface now. The original program was written in C. For the new graphical
interface, I am thinking of using C#. But I am not sure whether it is
feasible or too tedious to integrate all the functions written in C with the
new interface that will be written in C#.
Is C# the right choice? Or another language will be a better idea to
develop a new graphical user interface?
 
It seems to me another option could be if he actually has the c code for
this project to compile it as a .NET assembly. This will make it easier to
use in his project. In addition to making it easier it will probably cut
down on the overhead that is incured when switching between managed and
unmanaged code.The only problem that comes up is that the c code might then
run slower so some testing is going to need to be done to see if the
overhead from switching between managed and unmanaged code is more than the
performance decrease by making it managed c/c++. After reading some sutff by
the managed directx team and watching an interview with the chief architect
it seems that the hit from going over com or dll boundries was more than
they were willing to accept. It all depends on how critical your application
is.



Nicholas Paldino said:
Alison,

C# would be as good a .NET language as any other. The functionality is
in the System.Windows.Forms assembly, and its object model, not in the C#
language itself. That being said, you could use any .NET language you
wished.

As for accessing the functionality in the C code, if your code exposes
the functions that are exported through DLLs, then you should be able to
access those functions though the P/Invoke layer.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alison said:
Hello, All,
I am new to improving user interface. I have some questions for all the
experts here who could help me out in this aspect.
Now, I am in the early stage of developing a new user inteface for a
computation intensive application program which has a character-based user
interface now. The original program was written in C. For the new graphical
interface, I am thinking of using C#. But I am not sure whether it is
feasible or too tedious to integrate all the functions written in C with the
new interface that will be written in C#.
Is C# the right choice? Or another language will be a better idea to
develop a new graphical user interface?
Thanks a lot in advance for any help on the subject.

Alison
 
Nicholas
Thanks a lot for your reply. You did give me some hints on how to carry on the project
Have a great day
Aliso

----- Nicholas Paldino [.NET/C# MVP] wrote: ----

Alison

C# would be as good a .NET language as any other. The functionality i
in the System.Windows.Forms assembly, and its object model, not in the C
language itself. That being said, you could use any .NET language yo
wished

As for accessing the functionality in the C code, if your code expose
the functions that are exported through DLLs, then you should be able t
access those functions though the P/Invoke layer

Hope this helps


--
- Nicholas Paldino [.NET/C# MVP
- (e-mail address removed)

Alison said:
Hello, All
I am new to improving user interface. I have some questions for all th
experts here who could help me out in this aspectcomputation intensive application program which has a character-based use
interface now. The original program was written in C. For the new graphica
interface, I am thinking of using C#. But I am not sure whether it i
feasible or too tedious to integrate all the functions written in C with th
new interface that will be written in C#
 
Dave
I do have the C source code. You pointed out something I am also concerned about. I should not compromise too much the speed of the computational power of the original program. The ideal situation is to develop a much user-friendly graphical interface without affecting much of the functionality of the application program itself. Since I have no previous experience in doing this kind of project, I am kind of at loss about how to set up the bridge between the new interface and the original program

Thanks a lot for your idea

Aliso

----- Dave Quigley wrote: ----

It seems to me another option could be if he actually has the c code fo
this project to compile it as a .NET assembly. This will make it easier t
use in his project. In addition to making it easier it will probably cu
down on the overhead that is incured when switching between managed an
unmanaged code.The only problem that comes up is that the c code might the
run slower so some testing is going to need to be done to see if th
overhead from switching between managed and unmanaged code is more than th
performance decrease by making it managed c/c++. After reading some sutff b
the managed directx team and watching an interview with the chief architec
it seems that the hit from going over com or dll boundries was more tha
they were willing to accept. It all depends on how critical your applicatio
is



Nicholas Paldino said:
Alison
C# would be as good a .NET language as any other. The functionalit
i
in the System.Windows.Forms assembly, and its object model, not in the C
language itself. That being said, you could use any .NET language yo
wished
As for accessing the functionality in the C code, if your code expose
the functions that are exported through DLLs, then you should be able t
access those functions though the P/Invoke layer
Hope this helps
- Nicholas Paldino [.NET/C# MVP
- (e-mail address removed)
Hello, All
I am new to improving user interface. I have some questions for all th
experts here who could help me out in this aspectcomputation intensive application program which has a character-based use
interface now. The original program was written in C. For the ne graphica
interface, I am thinking of using C#. But I am not sure whether it i
feasible or too tedious to integrate all the functions written in C wit th
new interface that will be written in C#
 
Back
Top