Can i build a GUI using Visual Basic for a C program? I'm a beginner in VB. I need a dynamic GUI, i.e. when the user gives an input as 5 in the GUI there should be 5 text boxes displayed for the next set of inputs, if input is 6, 6 text boxes should be shown.
So the control should shift between VB and the C code several times. The input is requested from the user around 8 times and ultimately the output needs to be displayed on VB.
My C code is ready and now i need to build a GUI for this as a front end. I need to submit my project within 4 days so please please somebody help me out of this. I will be very thankful to you guys. Thanks a lot.
If you are just 'shelling' your VB application from C applicaiton, pass the number of controls as a command line argument and grab it in VB with Command function, then parse out the arguments, and based on them load the right amount of controls.
I suppose I'd tend to move the cart back around behind the horse for this.
The user interface would normally be the "client" that initiates and requests services from the "server." In this case it sounds like you only need to have the server service a single client, so you could use the standard parent/child process relationship and have them communicate via anonymous pipes.
For the C program this means just using the StdIO streams for I/O. This leaves most of the work to the VB program.
I have a control (ShellPipe) I use for this sort of thing, and it's pretty stable. You can add it to your VB Project and treat it as a "black box" just as if it were compiled as an external OCX or DLL. You can use one ShellPipe, several, or even a control array if you have multiple child processes to run and communicate with at the same time.
There isn't any need to look at or modify the code for most purposes. It does have documentation at the head of its source though, which is useful. If you add ShellPipe to a Project be sure to add its helper Class SmartBuffer too.
For this sample program (attached) I am using a WSH script running under CScript as the "server" standing in for your C program.
This sample just starts the server, which passes back a "number of numbers" to add. The client displays this many text boxes, then waits for user input (clicking its Add button). The client send the Add request and values to the server, the server adds the numbers, and then returns the sum and a new "number of numbers" to add. Cleanup/termination is managed by a Quit request from the client to the server.
dilettante
this is really cool... thanks a ton for this... i'll try this tonight n let u knw if it works or if i find any difficulties.. thanx a lot again