You did not perform class abstraction correctly. And more over, everything in same file? including class definition? That's not how you use VS project structure.
I assume you want to create two separate applications. One would create periodic table and a second application use the file generated by first application.
If above is correct, you need to declare the PeriodicTable class in header, implement constructor, destructor and GetInfo method in a .cpp implementation. Another .cpp implementation should contain your main() function for the first application.
Note that it is generally a good idea to create a universal header file in a shared location by two applications which contain global definitions, like the path to the generated .dat file. In this case, absolute path should be taken as both applications will unlikely have same relative path to the file.
Another thing to notice, instead of letting compiler figure out how the file should be structured, structure it yourself. Follow the structure convention you created in both application. One suggestion is that instead of writing (char *) &ptele
, write one line for one element, give a tab between each column, say between Element and Symbol. You'll need to parse it properly before using the value but this avoids any ambiguity of the data.