3 Replies - 1082 Views - Last Post: 19 August 2007 - 10:03 AM Rate Topic: -----

#1 Servo Wizard  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 12-July 07

Need help with VB6 code to C++ code

Posted 18 August 2007 - 09:24 AM

Hello,

I'm attempting to learn the C++ programming language. I did some programming in QBasic 25 years ago so I was able to use that experience along with some Monkey See, Monkey Do to learn the Visual Basic programming language, but with C++ there are too many Monkeys going to many different directions. I have also tried a couple of the leading code converter programs and neither one of them can create working C++ code.

I need help with coding the following vb6 code in cpp:

Public Function BitStr(IntVal As Integer) As String
	   Do While IntVal >= 1
		  If IntVal And 1 Then
			 BitStr = "1" & BitStr
		  Else
			 BitStr = "0" & BitStr
		  End If
		  IntVal = IntVal \ 2
	   Loop
	   BitStr = Format(Val(BitStr), "00000000")
	   MsgBox BitStr
End Function


I'm guessing that it would be best to have it as a header file.

Servo

This post has been edited by born2c0de: 18 August 2007 - 10:33 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Need help with VB6 code to C++ code

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Need help with VB6 code to C++ code

Posted 18 August 2007 - 09:27 AM

Servo Wizard, post the code you're attempted in this quest and we will glady help you walk through it. We're not going to just convert it for you though :)

PS: When posting your code, please use code blocks
Was This Post Helpful? 0
  • +
  • -

#3 Servo Wizard  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 12-July 07

Re: Need help with VB6 code to C++ code

Posted 19 August 2007 - 09:39 AM

View PostPsychoCoder, on 18 Aug, 2007 - 09:27 AM, said:

Servo Wizard, post the code you're attempted in this quest and we will glady help you walk through it. We're not going to just convert it for you though :)

PS: When posting your code, please use code blocks


PsychoCoder,

Thanks for your help, it along with staying up all night with a splitting headache, which I developed from the extreme frusteration, I finally accomplished coding my first C++ program.

Don't laugh, remember the wright brothers flight, it was the spring board for the Boeing 747.

I'm really glad that you did not give me the code. I would have learned a couple of things, but I would have missed out on all of the other things that I was exposed to while learning how to do a couple of things.

Servo
Was This Post Helpful? 0
  • +
  • -

#4 Xing  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 19
  • View blog
  • Posts: 725
  • Joined: 22-July 06

Re: Need help with VB6 code to C++ code

Posted 19 August 2007 - 10:03 AM

What is the purpose of your VB6 code? What are advertised requirements and advertised promises?

This post has been edited by Xing: 19 August 2007 - 10:04 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1