[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
Re: ActiveX control Message Properties
- Subject: Re: ActiveX control Message Properties
- From: Mark Harrison \(Yahoo!\)
- Date: Sun, 25 Jan 2004 14:03:00 +0000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
Michael,Please see the code stuff (at the bottom of this message), which is
how I do it..As you'll see, I use a lexical parse of the header, which I
pass to the function as a string, rather than using a specific
property/method of the OCX:Regards,Mark----- Original Message ----- From:
Michael McSharryTo: <A href="mailto:xAP_developer@xxxxxxx">xAP_developer@xxxxxxx</A>Sent:
Sunday, January 25, 2004 6:27 AMSubject: [xAP_developer] ActiveX control
Message PropertiesI'm using Patrick's ActiveX control for xAP with
success. I am able to setthe properties for the message source
and target, but when I receive amessage and place it in message structure I
am not able to retrieve thesource and target properties. I am
able to use the available methods tocompare these fields and it will return
matches when they occur, but when Ilook at the property directly it always
returns a null string. Is this bydesign or is there so
mething else that needs to be setup before readingthese
properties?=========== CODE FRAGMENT STARTS =============Attribute VB_Name
= "clsXapMessage"Attribute VB_GlobalNameSpace = FalseAttribute
VB_Creatable = TrueAttribute VB_PredeclaredId = FalseAttribute VB_Exposed =
FalseOption ExplicitPrivate sHeaderKeyword As StringPrivate lVersion As
LongPrivate lHopCount As LongPrivate sUniqueIdentifier As StringPrivate
sClass As StringPrivate sSource As StringPrivate sTarget As StringPublic
Sub ProcessMessage(sRawMessage As String) On
Error GoTo ProcessMessage_Error Dim
sCurrentMessage As String Dim
lCurrentDelimiterPossition As Long Dim
objMyMessageBlock As clsMessageBlock Dim
objMyKeyValuePair As clsKeyValuePair Dim
sCurrentKeyValuePair As String Dim
sCurrentEqualsPosition As Long  
; Dim sCurrentBangPosition As Long
Dim sMyKeyWord As String Dim sMyValue As
String Dim bMyIsHex As
Boolean Dim lHeaderID As
Long Dim lCntr1 As
Long Dim lCntr2 As
Long If sRawMessage = ""
Then
Exit Sub End If
sCurrentMessage = sRawMessage 'Start decoding
the header ChangeStatus "Decoding xAP
message..." lCurrentDelimiterPossition =
InStr(1, sCurrentMessage, "{")
sHeaderKeyword = Mid(sCurrentMessage, 1, lCurrentDelimiterPossition -
1) If Mid(sHeaderKeyword,
Len(sHeaderKeyword), 1) = Chr$(10
)
Then
'Some messages don't have the line feed before the first
{ 'so
need to check it it is there and then remove
it
sHeaderKeyword = Mid(sHeaderKeyword, 1, Len(sHeaderKeyword) -
1) End If If
Not (UCase(sHeaderKeyword) = UCase("xap-Header"))
Then
'Don't log
heartbeats
ChangeStatus
""
Exit Sub End If
sCurrentMessage = Mid(sCurrentMessage, lCurrentDelimiterPossition +
2,Len(sCurrentMessage))
lCurrentDelimiterPossition = InStr(1, s
CurrentMessage, Chr$(10)) lVersion =
CLng(Mid(sCurrentMessage, 3, lCurrentDelimiterPossition -
3)) sCurrentMessage = Mid(sCurrentMessage,
lCurrentDelimiterPossition +
1,Len(sCurrentMessage))
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
Chr$(10)) lHopCount =
CLng(Mid(sCurrentMessage, 5, lCurrentDelimiterPossition
-5)) sCurrentMessage = Mid(sCurrentMessage,
lCurrentDelimiterPossition +
1,Len(sCurrentMessage))
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
Chr$(10)) sUniqueIdentifier =
Mid(sCurrentMessage, 5, lCurrentDelimiterPossition
-5) sCurrentMessage = Mid(sCurrentMessage,
lCurrentDelimiterPossition +
1,Len(sCurrentMessage))
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
Chr$(10)) sClas
s = Mid(sCurrentMessage, 7, lCurrentDelimiterPossition -
7) sCurrentMessage = Mid(sCurrentMessage,
lCurrentDelimiterPossition +
1,Len(sCurrentMessage))
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
Chr$(10)) sSource = Mid(sCurrentMessage, 8,
lCurrentDelimiterPossition - 8)
sCurrentMessage = Mid(sCurrentMessage, lCurrentDelimiterPossition +
1,Len(sCurrentMessage))
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
"}") If Not
lCurrentDelimiterPossition = 1
Then
'Target is
optional
sTarget = Mid(sCurrentMessage, 8, lCurrentDelimiterPossition -
9) End If
xAP_Development Main Index |
xAP_Development Thread Index |
xAP_Development Home |
Archives Home
|