Jabber/XMPP Tools

Summary

Alax.Info Jabber/XMPP Tools is a beginning of a Jabber/XMPP compatible set of automation objects (COM/OLE). The module is started as a simplest Jabber client to be used to send message into Jabber/XMPP network. Initially the module provides three objects:

  • Connection, a TCP socket connection pump conectable to remote Jabber/XMPP server;
  • Authentication, an object which authenticates Jabber/XMPP client with remote server;
  • Message, a single instant message object

Continue reading →

C/C++ memory manager magic values

The values the debug version of CRT memory manager fills memory with.
dbgheap.c:

static unsigned char _bNoMansLandFill = 0xFD;   /* fill no-man’s land with this */
static unsigned char _bDeadLandFill   = 0xDD;   /* fill free objects with this */
static unsigned char _bCleanLandFill  = 0xCD;   /* fill new objects with this */
static unsigned char _bAlignLandFill  = 0xBD;   /* fill no-man’s land for
aligned routines */

Additionally, debug compilation (optimization turned off?) produces code which uses 0xCC fill to initialize variables on stack and

XML-RPC and COM

This is what’s been cooking here for some time and given certain amount of time and intent it is going to be completed to the least usable state.

XML-RPC is a specification to deliver remote procedure calls via XML requests and responses using HTTP connection as a communication channel. Its advantage is it’s quite popular. What I’d like to do is to make a COM proxy (in future stub too) which will accept standard IDispatch compatible calls and translate them into XML-RPC compatible requests.
The thing may look a bit tricky but basically it’s more than halfway done already. COM proxy uses type library information and SAX to prepare XML request and raises COM event for the caller to be able to deliver request, typically using XMLHTTP helper. Received response is parsed back into COM proxy output. A variety of COM-enabled applications are thus given an easy to use XML-RPC capabilities.

Multidimensional VARIANT arrays

VARIANT arrays (SAFEARRAYs) are useful because they are OLE Automation compatible but multidimensional ones are used rather rarely. Unfortunately, the order of indexes is different depending on API. Somewhere it’s normal, somewhere it’s reverse and, as for me, I need to refresh this knowledge almost every time I come across a multidimensional VARIANT array. I use this small utility to quickly remember what is the proper order of indexes, which exactly index I can resize through SafeArrayRedim and how exactly the values are stored in memory.

Continue reading →