6 Replies - 339 Views - Last Post: 20 September 2012 - 09:33 PM Rate Topic: -----

#1 Sami_codes_AllDay  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 37
  • Joined: 09-August 11

Writing a GUI for an application in C

Posted 12 September 2012 - 03:49 PM

Hello Fellow DICers,

I've written an engine that cranks out some computations, whereby this engine is purely written in C. I'd like to "snaz" up this engine with a GUI that lies on top of it. I'd rather the users of this engine interact with a clean and simple GUI instead of the command line. I've been doing some reading about the matter, and found out that a lot of people recommend the following languages/libraries for GUI development: GTK, Java, and Python. Advantages? Disadvantages? Maybe another language would be recommended that is more industry standardized? Your thoughts would be of great help. Lastly, this application was developed on a Windows Vista machine.

Thank You,

Sami

Is This A Good Question/Topic? 0
  • +

Replies To: Writing a GUI for an application in C

#2 BenignDesign  Icon User is offline

  • holy shitin shishkebobs
  • member icon




Reputation: 6006
  • View blog
  • Posts: 10,435
  • Joined: 28-September 07

Re: Writing a GUI for an application in C

Posted 12 September 2012 - 04:18 PM

Not sure what forum this should go in.. but definitely not the Lounge.

I'ma leave it here and wait for the others who are far more competent than I 99% of the time.

This post has been edited by BenignDesign: 12 September 2012 - 04:19 PM
Reason for edit:: They're even more competent in sentence structure.

Was This Post Helpful? 0
  • +
  • -

#3 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,279
  • Joined: 28-March 11

Re: Writing a GUI for an application in C

Posted 12 September 2012 - 04:26 PM

We'll move this on over the the C/C++ forums, as they will be able to help you better than here.
Was This Post Helpful? 0
  • +
  • -

#4 Sami_codes_AllDay  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 37
  • Joined: 09-August 11

Re: Writing a GUI for an application in C

Posted 12 September 2012 - 05:04 PM

Oh man, that was mindless of me. I should've known better and placed it in the C/C++ forum. Thanks for placing it in it's proper forum.

Best,

Sami
Was This Post Helpful? 0
  • +
  • -

#5 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3540
  • View blog
  • Posts: 10,958
  • Joined: 05-May 12

Re: Writing a GUI for an application in C

Posted 12 September 2012 - 05:15 PM

Worst case, you could always write Win32 Windows code.

My thoughts an this though are, port the code over into DLL, and then compile the DLL with /CLR option to expose the functionality to managed code. Next write a WPF frontend whose sole job is to get input and display output. All other logic for computations is done by making calls into your DLL. The frontend can be written with either C# or VB.NET to support the UI logic.
Was This Post Helpful? 0
  • +
  • -

#6 Sami_codes_AllDay  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 37
  • Joined: 09-August 11

Re: Writing a GUI for an application in C

Posted 20 September 2012 - 08:42 PM

Hi SkyDiver,

Thank you for the valuable advice. Within a Windows environment, is it possible to simply write a frontend (in C#, VB.NET, etc)without the DLL compilation? I guess what I'm saying is, what is the necessity for the DLL compilation? Thanks.

Best,

Sami
Was This Post Helpful? 0
  • +
  • -

#7 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3540
  • View blog
  • Posts: 10,958
  • Joined: 05-May 12

Re: Writing a GUI for an application in C

Posted 20 September 2012 - 09:33 PM

Yes, you can make a .EXE written in C++ but compiled with the /CLR. I'm just not sure how you would go about making a mixed mode .EXE that has is core written in C++, but whose UI is in C#.

Using C++/CLI, you potentially write code that does WinForms, but I've not yet seen a C++/CLI app that does WPF.

With the DLL route, I was just trying plan for the contigency that you'd still want to be able to call the code from an unmanaged console application. By having the DLL, you'd only have the core engine in one place, but have different UI (console, WPF, WinForms, etc.) that can use the same core engine.

Also if you need to fix the code in the core engine, you only need to rebuild on DLL. If you port the code from your unmanaged C++ console program over to a managed C++ codebase, you'll need to remember to bring bug fixes across the different code bases and rebuild each one of them.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1