Try this one. Read CIN manual about Long pascal string and C string differences. To be short 4 bytes string length and then string data itself.
Make sure that hostname is not longer than 29 chars!
Use LabVIEW memory manager routines to do memory manipulations.
Error checking and defence is absent and should be implemented later. Don't forget.
This is a brief glance.
/*
* CIN source file
*/
#include "extcode.h"
#include "hosttype.h"
#include "windows.h"
#include "rimp.h"
#include "rmain.h"
#include "rt.h"
TTClientCon PTClientCon;
CIN MgErr CINRun(LStrHandle HostName, uInt16 *PortNo, int32 *Timeout, int32 *ChannelId);
CIN MgErr CINRun(LStrHandle HostName, uInt16 *PortNo, int32 *Timeout, int32 *ChannelId)
{
StrCpy(PTClientCon.HostName,*LstrBuf(*HostNa
me);
PTClientCon.PortNo = *PortNo;
PTClientCon.Timeout = *Timeout;
rTClientCon(&PTClientCon);
*ChannelId = PTClientCon.ChannelId;
return noErr;
}"
Good luck.
Sergey