I am using the development kit (set of C++ libraries) that comes with some major software that my employer uses. I am using MS Visual Studio 2008 as recommended by the software vendor.
My code includes my own class, ArgFile:
1 2 3 4 5 6 7 8
|
class ArgFile {
public:
...
char *AFileName;
...
ArgFile();
~ArgFile();
};
|
The member, AFileName, can be assigned a value in the function, runBATCHPROC :
1 2 3 4 5 6 7 8 9 10 11 12
|
char * runBATCHPROC(ArgFile *thisArgFile, ... )
{
...
char AFileName[MAXPATHLEN];
char thisName[MAXPATHLEN];
...
sprintf(thisName,"<format>",<values>);
...
strcat(strcpy(AFileName,thisName),"_end");
thisArgFile->AFileName=AFileName;
...
}
|
Currently, the length of the string assigned to thisArgFile.AFileName is less than MAXPATHLEN (1024). When I run another function, processData, parts of the memory allocated to AFileName are overwritten when I declare (but don't assign values to) one particular class from the development kit:
1 2 3 4 5 6
|
char * processData(ArgFile *thisArgFile, ... )
{
...
ftr_point_type pointFtr;
...
}
|
I have confirmed that this is happening at this stage using the memory window but, because I can't interrogate the classes in the libraries any further, I don't know what part of the pointFtr object is messing up the memory.
Have I done something very silly? Given that I have no ability to change the ftr_point_type class (or any of the devkit classes), can I protect the memory used by other variables?
I have tried to understand what is happening through other forum questions and information pages, but my understanding of memory is too basic to work out how to use the answers given. I would appreciate any hints on how I can investigate the cause of this problem!
Thank you in advance.