I think that foo_sample code will only run when the dialog is open. You want your own class derived from play_callback_static
class MyClass: public play_callback_static
{
public:
uint32_t get_flags() override
{
// take care to return the flags for the callbacks you intend to use.
}
// all other overrides go here
}
FB2K_SERVICE_FACTORY(MyClass);
As for debugging, I generally setup a junction from the VS output folder to a folder inside the user-components folder of a portable install. From an administrator command prompt, I might do something like..
mklink /D z:\foobar2000\profile\user-components\foo_sample z:\git\foobar2000-sdk\foobar2000\foo_sample\Release
Then inside VS itself, to to the Properties of your project>Debugging>Command and set it to the foobar instance above - in my case z:\foobar2000\foobar2000.exe
Also, make sure the project is set as the "startup project", Right click in solution explorer>set as startup project.