ADGE devel on .NETfx
Last update:
2010/11/01 23:02 +0900
Overview
An experimental project … Rewrite ADGE, and make it run on Vista!
ADGE is written by rain` (member of DM.com).
I just enjoy rewrite of ADGE in my hobby.
Goals?
- Bring it on free development environment.
- VB6 is very old. (VB6 is ADGE's development environment.)
- VB6 is probably no more sold (because of 1998's old
product).
- It means maintenance is becoming difficult except
on primary developer.
- VB.net 2008 express is available, also available in very low cost.
- Remove dependent technology which is no more supported on recent
Windows.
- ADGE uses FM20. But it may not work on Windows Vista.
Issues:
- Resolve compiler errors which come from language's difference (between
VB6 and VB.net language).
- VB.net 2008 Express edition equips VB6-to-VB.net converter. I used
it for basic conversion.
The conversion has done without critical problems. However many compiler
errors appear after conversion.
It says you have to rewrite the source code and eliminate errors. It was
very curious work!
- Remove dependencies for FM20.dll.
- ADGE depends on some user interface controls imported from FM20. It
must be replaced with generic .net form controls.
- AxCommandButton
- AxImage
- AxListBox … Replace all of them with
ListView control. It is now powerful control!
2008.06.29
A screen shot is available. I published it at DM.com chat today midnight. It
took a full day to fix all compiler errors.
Example of rewriting a AxListBox
Replace the AxListBox control. Here is memo:
- Remember AxListBox's Name, ColumnCount, Location
and Size properties.
- Remove an AxListBox, then place ListView. And tweak it:
- Paste Name, Location and Size properties.
- Raise Columns dialog:
Click [Add] button to add new column until column count reaches number
of ColumnCount property.
- FullRowSelect → True
- GridLines → True
- HeaderStyle → None
- HideSelection → False
- MultiSelect → False
- View→ Details
Rewrite the code.
Before |
After |
---
In these days, developer tended to hate to prepare many objects (e.g.
allocate an item object per list item) because code cost and memory cost
extremely increases per object.
So all the manipulation is done through parent control like ListBox. |
---
.net controls ListView control adapt well object
oriented idea. item's attributes (focus status, multi-column texts, etc)
can be manipulated through each list item object
ListViewItem. |
DoorList.set_ListIndex(selecteddoor - 1)
---
VB's ListBox has ListIndex property to identify current focused
item. |
DoorList.Items(selecteddoor - 1).Focused =
True ---
.NET ListView control has no ListIndex property. Each list item (ListViewItem)
has
Focused property. Set it True to focus the item, then other list
item loses focus automatically. |
selectdoor(DoorList.get_ListIndex() + 1) |
selectdoor(DoorList.FocusedItem.Index + 1)
---
Use
FocusedItem property to locate the actively focused item. |
2008.07.03
Tips: how to remove AxCommandButton
For example, correct the button in RuneEditor form.
- Open RuneEditor.Designer.vb. Drag the file and drop into VB.net express
system.
- Find keyword "axcom".
- You'll find Ok and Cancel control variables uses
AxCommandButton class.
- Replace AxMicrosoft.Vbe.Interop.Forms.AxCommandButton with
System.Windows.Forms.Button. 4 items'll be replaced.
- You'll get errors like 'OcxState' is not a member of
'System.Windows.Forms.Button'. Just remove 2 lines which mention
OcxState errors. It is not needed for VB.net.
- Add 2 lines:
Me.Ok.Text =
"Ok"
Me.Cancel.Text =
"Cancel"
- Remove ISupportInitialize lines utilized for Ok and
Cancel controls:
- Resolve errors Event 'ClickEvent' cannot be found. Just
replace ClickEvent with Click.
→
- It's done!