Microsoft Dynamics Forums Homepage

Forum Home Forum Home > Microsoft Dynamics SL (Solomon) > SL - Customization and Integration
  New Posts New Posts RSS Feed - Message event in a COM procedure (Dynamics 6.5)
  FAQ FAQ  Forum Search   Register Register  Login Login


Message event in a COM procedure (Dynamics 6.5)

 Post Reply Post Reply
Author
Message
aviveros View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: July 28 2012
Location: Mexico
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote aviveros Quote  Post ReplyReply Direct Link To This Post Topic: Message event in a COM procedure (Dynamics 6.5)
    Posted: July 28 2012 at 4:57am

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

Back to Top
Sponsored Links


Back to Top
aviveros View Drop Down
MicrosoftDynamicsForums.com Member
MicrosoftDynamicsForums.com Member


Joined: July 28 2012
Location: Mexico
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote aviveros Quote  Post ReplyReply Direct Link To This Post Posted: July 31 2012 at 2:16am

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)

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down


Copyright 2013 microsoftdynamicsforums.com. All rights reserved. MicrosoftDynamicsForums.com is an independent non-Microsoft website.
Email: contact AT microsoftdynamicsforums DOT com