Making Windows externals

Gordon Tillman got at mindspring.com
Fri Oct 22 14:26:52 EDT 2004


Hi Thomas,

In this function:


>
>  void XGetName(char *args[], int nargs, char **retstring, Bool *pass, 
> Bool *error)
>  {
>  char buffer[MAX_COMPUTERNAME_LENGTH+1];
>  DWORD dwLength;
>  BOOL blnSuccess;
>
>  dwLength = MAX_COMPUTERNAME_LENGTH+1;
>  blnSuccess = GetComputerName(buffer, &dwLength);
>  *pass = False; // don't pass the command up the chain
>  if (blnSuccess)
>  {
>  *error = False; // call was successful
>  //*retstring = istrdup (buffer);
>  sprintf(*retstring,buffer);
>  }
>  else
>  {
>  *error = True; // call failed
>  //*retstring = istrdup ("error: GetComputerName failed");
>  sprintf(*retstring,"error: GetComputerName failed");
>  }
>  }

Did you notice that you are not assigning anything to the retstring.  
That line is commented out.  But except for that it looks ok.


--gordon



More information about the use-livecode mailing list