I organized the files on the disk like this (in the small test solution as well as in my original code):
1st step:
solution/breakpointtest/
solution/breakpointtest/breakpointtest.ino
solution/breakpointtest/classtest.h
solution/breakpointtest/classtest.cpp
Code refactoring got difficult, so in the 2nd step I added a test program to be used with the code in classtest.*
2nd step:
solution/breakpointtest/
solution/breakpointtest/breakpointtest.ino
solution/breakpointtest/classtest.h
solution/breakpointtest/classtest.cpp
solution/example/
solution/example/sketch2/sketch2.ino
(this shows where the source files reside on the disk.)
Inside VS17 I put a solution, a project for the first step (breakpointtest.ino, classtest.cpp and .h). Then I added a second project with the new file sketch2.ino, and also i used in VS17 the function "add existing file to project" (Shift-Alt-A). Thus, the same physical files classtest.* are used in both projects. You can see in Sketch2.vcxproj, too.
<ItemGroup>
<None Include="Sketch2.ino">
<FileType>CppCode</FileType>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\breakpointtest\classtest.h" />
<ClInclude Include="__vm\.Sketch2.vsarduino.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\breakpointtest\classtest.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
I'm not sure if this is the best way to organize in VS, so I'm open for ideas.
Regards
Andreas