Can I convert VB code to C ++ code

Is it possible to convert VB code to C ++? How can i do this?

This is my VB code:

Dim OpenFileDialog1 As New OpenFileDialog

With OpenFileDialog1
    .CheckFileExists = True
    .ShowReadOnly = False
    .Filter = "All Files|*.*|Bitmap Files (*)|*.bmp;*.gif;*.jpg"
    .FilterIndex = 2
    If .ShowDialog = DialogResult.OK Then
        ' Load the specified file into a PictureBox control.
        PictureBox1.Image = Image.FromFile(.FileName)
    End If
End With

      

+2


a source to share


2 answers


Well you can convert it to C ++ and using a graphics library might be the easiest way to do it.

I recommend using Qt . It's a fairly simple graphical framework that works across multiple platforms. We do not currently know which platform you are targeting, however I am assuming that you are targeting Windows as you showed the example in Visual Basic.



Usually, using the Qt QFileDialog

and classes QPicture

, you should quickly achieve your goal.

The framework comes with many simple examples. One of them is exactly what you ask.

+5


a source


Here is an MSDN example for OpenFileDialog using WinAPI.



+1


a source







All Articles