Hello!
I would like to ask if it matters if the cConnection is created in the main process or if I can have a function in an activex dll that looks like this:
The reason why I am asking if that I create a cconnection exactely the same from the main thread and from a threaded dll, and the cconnection is created using yet another an activex dll, and for some reason, there kind of a "timing problem": When I press Pause in the IDE at some point of time, the main thread can suddenly "see" the cconnection and the records that the threaded lib inserted.Code:Public Function NewMemDB(ByVal uName As String, ByVal uEncKey As String, uOutConnection As cConnection, uError As String) As Boolean Dim iLine& iLine = 1 go_start: On Error GoTo ErrHandler Dim sb As IStringBuilder Set sb = NewStringBuilder sb.Append "file:" & uName ' -> file:drivescanner sb.Append "?" '? is query-indicator sb.Append "mode=memory" ' -> file:drivescanner?mode=memory sb.Append "&" '& ist parameter-trenner -> file:drivescanner?mode=memory& sb.Append "cache=shared" ' -> file:drivescanner?mode=memory&cache=shared Dim s$ s = sb.ToString Set uOutConnection = New_c.Connection(s, DBCreateInMemory) uOutConnection.CreateNewDB s, uEncKey uOutConnection.ExecCmd "PRAGMA read_uncommitted=1" 'allow the Client, to "see" even the uncommitted inserts, the thread will perform uOutConnection.Execute "PRAGMA journal_mode=off" 'these settings will increase the Insert-Performance a bit uOutConnection.Synchronous = False NewMemDB = True Exit Function ErrHandler: uError = "Error " & Err.Number & " (" & Err.Description & ") in procedure " & Quote("NewMemDB") & " of " & Quote("modobjects.bas") & ", Line: " & iLine On Error GoTo -1 Debug.Assert False End Function
But I have not found out the problem behind it.
This weird "trip" over an additional activex dll is part of my self-disciplining to resolve circular dependencies.
ps: I should perhaps also mention that I use 2 memory-cns at the same time using different names. I am not sure if that is part of the problem.
ps2: Since I remove the 2 other memory cns, it seems to work fine.
ps3: Nope, that was not the problem..
I am currently suspecting that this function in my activex dll is not well placed there:
Thank you.Code:Public Function CreateTH(byval uTaskname as string) as cthreadhandler set CreateTh=SomeLogicToEstablishIDAndPathForTheDll(uTaskname) End Function




Reply With Quote
