next up previous contents
Next: Assigning callbacks Up: An ICQ session with Previous: An ICQ session with   Contents

Initializing the ICQLINK

First of all, we should get ourselves some session identifier, we do that by simply declaring a variable of that type. You could use dynamic allocation if you prefer.

After doing that, we need to initialize it, meaning clean all the garbage and put good initial values in the structure. This is done by calling icq_Init (line 217). Note that the function requires a pointer to a previously allocated ICQLINK. Other than that, you'd require your ICQ UIN, password and nickname.

So here is what we do:

ICQLINK link;

icq_Init(&link, 103199388, ''topsecret'', ''tester'');

You should also be aware that every initialized ICQLINK needs to be ``freed'' using icq_Done (line 219) when you're done with it. We will discuss this later.

We got ourselves an ICQLINK, now let's connect to the server.



Zvika Brakerski 2001-05-08