Article View: pl.comp.lang.vbasic
Article #98Re: Converting programs from VB3.0 to VB5.0
From: pa... Pawe³ Pluta
Date: Thu, 30 Oct 1997 00:00
Date: Thu, 30 Oct 1997 00:00
63 lines
3413 bytes
3413 bytes
On Tue, 28 Oct 1997 13:50:00 -0500, "Brandon Moro" <galac...@geocities.com>
wrote:
>Is there any way (or program) to convert VB3 programs to VB5?
>
>Thanx!
>Brandon
There is the way. I have been porting from 30 to 40, but I think
to 50 is similar.
I have made short howto for my own use, but I think you may find
it useful. Here are two versions, Polish and English.
-----------------------------------------------------------------
Przenoszenie kodu z VB 3.0 do VB 4.0 (16 do 32 bit�w)
Do wczytanego projektu (*.MAK) trzeba do��czy� wersje OCX komponent�w
nienale��cych do standardowego wyposa�enia VB. Zachowa� trzeba tylko projekt,
ale �aden z plik�w �r�d�owych.
W plikach �r�d�owych trzeba zamieni� stare nazwy kontrolek na nowe:
SSOption = Threed.SSOption
SSPanel = Threed.SSPanel
SSCheck = Threed.SSCheck
SSFrame = Threed.SSFrame
VBSQL = VbsqlLib.Vbsql
(To oczywiscie przyklady, kazdy musi po swojemu.)
Typy Snapshot, Dynaset i Table trzeba zast�pi� typem Recordset, a procedury
CreateSnapshot(*, 64) itp. zast�pi� przez OpenRecordset(*, dbOpenSnapshot,
64)
Po tych zmianach projekt mo�na wczyta� ponownie. Konieczne jest dopasowanie
wygl�du niekt�rych typ�w obiekt�w, poniewa� przez niekompatybilno�� zapis�w
cz�� properties ustawiana jest na warto�ci domy�lne. W ca�ym projekcie trzeba
przeprowadzi� konwersj� typ�w zmiennych w zwi�zku z inn� reprezenatcj�
standardow� w wersjach 16 i 32 bitowych. To jest istotne, kiedy np. DLL zwraca
32 bitowy int, a VB laduje to w 16 bitowego integera.
-------------------------------------------------------------------------
Porting code from VB30 to VB40
Into the loaded *.MAK add OCX versions of controls not being standard VB
equipment. Save only the *.MAK, but none of the code files.
In the code files change the old VBX names to new OCX:
SSOption = Threed.SSOption
SSPanel = Threed.SSPanel
SSCheck = Threed.SSCheck
SSFrame = Threed.SSFrame
VBSQL = VbsqlLib.Vbsql
(Of course these are only the examples, exeryone has to make own changes.)
The Snapshot, Dynaset and Table have to be substituted with Recordset type
and the CreateSnapshot(*,xx) and similar procedures with
OpenRecordset(*, dbOpenSnapshot{or Dynaset or Table}, xx).
After these changes the project can be loaded again. Now there is a need to
adjust some objects, because some properties can be restored to their
defaults. All the project has to be checked for variable types due to
differences in standard Win32 against Win16 types. This may hurt when e.g.
a DLL returns 32 bit int, and VB loads it into 16 bit integer.
----------------------------------------------------------------------------
Pawel Pluta
I niechaj mowa wasza bedzie 1, 1, 0, 0.
A wszystko co wiecej jest, ode zlego jest.
Technical Details
Message-ID:
<34583e61.2203288@news.ict.pwr.wroc.pl>Path:
mbox-mo1.pugleaf.net!unknown!not-for-mailReferences:
<635fkq$3dk$1@news.gator.net>Show Full Headers
Complete Article Headers
From: pa...@mrd.com.pl (Pawe³ Pluta) Subject: Re: Converting programs from VB3.0 to VB5.0 Date: 1997/10/30 Message-ID: <34583e61.2203288@news.ict.pwr.wroc.pl> X-Deja-AN: 285943530 References: <635fkq$3dk$1@news.gator.net> Reply-To: pa...@mrd.com.pl Organization: Technical University of Wroclaw, Poland Newsgroups: microsoft.public.vb.enterprise,microsoft.public.vb.syntax,pl.comp.lang.vbasic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit