Thread: Combining C code with C# for GUI

  1. #1
    Registered User
    Join Date
    Nov 2014
    Posts
    2

    Combining C code with C# for GUI

    Hello,
    I have been working on this project for about 2 weeks and i'm pretty much ready with the code.It's a program that makes statistical analysis for a group of students and you can choose the operations from the menu below:
    Code:
    ============================================
                        Menu
    ============================================
    1. Add student records
    2. Delete student records
    3. Update student records
    4. View all student records
    5. Calculate an average of a selected student’s scores
    6. Show student who gets the max total score
    7. Show student who gets the min total score
    8. Find student by ID
    9. Sort records by total scores
    Now I want to make a GUI for the program.Since I want to develop some skills in C# i though I would make the GUI in C#.So my question is can I combine the code in C for the main program with a GUI made in C#?
    If it's important I can upload the code in C,but only if its necessary,since it will stretch the main post and make it inconvenient.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Try looking up "platform invoke" on MSDN. That will require building your C code as a DLL (with functions to be called from C#).

    For a simple project like you describe, it might be easier to rewrite/repackage your C code as C#.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Nov 2014
    Posts
    2
    Thanks for the reply.I decided to rewrite the program in C#.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Combining C and C++ code together (Linux)
    By dr_jaymahdi in forum C++ Programming
    Replies: 5
    Last Post: 05-11-2010, 10:04 AM
  2. combining c with c++ code
    By verbatimline in forum C++ Programming
    Replies: 3
    Last Post: 07-22-2008, 12:04 PM
  3. Combining several variables into one
    By h3ro in forum C++ Programming
    Replies: 39
    Last Post: 04-24-2008, 10:03 AM
  4. combining C and C++
    By volk in forum C Programming
    Replies: 7
    Last Post: 03-18-2003, 08:41 PM
  5. Combining C && C++ Code
    By drtriedl in forum C++ Programming
    Replies: 3
    Last Post: 02-12-2002, 01:48 PM

Tags for this Thread