Case 1:
dll was originally a bas to be included with some main code. The included code called InitializeCryptoBuffers and that worked OK.
Case 2:
On conversion to a dll I reckoned that calling InitializeCryptoBuffers from within a dll would not work, assuming that a dll was passive, so exported it and called it from a PB program. That worked OK.
Case 3:
On realizing FB dlls are not passive InitializeCryptoBuffers was returned to being just a Sub to be called from within the dll. That did not work.
I then put ' Print "Init" ' at the head of InitializeCryptoBuffers and the print worked. ' Print "Init" ' was moved line by line until a failure. Here is where the failure occurred.
Code: Select all
WaitForThreadpoolWorkCallbacks(Work0,FALSE)
Print "Init" ' <--- Print did not happen and code just stops
WaitForThreadpoolWorkCallbacks(Work0plus,FALSE)
' We don't need Work0 related objects again.
CloseThreadpoolWork(Work0)
CloseThreadpoolWork(Work0plus)
End Sub
This does not make sense bearing in mind that Case 2 works.