This should get you started. When the connection fails, it crashes. I don't know why, and I don't care. tongue Bon appetit.
Code
#include <default.c>

int __cdecl BrokerOpen (char* Name, void* fpError, void* fpProgress); 
API(BrokerOpen,SierraChart)

int __cdecl BrokerLogin (char* User, char* Pwd, char* Type, char* Accounts);
API(BrokerLogin,SierraChart)

// int __cdecl BrokerHistory2 (char* , DATE , DATE , int , int , T6* );
// API(BrokerHistory2,SierraChart)

int fError(char* message) {
	printf("\n%s",message); 
	return 0;
}

int fProgress(DWORD prog) {
	return wait(0);
}

void run()
{
	if(!Test){quit("#Only [Test] mode supported.");return;}

	char outName[64],outAccount[1024];
	memset(outName,0,64);
	memset(outAccount,0,1024);
	
	printf("\ncheckpoint a");
	int o = BrokerOpen(outName,(void*)fError,(void*)fProgress);
	printf("\ncheckpoint b, outName: %s, o: %d",outName,o);
	BrokerLogin ("","","Demo",outAccount);
	printf("\ncheckpoint c");
	
	quit("#Done.");
}