Convert a VB6 project back to VB5

If you load a VB6 project file in the VB5 environment you get a warning, even though the project is correctly loaded. The cause of the warning is a VB6 attribute “Retained” (that is, the “Retained in memory” option in the Project Properties dialog box) that isn’t recognized by VB5. If you want to make a VB6 .vbp file backward campatibile with VB5 you can convert it using the following routine:

' Convert a VB6 VBP file so that it can be read' into VB5 IDE without any error'' Returns True if successful,' False if the project was already in VB5 formatFunction ConvertVB6Project(ByVal filename As String) As Boolean    Dim fnum As Long    Dim fileText As String    Dim i As Long        fnum = FreeFile    ' if the file doesn't exist, this statement raises an error    Open filename For Input As #fnum    ' read the entire fire and close it    fileText = Input$(LOF(fnum), fnum)    Close #fnum        ' strip the "Retained" attribute    ' we could easily delete it using the Replace function    ' but we want this function to work under VB5 as well    ' for obvious reasons    i = InStr(1, fileText, "Retained=", vbTextCompare)    ' if not found this is a VB5 project file    If i = 0 Then Exit Function        ' delete this line (account for the CRLF)    fileText = Left$(fileText, i - 1) & Mid$(fileText, _        i + Len("Retained=0") + 2)        ' save to the same file    Open filename For Output As #fnum    Print #fnum, fileText;    Close #fnum        ' signal success    ConvertVB6Project = TrueEnd Function

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

Top 5 B2B SaaS Marketing Agencies for 2023

In recent years, the software-as-a-service (SaaS) sector has experienced exponential growth as more and more companies choose cloud-based solutions. Any SaaS company hoping to stay ahead of the curve in this quickly changing industry needs to invest in effective marketing. So selecting the best marketing agency can mean the difference

technology leadership

Why the World Needs More Technology Leadership

As a fact, technology has touched every single aspect of our lives. And there are some technology giants in today’s world which have been frequently opined to have a strong influence on recent overall technological influence. Moreover, those tech giants have popular technology leaders leading the companies toward achieving greatness.

iOS app development

The Future of iOS App Development: Trends to Watch

When it launched in 2008, the Apple App Store only had 500 apps available. By the first quarter of 2022, the store had about 2.18 million iOS-exclusive apps. Average monthly app releases for the platform reached 34,000 in the first half of 2022, indicating rapid growth in iOS app development.