VB6 upon loading converts adodc to pictureBox - vb6

Setup windows 10 running and compiling vb6 for our product.
Haven't had issues until recently and my handling of git caused some errors so I had to reload things in from our original copy on another machine.
The issue lies within the form section of my project and I have finally discovered what is causing the issue.
The original issue was though I had the proper components and references loaded in and i could see it in my object browser it failed to use it and gave me the error: method or data member not found
After tons of searching I found out the it was converting
what was suppose to be an adodc into a picture box
Height = 375
Left = -63480
Top = 480
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 240
CommandTimeout = 240
CursorType = 2
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"frmDP.frx":0EAA
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
However when you open up the project it labels this as well as at least I've found ```TrueOleDBGrid80.TDBGrid````
to also be labeled and properties set as a pictureBox
I've verified i have the libraries on my machine and are registered.
I've made sure the components and references that are required to use these are also choosen and applied
Reference=*\G{6B263850-900B-11D0-9484-00A0C91110ED}#1.0#0#..\..\..\..\Windows\SysWow64\msstdfmt.dll#Microsoft Data Formatting Object Library 6.0 (SP4)
Reference=*\G{00000206-0000-0010-8000-00AA006D2EA4}#2.6#0#..\..\..\..\Program Files (x86)\Common Files\System\ado\msado26.tlb#Microsoft ActiveX Data Objects 2.6 Library
Reference=*\G{3D5C6BF0-69A3-11D0-B393-00A0C9055D8E}#1.0#0#..\..\..\..\Program Files (x86)\Common Files\designer\msderun.dll#Microsoft Data Environment Instance 1.0 (SP4)
Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#..\..\..\..\Windows\SysWOW64\scrrun.dll#Microsoft Scripting Runtime
Reference=*\G{00025E01-0000-0000-C000-000000000046}#5.0#0#..\..\..\..\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll#Microsoft DAO 3.6 Object Library
Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; mscomctl.ocx
Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX
Object={CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0; msdatgrd.ocx
Object={C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0; msmask32.ocx
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; ComDlg32.ocx
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; richtx32.ocx
Object={248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0; mswinsck.ocx
Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx
Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.ocx
Object={E7BC34A0-BA86-11CF-84B1-CBC2DA68BF6C}#1.0#0; ntsvc.ocx
Object={562E3E04-2C31-4ECE-83F4-4017EEE51D40}#8.0#0; todg8.ocx
I can manually recreate it though I did not make this myself and more so was put into this section and have had to dig a lot to understand a lot of these things.
The answer i am trying to find is why aren't these being created the way theyre coded to be created.
Or how can i convert these over and have vb6 fix it itself/

Related

How to change the color of the dot inside a radio button with Resource Hacker

I’m trying to modify the color of the dot inside a radio button with Resource Hacker. I managed to change the color of the circle/frame but not the dot inside. I looked everywhere online and found similar examples but doesn’t exactly suit me with my situation. I guess all I need is the right syntax format. I tried so many different code combinations to no avail since I’m a newbie in coding. I’d really appreciate if you could help me out. The exact code I’m fiddling is below. Many thanks in advance.
object ScanCandidateGrp: TRzRadioGroup
Left = 103
Top = 34
Width = 64
Height = 66
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = []
TextShadowColor = clActiveBorder
GroupStyle = gsCustom
ItemFrameColor = clRed << I managed to change the circle color with this
ItemHotTrack = True
ItemHighlightColor = clBlue
ItemHotTrackColor = clGreen
ItemIndex = 0
Items.Strings = (
'Bob'
'Alex'
'Sue')
ParentFont = False
StartXPos = 2
StartYPos = 0
TabOrder = 0
Transparent = True
VerticalSpacing = 5
OnClick = ScanCandidateGrpClick
end

Configuring FireDac for cross platform development using Firebird 2.5

I am creating a cross platform data aware app for windows and os x using Delphi 10.1 Berlin and firebird. My Mac is running El Capitan. My PC is running in Parallels virtual machine on the Mac.
The app on each platform is to connect to a firebird 2.5 server located on a Win 2008 server. The win32 version compiles and connects without a problem. The one for OS X, however, does not.
I have already downloaded and installed FB 2.5 on my Mac and set up PAserver properly. For example, I have been able to connect to firebird on the Windows server from my Mac using RazorSQL. I have also been able to compile a very simple "Hello world" project with just a button and a ShowMessage dialog and run it on the Mac. So, I am sure PAserver is running correctly.
I created a barebones data aware application for testing. Here is the form in text format:
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 480
ClientWidth = 640
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
DesignerMasterStyle = 0
object StringGrid1: TStringGrid
Align = Client
CanFocus = True
ClipChildren = True
Size.Width = 640.000000000000000000
Size.Height = 440.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
RowCount = 0
Viewport.Width = 636.000000000000000000
Viewport.Height = 415.000000000000000000
end
object ToolBar1: TToolBar
Size.Width = 640.000000000000000000
Size.Height = 40.000000000000000000
Size.PlatformDefault = False
TabOrder = 7
object NavigatorBindSourceDB1: TBindNavigator
Position.X = 176.000000000000000000
Position.Y = 7.000000000000000000
Size.Width = 241.000000000000000000
Size.Height = 25.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
DataSource = BindSourceDB1
xRadius = 4.000000000000000000
yRadius = 4.000000000000000000
end
end
object FDConnection1: TFDConnection
Params.Strings = (
'Database=E:\Shared Folders\Employees\Firebird\Databases\Test.fdb'
'User_Name=SYSDBA'
'Password= (intentionally deleted)'
'Protocol=TCPIP'
'Server=afmsasrv'
'Port=3024'
'ExtendedMetadata=True'
'CharacterSet=win1252'
'DriverID=FB25')
Connected = True
LoginPrompt = False
Left = 440
Top = 112
end
object FDGUIxWaitCursor1: TFDGUIxWaitCursor
Provider = 'FMX'
Left = 344
Top = 120
end
object FDTable1: TFDTable
Active = True
IndexFieldNames = 'ID'
Connection = FDConnection1
UpdateOptions.UpdateTableName = 'PERSON'
TableName = 'PERSON'
Left = 272
Top = 128
end
object DataSource1: TDataSource
DataSet = FDTable1
Left = 216
Top = 128
end
object BindSourceDB1: TBindSourceDB
DataSet = FDTable1
ScopeMappings = <>
Left = 304
Top = 224
end
object BindingsList1: TBindingsList
Methods = <>
OutputConverters = <>
Left = 20
Top = 5
object LinkGridToDataSourceBindSourceDB1: TLinkGridToDataSource
Category = 'Quick Bindings'
DataSource = BindSourceDB1
GridControl = StringGrid1
Columns = <>
end
end
end
When I run the project I get the error below:
[FireDAC][Phys]-300. Driver [FB25] is not registered. Correct driver ID or define [FB25] virtual driver in FDDrivers.ini'. Process Project1 (1114)
I have added FDDrivers.ini to my project, as indicated in Embarcadero's FireDac documentation. Here are the contents.
[FDDrivers.ini]
Encoding=UTF8
[FB25]
; FB25 virtual driver will use specified Firebird client library
BaseDriverID=FB
VendorLibWin32=C:\firebird\fb25_W32\bin\fbclient.dll
VendorLibWin64=C:\firebird\fb25_64\bin\fbclient.dll
VendorLibOSX32=/Library/Frameworks/Firebird.framework/Libraries/Versions/A/libfbclient.dylib
Any ideas on how to get this to work?

Form property automatically changing on saving changes in VB6 (configured with VSS 2005)

I am facing below issue in VB6 :
When I checkout file file and check "Show differences" it is showing no difference (identical files) but when I save my changes without changing and form property and again check for differences in VSS , it is showing difference in few property.One of them is mentioned below.Kindly suggest.
Begin VB.Label CommStatus
BackColor = &H80000014&
BorderStyle = 1 'Fixed Single
BeginProperty Font
**Name = "Arial"** 'this property is changing
Size = 8.25
Charset = 204
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 375
Left = 240
TabIndex = 3
ToolTipText = "The most recently detected error"
Top = 360
Width = 7815
End
You can check attach image
After looking in to this, the reason for seems to be Windows zoom setting (100%,125% and 150%, control panel/Make text and other items larger or smaller). If the form is checked in to TFS/VSS/GIT in one zoom setting, and later edited in another, VB6 will change all kind of form properties to adjust for this. So this probably only happens in dev teams with 2+ users that happens to have different screen sizes and therefor different zoom settings.
Only way to avoid this is probably to all use the same zoom setting...

Shell_NotifyIcon NIF_INFO not showing icons

Im having issues with balloons firstly they refused to show at all but having found this thread:
Why aren't Shell_NotifyIcon balloon tips working?
then changing cbSize to 504 the balloons show but without icons in them, all the standard icons won't show nor will a custom icon, structure looks like this:
cbSize = 504
hWnd = HDL
uID = 10
uFlags = NIF_INFO
szInfo = sBody
uTimeout = 20000
szInfoTitle = sTitle
dwInfoFlags = NIIF_ERROR
does anyone know of a reason why the icons will fail? (Have tried all the structure sizes and uVersion in the various combinations)
Edit:
S.cbSize = 504;
S.hWnd = HDL;
S.uID = 101;
S.uFlags = NIF_MESSAGE + NIF_ICON + NIF_TIP;
S.uCallbackMessage = 0x4DE;
S.hIcon = iHDL;
S.szTip = sTooltip;
S.uVersion = 3;
S.dwInfoFlags = NIIF_NONE;
Shell32.Shell_NotifyIconA(NIM_ADD,S:GetPointer())
Shell32.Shell_NotifyIconA(NIM_SETVERSION,S:GetPointer())
That's used to create the tray icon and it does:
All the callback messages work with the change tooltip/change icon/set focus/delete tray icon functions also working as expected on XP and Win 8.1 all using cbSize = 504 and uVersion = 3 with Ansi NIM_SETVERSION and NOTIFYICONDATA, balloons will show its just no icons will show not even the default ones:
S.cbSize = 504;
S.hWnd = HDL
S.uID = 101
S.uFlags = NIF_INFO
S.szInfo = sBody
S.uTimeout = 20000
S.szInfoTitle = sTitle
S.dwInfoFlags = NIIF_ERROR
Shell32.Shell_NotifyIconA(NIM_MODIFY,S:GetPointer())
Using size of structure for cbSize works for everything but balloons, they wont even show, and that size reports as 688.
cbSize=504 is only meaningful if you are using the Ansi versions of Shell_NotifyIcon() and NOTIFYICONDATA, are using the XP (v3) version of NOTIFYICONDATA, and your compiler's alignment settings are actually aligning the NOTIFYICONDATA fields correctly so the XP fields line up to exactly 504 bytes. Without seeing your actual code, your compiler settings, or any context information at all, there is no way to troubleshoot your problem further.

How to remove all code from multiple VB6 .frm files and leave form design?

I have a large VB6 app with many .frm files. I want to basically 'gut' the code from all the forms and just leave the GUI design.
What would be the best way to perform this task quickly?
If you really have enough forms that you can't just open each form and Ctrl + A, Del, Ctrl + S Then you can always write a quick VB program to do it. Visual Basic puts the information needed to display the form at the beginning of the file followed by the code. Copy each .frm file to a backup, open it and write everything up to the last Attribute ... line to a new file with the original file name. Pretty dirty, but should only take about 15-20 minutes to write and leaves you a backup in case of error.
Sample .frm content
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 1800
TabIndex = 1
Top = 1320
Width = 1215
End
Begin VB.TextBox Text1
Height = 495
Left = 360
TabIndex = 0
Text = "Text1"
Top = 240
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Text1.Text = "Hello World"
End Sub
Private Sub Form_Load()
Text1.BackColor = vbBlue
End Sub
Guess this is an old question, but if you're still interested in refactoring some VB6 project, check out my VBFormDesign filter tool at http://zoomicon.com/tranxform/

Resources