Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Message event in a COM procedure (Dynamics 6.5)

(0) ShareShare
ReportReport
Posted on by 305

Hi, I am having problems with a program in VB6 that creates transactions with COM in Dynamics 6.5. The program creates transactions, saves and releases batches without problem; but I can't deal with pop messages that appears sometimes and requires the user to push some button. The messages are part of the Messages.csv file from Dynamics. I included the "Message" Event in the code; but when I compile the program, a VB6 error appears saying the procedure declaration doesn't match with the Event declaration with the same name. This is part of the code:

Public WithEvents SIVApp As SIVApplication
....

Set SIVApp = StartAppAndAutomate("2001000.exe", iSolErr, iOSErr)

....

Private Sub SIVApp_Message(ByVal MessageNumber As Integer, ByVal MessageText As String, ByVal MessageType As sivMessageType, ByRef MessageResponse As sivMessageResponse)

....

End Sub

 

The compilation error appears in the SIVApp_Message procedure; like if VB6 doesn't recognize the input arguments. I have the help guide of Object Model Reference (COM), and the procedure is based on the sample  for VB6. I can see that SWIMAPI shows sivMessageType and sivMessageResponse values in the list of constants, but the procedure is not recognized. The message says that there is an incorrect syntax on this procedure when it tries to compile it.

Any help will be very appreciated; it is very urgent that I release the program this weekend.

Thanks.

*This post is locked for comments

  • Alberto Viveros Profile Picture
    Alberto Viveros 305 on at
    Re: Message event in a COM procedure (Dynamics 6.5)

    Thank you very much Barry, I took the example that you sent me and it worked. I appreciate a lot your help. Thanks.

  • Alberto Viveros Profile Picture
    Alberto Viveros 305 on at
    Re: Message event in a COM procedure (Dynamics 6.5)

    Finally I found the answer; the first argument in the procedure shoud be Long type; in the reference guide the first argument is an Integer. The correct procedure for the v.6.5 is:

    Private Sub SIVApp_Message(ByVal MessageNumber As Long, _

       ByVal MessageText As String, _

       ByVal MessageType As SWIMAPI.sivMessageType, _

       ByRef MessageResponse As SWIMAPI.sivMessageResponse)

  • Barry Flynn Profile Picture
    Barry Flynn 3,090 on at
    Re: Message event in a COM procedure (Dynamics 6.5)

    Alberto

    I have a 6.5 VBTools screen which usus the Object Model.

    It has a Message Event with a different signature to yours.

    Mine is

    Private Sub objSIVApp_Message(ByVal MessageNumber As Long, ByVal MessageText As String, ByVal MessageType As SWIMAPI.sivMessageType, MessageResponse As SWIMAPI.sivMessageResponse)

    Barry

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans