Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer to New Computer 2

Status
Not open for further replies.

TOMBUGGY

Programmer
Oct 4, 2000
36
US
I have VB6 installed and working well on one computer. Within the VB6 folder under the Microsoft Visual Studio folder I have 12 VB projects and their related data files. Some of the projects use 3rd party components (.ocx).

How do I recreate what I have on another computer? Thanks.
 
You will have to install the VB6.0 programming environment, and install all the 3rd party ocx's. Then you can simply copy the files over to the new machine.

Note: If however you open these projects up on the new machine and find that the 3rd party controls raise errors, you will need to remove the resulting picture boxes and re-add the control to the project and to the form. Then you will have to duplicate its properties, especially its name.



Good Luck

 
The 3rd party controls DID raise errors and resulted in blank picture boxes. One of these controls is a command button (Better Button) that is used extensively in some of the projects. It's going to take a fair amount of work to record the properties for respecification when the controls are added back to the forms, including name, background color, caption, etc.

Bummer!
 
Yes but if you reinstall the Better Button activex (and development licence file) onto the new machine and then reload the old project you won't have to replace anything because the project will load without errors.

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Andy, thanks for what I hoped would be a great solution. I reinstalled Better Button but when I reload the project I still get the Picture Boxes. Do I need to uninstall/reinstall Better Button? Might I need to recopy the contents of the VB98 folder from the old computer to the new computer to get the original project files? FWIW, the new computer is running Windows 7.
 
I'm experiencing another (and strange) problem. When I run one of the projects I get a "Can't find project or library" compile error message On an If Right(.... statement with Right highlighted. What can be missing to cause an error with such a fundamental statement?
 
Regarding Better Button - if you opened a project without the ActiveX on your system VB would have replaced all the controls with picture boxes. If you then tried to run it with "Save project before running" selected then all those picture boxes would be permanently saved - same if you closed VB and saved the project. Yes, the answer is to re-copy your source code and re-open the project.

Regarding the Right( statement, I can't think why you'd get an error. Have you downloaded and installed VB SP6? That wouldn't fix the error but it won't to do it. If all else fails, post the lines of code which are causing the error.

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Andy, thanks. Reloading the source code solved all the control problems. The problem with the If Right statement continues. SP6 is installed. Here's the code section (If Right in bold):

Public ApplicationDataFolder As String 'Constants for Get Special Folders
Public ProgramFilesFolder As String
Public CommonFilesFolder As String
Public UserProfileFolder As String
Public WindowsFolder As String
Public WindowsSystemFolder As String
Public UserProfileTempFolder As String
Public SystemDrive As String 'Returns Drive Letter and Colon (C:)
Public AllUsersAppDataFolder As String

Private Declare Function lstrcat Lib "kernel32.dll" Alias "lstrcatA" _
(ByVal lpstring1 As String, lpstring2 As String) As Long

Private Sub GetSpecialFolders()
Dim Length As Integer

ApplicationDataFolder = FixPath(fGetSpecialFolderLocation(CSIDL_LOCAL_APPDATA)) & "Randem Systems\" & App.EXEName & "\"
CommonFilesFolder = FixPath(fGetSpecialFolderLocation(CSIDL_PROGRAM_FILES_COMMON))
ProgramFilesFolder = FixPath(fGetSpecialFolderLocation(CSIDL_PROGRAM_FILES))

If ProgramFilesFolder = "" And CommonFilesFolder <> "" Then
ProgramFilesFolder = CommonFilesFolder
If Right(ProgramFilesFolder, 1) = "\" Then Mid(ProgramFilesFolder, Len(ProgramFilesFolder), 1) = " "
ProgramFilesFolder = Mid(ProgramFilesFolder, 1, InStrRev(ProgramFilesFolder, "\"))
End If
 
There's nothing wrong with that code so it should compile and run fine. If you go to Project > References, what's ticked? You should have (ticked):

Visual Basic for Applications
(C:\Program Files\Microsoft Visual Studio\VB98\VBA6.DLL)

Visual Basic runtime objects and procedures
(C:\Windows\System32\msvbvm60.dll\3)

Visual Basic objects and procedures
(C:\Program Files\Microsoft Visual Studio\VB98\VB6.OLB)

OLE Automation
(C:\Windows\System32\stdole2.tlb)

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Thread222-1557667

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
George, you nailed it! Thanks. I had a missing reference for a Dymo Label Printer library (a printer not yet installed on the new computer). Why a missing reference for a printer affects standard VB statements is wierd but unchecking the reference solved the problem.

BTW, with respect to Andy's last input, all the references he noted are present but the reference to Visual Basic for Applications is to ....System32\msvbm60.dll, not to ....VB98\VBA6.dll. However, the VBA6.dll file is in the VB98 subfolder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top