Kevin,
Here is a piece from the code:
--------------------------------------------------
CIN MgErr CINRun(LStrHandle ParameterFilePath, LStrHandle DataFilePath, LStrHandle OutputFilePath, int32 replace, int32 ver, int16 calrange, int16 istof, LStrHandle OutputString)
{
int i, StartCh, ChannelNum;
double Density, a, b, sigmachn, sigmawin, sigmascattp, EInit, angle, ns, es,
concentration, totalweight, conversion, Dsample, Count[2048], NetCnts;
char temp[15], Z1Name[2], Z2Name[10][2];
char parafilename;
//char *datafilename = "";
//char *outfilename = "";
//char *cMessageText;
// Make necessary conversions.
LStrLen (*OutputString) = LStrLen(*ParameterFilePath);
//MoveBlock(LStrBuf(*ParameterFilePath), LStrB
uf(*OutputString), LStrLen(*ParameterFilePath));
MoveBlock(LStrBuf(*ParameterFilePath), & parafilename, LStrLen(*ParameterFilePath));
MoveBlock(& parafilename, LStrBuf(*OutputString), LStrLen(*ParameterFilePath));
ifstream parafile, infile;
ofstream outfile;
Ion_Target mIon_Target;
mIon_Target.Z2 = new int(10);
mIon_Target.M2 = new double(10);
mIon_Target.F = new double(10);
// Open parameter file...
parafile.open((char *)parafilename, ios::in|ios::nocreate);
if(parafile == NULL)
{
//cMessageText = "Couldn't Open Parameter File. Maybe it doesn't exist";
// return -1;
return fIOErr;
}
parafile.close();
----------------------------------------------------
The problem is I have to use ifstream method, because the rest of the code depends on it, and I don't want to deal with the conversion. Otherwise, I would have used FMOpen/FMClose utilities.
So the problem is obvious as you see, all I need is to convert LStrHandle to a char.
When I run the code from LabVIEW, "The instruction at "0x77f83e91" referenced at "0x555c3a44". The memory could not be "read"." error message appears.
I'd appreciate your help.
Sacit