Attachment 196049Attachment 196050Attachment 196051
That's interesting, my VB6 doesn't display "Forms3: 12.0.4518.101" in the bottom-right corner. The rest of numbers are the same, Version 9782 and VBA: Retail 6.0.9782. Wondering what's up with that Forms3 stuff?
...because i have i installed Microsoft Access 2007 for old database and Microsoft Office LTSC Professional Plus 2021
Edit (Copilot):
Forms3: 12.0.4518.101 is the version of the Microsoft Forms 2.0 ActiveX library (FM20.DLL) that Visual Basic 6.0 is using on your system. Forms3 is the internal name used by Microsoft for the third?generation MSForms library, which provides the controls used in VB6 and VBA UserForms. Forms3 corresponds to the DLL: FM20.DLL
This DLL is installed with Microsoft Office, not with VB6 itself.
The version you see: 12.0.4518.101 corresponds to Office 2007 (Office 12).
Even AI is stumped by this comparison conundrum! :D
Attachment 196052
I've finally managed to reproduce the error eventually by deleting the registry key entirely. It turns out vbNullString is not a valid comparison value for an integer! :bigyello:
> With "Option Strict On" this would never have happened
Too bad the option is not available in MIDL :-))
cheers,
</wqw>
Fixed this bug and uploaded the new samples collection archive. This version also includes the BindableRecordset project which is an Access MDB Database editor using a WinRT XAML ListView control bound to an ADODB Recordset.
This project focuses on editing the Customers table from the classic Northwind.mdb database while bridging technologies several decades apart:
- a classic ADODB Recordset is used to open the table
- a modern XAML ListView control is bound to this Recordset with an implementation of the IBindableVector interface
The binding is set to two-way mode and triggered on PropertyChanged so that every change is recorded in real time and saved to the database.
Attachment 196113
The latest version of the WinRT Samples Collection linked in the first post above includes two new additions:
- The Image Drag'n'Drop project demonstrates how you can drag images from browsers or other applications as well as image files from Explorer and drop them on a Form. If your VB6 IDE runs elevated then you need to compile the executable since you can't drag and drop stuff between normal and elevated applications.
- The Camera Capture project shows a live video preview from your webcam in a PictureBox. A ComboBox lists all available resolutions and video encoding properties supported by your camera and you can switch between them. The aptly named Snapshot button saves a JPG snapshot in the current folder.
Attachment 196208
The form is resizable and the live preview will be automatically resized accordingly. My Windows tablet has a crappy camera so that's what you see in the screenshot above. Professional webcams should support more advanced formats and video compression properties.
VanGoghGaming - this is great!
Do you happen to have an example using this for "BluetoothLEDevice Class" https://learn.microsoft.com/en-us/uw...ew=winrt-28000
Something that would scan for BLE devices and for each found list / show all of the Properties.
Bluetooth namespaces are not yet included in the TypeLib but I can add them if desired.
I looked into listing BT LE device props without RT and I think RT is going to win this one :(
BluetoothFindFirstRadio etc seems to not include LE-only devices. Though Claude also made a bunch of stuff up and got the name wrong when telling me that. Not that Microsoft's documentation is any less unclear.
I've been wanting BLE support in VB for years now - if RT works out it will be AMAZING! I have a project that is currently using a separate program that has been compiled into an EXE which was written in python by another person for me and it works however I'd like to have everything within my program to have more control over it. I wrote an Arduino program that runs on an ESP32 board that works but again would really rather have everything contained within the main program.
Being able to scan for and then retrieve the information within my program would really streamline things.
I've done some digging and BLE scanning works relatively easy, you subscribe to a BluetoothLEAdvertisementWatcher and receive events containing information about the discovered devices. This works fine but the information received in this preliminary stage is rather sparse. Depending on what properties you require, it may be necessary to delve even deeper and request GATT services on each discovered device. The rabbit hole goes much, much deeper though. I'll try to whip something up and post it a little bit later.
You can look at the program called Bluetooth Beacon Interactor in the Microsoft App Store for an example of what is received.
I'm wanting to be able to receive the Address (which is a standard MAC address AA:BB:CC:DD:EE:FF, Signal Strength which will be a number like -55, UUID which will be along the lines of 12345678-abcd-1234-5678-123456789012 (eight-four-four-four-twelve hexadecimal digits separated by hyphens), Major which will be a number, Minor which will also be a number and then TX Power which will be a number as well. Most of this is part of the standard iBeacon format which if I understand it correctly should be part of Windows.Devices.Bluetooth.Advertisement Namespace. https://learn.microsoft.com/en-us/uw...ew=winrt-28000
Attachment 196210
If you can pull this off it would be amazing! Thank you for even looking into this!!!
Yeah, no worries, what you wanted with the Bluetooth.Advertisement namespace is pretty straight forward but these namespaces are always intertwined with others so I had to include all of them in order to resolve all dependencies. I have uploaded new versions of the TypeLibs which include these new namespaces:
While at it, I am also taking requests for any other Windows.Devices.* or other namespaces that anyone might want added and that are not already included in the TypeLibs! :DCode:Windows.Devices.Bluetooth
Windows.Devices.Bluetooth.Advertisement
Windows.Devices.Bluetooth.Background
Windows.Devices.Bluetooth.GenericAttributeProfile
Windows.Devices.Bluetooth.Rfcomm
Windows.Devices.Radio
The WinRT Samples Collection linked in the first post above also contains the new BluetoothLE project now. This is a BLE Scanner that scans continuously and displays found devices in a ListBox. Clicking on a device displays its properties in the adjacent TextBox.
I don't have any iBeacon devices to test so I had to make due with my phone and whatever devices the neighbors have. For example this guy never bothered to personalize the name of his iPhone! :D
Attachment 196217
Many of these devices (especially phones) do not include a name in their LEAdvertisements so I went a step further and looked into the GATT (Generic Attribute Profile) namespace that is able to glean a lot more information (provided the devices are actually Connectable). This is significantly more complicated than simply parsing the LEAdvertisement but it's not needed for your project, it's just something that piqued my curiosity. :bigyello:
Since you're only interested in the ManufacturerData, that's easily retrieved along with the CompanyId as you can see in the above screenshot. It is also included in the DataSections displayed below it (DataType: 0xFF) along with any other data sections the device might expose.
There's room for improvement in this project. For example it doesn't remove stale devices from the list right now. Some devices (like phones) have dynamic addresses that change every few minutes and as such the list needs to be refreshed and checked for stale devices but this shouldn't be the case for your iBeacon. If you have any other questions about the project or WinRT syntax, feel free to ask.
Building a bit further on this project, now it removes stale devices from the list if they haven't been advertising for 5 minutes. Also, for Connectable devices, it enumerates all advertised GATT Services and their Characteristics and if they are Readable it also tries to read their values.
For example this iPhone lists the Battery Service (180F) at the bottom, but when trying to read the value of its Battery Level characteristic (2A19), it returns ProtocolError: InsufficientAuthentication because the device is not paired.
Attachment 196225
I found a handy list of Bluetooth GATT Services & Characteristics on GitHub to make sense of all these Guids.
On another note, I have also updated the XAML Islands samples included in the collection to fix the annoying ghost window that was stuck in the taskbar after running the projects in IDE. Executables were not affected but when running in IDE there was this ghost window lingering in the taskbar (it didn't affect functionality but was mildly annoying for sure). :bigyello:
The Samples Collection as well as the TypeLibs have been updated in the first post above.
pcjOCR is interesting demo, but how to run it in VB ide?
Stops in Public Function NewObject -> Debug.Assert False
You need <maxversiontested Id="10.0.18362.0"/> in your IDE manifest file.
Here is my complete VB6.exe.manifest from C:\Program Files (x86)\Microsoft Visual Studio\VB98
And stop using Win7 compatibility shims for no apparent reason (no, it's not getting faster with compat shims).Code:<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity
version="2002.10.0.25"
processorArchitecture="X86"
name="vb6.exe"
type="win32" />
<description>WindowsExecutable</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*" />
</dependentAssembly>
</dependency>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
<maxversiontested Id="10.0.18362.0"/>
</application>
</compatibility>
<application xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:windowsSettings>
<ws2:longPathAware>true</ws2:longPathAware>
</ws2:windowsSettings>
</application>
</assembly>
Also IDE does not need to be elevated on Win10/Win11 to register those COM DLLs/OCXs you are compiling your projects to.
cheers,
</wqw>
Thanks wqw, that sorted it out. My vb6.exe manifest was missing win10 supportedOS and maxversionTested IDs.
I have newer run vb6 ide with OS compatibility version option ticked.
There is a VB6.EXE.manifest file in the Common folder included in the Samples Collection.
This is mentioned in Post #6 above but worth mentioning again since it got lost along the way. :bigyello:
The maxversiontested attribute is absolutely required whenever you are instantiating XAML controls. The rest of WinRT classes don't care about it.