Desing VB GUI for a C .exe file
Hi all,
I have a project which required the algorithm to be developed using C.
As youll knw designing a GUI in c can be tedious, but i heard from a friend of mine a GUI can be developed in VB and communicate with the c .exe file.
However, after hours of search in the net i couldn't find anything. can anyone of you guys/girls help me.
Best of regards
Re: Desing VB GUI for a C .exe file
Quote:
friend of mine a GUI can be developed in VB and communicate with the c .exe file.
Doubt about this. It would be possible , but wont be easy and neat as done using either vb or C.
Cant you develop the Algorithm in VB?
Or develop the whole app using GUI friendly version of C.
(VC++ or C#) ?
If you give some idea about this algorithm, may be someone would give you a better solution.
:wave:
Re: Desing VB GUI for a C .exe file
You can access Methods in C DLL files from VB (as long as they've been designed correctly) Perhaps that was what your friend was thinking about.
Re: Desing VB GUI for a C .exe file
Yes, and instead of a C exe you do it all in dlls so its just interfacing withthe exposed functions, methods and properties etc.
Re: Desing VB GUI for a C .exe file
Ah. C DLL :d
when he was telling a C EXE, what came to mind was a DOS app :D
:wave:
Re: Desing VB GUI for a C .exe file
Well he can still use a C exe but passing messages back and forth is more work then having a dll instead. There is no real reason to use a C exe though if this is the proposed design.
Re: Desing VB GUI for a C .exe file
Yeah thats why I thought its possible but very hard to do and could be buggy.
a DLL fits fine there, as long as its designed correctly as Doogle has pointed.
(But I have no idea how to design a DLL in C :eek:)
:wave:
Re: Desing VB GUI for a C .exe file
Thx guys,
I really appreciate your replies.
Although i have not done it i will look into how to create .dll and use it
Anyway, For my project we are to design the application in C, however i though it would get me more marks if i design a GUI. From what i understand designing a GUI in C is quite hard. so thats why i wanted to look at how VB could help me out. Anyway THx again guys. If u have any more suggestion pls to post it, i surely appreciate it
Re: Desing VB GUI for a C .exe file
An alternative would be to have the VB interface capture the stdin and stdout streams of the existing C app and have the VB app impersonate a person at the keyboard. Actually this is very easy and has the added bonus that you don't have to alter the C application at all.
In VB, use the Windows API to locate and start the C app, then capture its IO streams. From that point on all you have to do is write strings to the stdin stream of the C app and then listen for the C app's responses on its stdout stream. This pretty much makes the VB app a dumb-terminal, all the clever stuff is handled by the existing C app.
From a coding point of view the only tricky bit is actually capturing the streams to start with. Once that's done its basically just impersonating what the user would type if he was using the C app physically with a keyboard.
A lot of unix system tools have this kind of relationship with their optional GUI. Basically it means that you can have one standard C app and then you can use it with or without the GUI, depending on your needs. No configuration outside the apps is required.
All of this is straightforward to do in VB6.
This approach is sometimes adopted when the C app is intended for use on more than one platform and/or is old and not easily reworked. It's actually quite similar to client/server programming but with a single user instead of many.