The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: ActiveX control Message Properties


  • Subject: Re: ActiveX control Message Properties
  • From: Michael McSharry
  • Date: Sun, 25 Jan 2004 21:39:00 +0000

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<DIV><FONT face="Arial" size="2">Thank You
Mark, it is a good solution for now.</FONT></DIV>
<BLOCKQUOTE>
<DIV>----- Original Message ----- </DIV>
<DIV><B>From:</B> <A title="mph@xxxxxxx"
href="mailto:mph@xxxxxxx";>Mark
Harrison (Yahoo!)</A> </DIV>
<DIV><B>To:</B> <A
title="xAP_developer@xxxxxxx" href="mailto:xAP_developer@xxxxxxx";>xAP_developer@xxxxxxx</A>
</DIV>
<DIV><B>Sent:</B> Sunday, January 25, 2004 6:03
AM</DIV>
<DIV><B>Subject:</B> Re: [xAP_developer] ActiveX control
Message Properties</DIV>
<DIV></DIV>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.&nbsp; 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.&nbsp; 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.&nbsp; Is this
bydesign or is there something 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)&nbsp;&nbsp;&nbsp; On
Error GoTo ProcessMessage_Error&nbsp;&nbsp;&nbsp; Dim
sCurrentMessage As String&nbsp;&nbsp;&nbsp; Dim
lCurrentDelimiterPossition As Long&nbsp;&nbsp;&nbsp; Dim
objMyMessageBlock As clsMessageBlock&nbsp;&nbsp;&nbsp; Dim
objMyKeyValuePair As clsKeyValuePair&nbsp;&nbsp;&nbsp; Dim
sCurrentKeyValuePair As String&nbsp;&nbsp;&nbsp; Dim
sCurrentEqualsPosition As
Long&nbsp;&nbsp;&nbsp; Dim sCurrentBangPosition As
Long&nbsp;&nbsp;&nbsp; Dim sMyKeyWord As
String&nbsp;&nbsp;&nbsp; Dim sMyValue As
String&nbsp;&nbsp;&nbsp; Dim bMyIsHex As
Boolean&nbsp;&nbsp;&nbsp; Dim lHeaderID As
Long&nbsp;&nbsp;&nbsp; Dim lCntr1 As
Long&nbsp;&nbsp;&nbsp; Dim lCntr2 As
Long&nbsp;&nbsp;&nbsp; If sRawMessage = ""
Then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Exit Sub&nbsp;&nbsp;&nbsp; End If&nbsp;&nbsp;&nbsp;
sCurrentMessage = sRawMessage&nbsp;&nbsp;&nbsp; 'Start decoding
the header&nbsp;&nbsp;&nbsp; ChangeStatus "Decoding xAP
message..."&nbsp;&nbsp;&nbsp; lCurrentDelimiterPossition =
InStr(1, sCurrentMessage, "{")&nbsp;&nbsp;&nbsp;
sHeaderKeyword = Mid(sCurrentMessage, 1, lCurrentDelimiterPossition -
1)&nbsp;&nbsp;&nbsp; If Mid(sHeaderKeyword, Len(sHeade
rKeyword), 1) = Chr$(10)
Then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
'Some messages don't have the line feed before the first
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'so
need to check it it is there and then remove
it&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sHeaderKeyword = Mid(sHeaderKeyword, 1, Len(sHeaderKeyword) -
1)&nbsp;&nbsp;&nbsp; End If&nbsp;&nbsp;&nbsp; If
Not (UCase(sHeaderKeyword) = UCase("xap-Header"))
Then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
'Don't log
heartbeats&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ChangeStatus
""&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Exit Sub&nbsp;&nbsp;&nbsp; End If&nbsp;&nbsp;&nbsp;
sCurrentMessage = Mid(sCurrentMessage, lCurrentDelimiterPossition +
2,Len(sCurrentMessage))&nbsp;&nbsp;&nbsp; lCurrentDelimite
rPossition = InStr(1, sCurrentMessage,
Chr$(10))&nbsp;&nbsp;&nbsp; lVersion =
CLng(Mid(sCurrentMessage, 3, lCurrentDelimiterPossition -
3))&nbsp;&nbsp;&nbsp; sCurrentMessage = Mid(sCurrentMessage,
lCurrentDelimiterPossition +
1,Len(sCurrentMessage))&nbsp;&nbsp;&nbsp;
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
Chr$(10))&nbsp;&nbsp;&nbsp; lHopCount =
CLng(Mid(sCurrentMessage, 5, lCurrentDelimiterPossition
-5))&nbsp;&nbsp;&nbsp; sCurrentMessage = Mid(sCurrentMessage,
lCurrentDelimiterPossition +
1,Len(sCurrentMessage))&nbsp;&nbsp;&nbsp;
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
Chr$(10))&nbsp;&nbsp;&nbsp; sUniqueIdentifier =
Mid(sCurrentMessage, 5, lCurrentDelimiterPossition
-5)&nbsp;&nbsp;&nbsp; sCurrentMessage = Mid(sCurrentMessage,
lCurrentDelimiterPossition +
1,Len(sCurrentMessage))&nbsp;&nbsp;&nbsp;
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
Chr$(10))&nbsp;&am
p;nbsp;&nbsp; sClass = Mid(sCurrentMessage, 7,
lCurrentDelimiterPossition - 7)&nbsp;&nbsp;&nbsp;
sCurrentMessage = Mid(sCurrentMessage, lCurrentDelimiterPossition +
1,Len(sCurrentMessage))&nbsp;&nbsp;&nbsp;
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
Chr$(10))&nbsp;&nbsp;&nbsp; sSource = Mid(sCurrentMessage, 8,
lCurrentDelimiterPossition - 8)&nbsp;&nbsp;&nbsp;
sCurrentMessage = Mid(sCurrentMessage, lCurrentDelimiterPossition +
1,Len(sCurrentMessage))&nbsp;&nbsp;&nbsp;
lCurrentDelimiterPossition = InStr(1, sCurrentMessage,
"}")&nbsp;&nbsp;&nbsp; If Not
lCurrentDelimiterPossition = 1
Then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
'Target is
optional&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sTarget = Mid(sCurrentMessage, 8, lCurrentDelimiterPossition -
9)&nbsp;&nbsp;&nbsp; End If<TT>
<HR width="500">
<B>Yahoo! Groups Links</B>
<UL>
<LI>To visit your group on the web, go to:<A href="http://groups.yahoo.com/group/xAP_developer/";>http://groups.yahoo.com/group/xAP_developer/</A>&nbsp;
<LI>To unsubscribe from this group, send an email to:<A
href="mailto:xAP_developer-unsubscribe@xxxxxxx?subject=Unsubscribe";>xAP_developer-unsubscribe@xxxxxxx</A>&nbsp;
<LI>Your use of Yahoo! Groups is subject to the <A href="http://docs.yahoo.com/info/terms/";>Yahoo!
Terms of Service</A>.
</LI></UL></TT></BLOCKQUOTE>




xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.