so i am using visual basic express edition 2010
i am now able to select an image and displaying it in the picture box.
now i need to run a c code (its exe file) by clicking a button in the vb form.
i was able to this too by procss.start
now when i am doing this the c code needs one input which is the file or image that i am searching and displaying in the picture box.. so that will be the input of the c code.
i want to give that input directly to the c code or rather to its exe file without needing to type it manually.
when i will click the button the exe file will run and the input will be given automatically so i will get the output..
can anyone please help?
i hope i was clear :(

If your reading the specific file or image from specific location then you could code it in C application which is EXE which your running when clicking button on vb form.

no the user will choose the image by another vb button :( and that will be the input

Then you need to ask the user to select image or file using the openfile something like below

Dim objFile As New OpenFileDialog
        objFile.ShowDialog()
        Dim filepath As String = ""
        If Windows.Forms.DialogResult.OK Then

            filepath = objFile.FileName
        End If

File path will have the path selected by user this you need to pass to your EXE.

i have asked the user to select the file
i have then displayed that in a picturebox
i have now even figuered out how to pass the input to the exe too
but now i am facing another problem.

  1. i am pressing one button>choosing the file>and the file is displayed
    this same imagefile path is passed to exe as input the exe is stopping
  2. if i am opening and displaying one image and sending imagepath of another image to the exe then the exe is working properly

i guess the image file needs to freed or something after its selection and display??.. i am not sure.. can you help?

I am not sure what you are asking about. your exe is not able to read the file which you pass through vb code?

This article has been dead for over six months. Start a new discussion instead.