Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

Compilation Error when trying to instantiate IModalDialogEvents class

$
0
0

Hi All,

I am trying to write a macro that attaches a reference file. I am trying to do it the CadInputQueue way as shown in the attached code.

However, I am running across this compilation error on line 19 of my code. (OnDialogOpened method)

Debugging the code shows me that line 5 causes the error, where I am trying to instantiate the class.

My code is split into two files: the main module file and the class module file which is detailed in the code below.

Any ideas on how to fix this?

Thanks,

Sai

'code in main module file

CadInputQueue.SendCommand "REFERENCE ATTACH"

Dim EventClass As New DialogEvents '- line that seems to be causing the issue
AddModalDialogEventsHandler EventClass

DialogEvents.IModalDialogEvents_OnDialogOpened "Open", msdDialogResultOK'class for Dialog events is in a seperate class module file named "DialogEvents"
Implements IModalDialogEvents

Private Sub IModalDialogEvents_OnDialogClosed(ByVal DialogBoxName As String, ByVal DialogResult As MsdDialogBoxResult)

End Sub

Private Sub IModalDialogEvents_OnDialogOpened(ByVal DialogBoxName As String, ByVal DialogResult As MsdDialogBoxResult)
    If DialogBoxName = "Open" Then
        CadInputQueue.SendCommand "MDL COMMAND MGDSHOOK,fileList_setDirectoryCmd *file path here*"
        CadInputQueue.SendCommand "MDL COMMAND MGDSHOOK,fileList_setFileNameCmd *file name here*"
        RemoveModalDialogEventsHandler Me
        DialogResult = msdDialogBoxResultOK
    End If
End Sub

Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>