Results 1 to 9 of 9

Thread: Desing VB GUI for a C .exe file

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    3

    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

  2. #2
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Desing VB GUI for a C .exe file

    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.

    IIF(Post.Rate > 0 , , )

  3. #3
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    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

    IIF(Post.Rate > 0 , , )

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    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 )

    IIF(Post.Rate > 0 , , )

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    3

    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

  9. #9
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    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.
    Last edited by wossname; Apr 8th, 2008 at 06:51 AM.
    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width