I use code following code to create a Directory using toolkit
err = ProFileMdlnameParse(SelPath00, OutPutPath, MdlName, Ext, rev); ProWstringToString(DwgName, MdlName); mkdir(strcat("C:\\temp\\", DwgName))
When i run the application second time, the DwgName is getting appended.
(i.e first time DwgName is 1234, second time it becomes 12341234)
Hi, probably due to the improper use of strcat.
Function strcat has first parameter the pointer to resulting array (this pointer is also returned), second param is string to append.
For the first time you append string to the end of array which begin at some address, second time append next string to this array and so on ... (string array will overlap, exception occurred).
Try to refill the result string (strcpy), at least, e.g.:
char dir [PRO_PATH_SIZE];
Btw: You should not use strcat, try something like ProTKSnprintf
At least strcat_s(dir, PRO_PATH_SIZE, DwgName); so you get a crash at "out of allocated memory" and not write over other variables/allocated space inside your memory.