Why do I receive an memory.cpp error when executing the LabVIEW.vi. Second, could you direct me to an example stdcall for using argv and argc within a dll. Thanks in advance for your direction. Connie
/* Call Library source file */
#include "extcode.h"
#include "gmsec_c.h"
#include
#include
#define words 10
_declspec (dllexport) long Lgmpub(char ArrayArgv[], LStrHandle LData);
_declspec (dllexport) long Lgmpub(char ArrayArgv[], LStrHandle LData)
{
MgErr error;
char *seperator={" "};
char *p='\0';
char *token='\0';
char *sarr[words];
int i=0;
int len=-1;
int ldatasize=0;
char teststring[]={"AABBCCDDEEFFGGHHIIJJKKLLMM"};
int size=sizeof(teststring);
/* prepare a char *argv[] type array from labview string */
token=strtok(ArrayArgv, seperator);
len++;
while (token!=NULL)
{
sarr[i]=token;
i++; len++;
token=strtok(NULL, seperator);
}
/* sprintf(ArrayArgv, "%s %d", "This test: ", len); /* do not use string functions with pointers
i.e., sprintf append to labview memory */
error = DSSetHandleSize(LData, sizeof(int32) + size * sizeof(uChar));
if (error != mFullErr && error != mZoneErr){
for (i=0; i (*LData)->str[i]=teststring[i];
}
}
return(0);
}