#include <stdio.h>
#include "teagent_c.h"
void PrintError(const char * msg)
{
char szErr[1024];
uint32_t nLength = 1024;
uint32_t nCode = GetLastTEError(szErr, &nLength);
printf("%s Code = 0x%x, Message = %s\n", msg, nCode, szErr);
}
int main()
{
TE_HANDLE h;
char * szServerName = "localhost";
long lPort = 8888;
TEEnvInit();
h = OpenConnectionWithWindowsUser(TE_SSL_CONNECTION, szServerName, lPort);
if (h == 0)
{
PrintError("Connection error:");
}
else
printf("Connected to %s at %d as Windows user.\n\n", szServerName, lPort);
CloseConnection(h);
printf("Disconnected from server\n\n");
TEEnvClose();
return 0;
}