I know that Speedikon has got a seperate area in this Community but I think that this topic is better placed in the Microstation world ...
Some months ago I have created a VBA-program that is triggered when a file is opened (according to the guidline here: http://www.la-solutions.co.uk/content/MVBA/MVBA-DgnEvents.htm)
This is working fine.
Now there is another task I would like to complete. We are using Speedikon Architecture together with Microstation. I would need to create a program that starts when a file is opened and then waits until Speedikon is loaded (Speedikon is loaded after Microstation). I have already found a way to check if Speedikon is loaded (http://www.la-solutions.co.uk/content/MVBA/MVBA-IsMdlLoaded.htm) but my problem ist that it does not work in a loop.
My code is as follows:
Sub Main()
Dim mdlapp As String
mdlapp = "DESIGN"
While IsMdlLoaded(mdlapp) = False
DoEvents
Wend
End Sub
Function IsMdlLoaded(appName As String) As Boolean
IsMdlLoaded = False
On Error GoTo err_IsMdlLoaded
Const SUCCESS As Long = 0
If (SUCCESS = mdlSystem_getTaskStatistics(0, appName)) Then
IsMdlLoaded = True
End If
Exit Function
err_IsMdlLoaded:
MsgBox "Error no. " & CStr(Err.Number) & ": " & Err.Description, vbCritical Or vbOKOnly, "IsMdlLoaded Error"
End Function
The problem is that when Microstation is loaded, the load process won't progress anymore. The system freezes ...
What's the problem? I thought that "DoEvents" would allow the system to perform other things in background while the procedure is still active?!