
Originally Posted by
Schmidt
And I don't have the time currently, to dive into the intricacies of:
- recompiling the .NET-wrapper for SQLite in a proper manner (using proper includes)...
- so that these free crypto-extensions will work as they should, without breaking other things in the .NET-wrapper
I was just about to suggest that there is nothing stopping him from just using your library in .Net until a suitable .Net alternative can be found but I decided to test this before I made this suggestion. It seems that the vbRichClient library cannot work in .Net. I don't pretend to be a COM expert but based on the errors reported by Visual Studio 2019, I'm guessing your library doesn't fully respect the COM specification. For whatever reason VB6 puts up with it and I've heard rumors it even works in TwinBASIC but as far as the .Net is concerned, it's type library is broken. It generated 32 errors, among them it even found an interface that is not derived from IUnknown:-
Code:
Warning Processing COM reference "VB" from path "C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.OLB". Type library importer has encountered an interface not derived from IUnknown: '___MSJetSQLHelp'.
As far as I know, this is a major COM violation since the COM specification/documentation makes it's clear that all interfaces must be derived from IUnknown. I then tested ADO(ActiveX Data Objects 6), another COM library that is roughly comparable in complexity to vbRichClient and that worked without a problem. It not only got imported correctly, it actually worked. I was able to query a database using plain old COM ADO in .Net:-
Code:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim c As New ADODB.Connection
Dim sb As New SqlConnectionStringBuilder
sb.InitialCatalog = "EmSqlDB"
sb.DataSource = "VBBOX"
c.Provider = "sqloledb"
c.ConnectionString = sb.ToString & ";Integrated Security=SSPI"
c.Open()
Dim rs As ADODB.Recordset = c.Execute("Select * From TblProducts")
Do Until rs.EOF
Debug.WriteLine(rs.Fields.Item(2).Value.ToString)
rs.MoveNext()
Loop
End Sub
Unfortunately my knowledge of COM is far too limited to figure out how to make vbRichClient work in a .Net solution but it would have been a nice easy solution to the OP's problem if it did. This is one of the rare instances where your library actually covers something that isn't by the .Net ecosystem, as far as we know anyway.