Convert VB to C++

Can i convert VB code to C++ code??
How can i convert the code??

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
Well... yes and no. You 'can' convert it. By understanding it, and writing something equivalent in C++ (which you have to understand first too). I don't think there is a 'converter' (as in, a program) for VB to C++ (nor do I think there is a need for one), but maybe someone was bored and made one anyways.
I think there are some programming language converters, but there's not much use of them ( IMO )
http://www.google.com/search?hl=&q=visual+basic+to+c%2B%2B+converter
The VB code uses a fancy wrapper for the Win32 DialogBox functionality.

You can use the GetOpenFileName() function to do what you want. (The Windows API provides a few convenience functions for common dialog boxes.)
http://www.google.com/search?btnI=1&q=msdn+GetOpenFileName

You will need to have a OPENFILENAME struct, initialize it the way you want it, and pass its address to the function.

Good luck!
Topic archived. No new replies allowed.