Since the SDK did not provide all the VS2008 project files necessary, I had to do a little bit of legwork to get the sample component working. You should be able to convert my project file to a VS2010 project pretty easily. Here is what I did; it is a bit unorthodox, but it cut out all the guesswork as to whether I should include helpers, ATLHelpers, etc. and saves me from managing several projects. I set up the following file structure (my solution contains other project files, hence the extra directory layer):
<basedir>\foobar2k.vcproj -- .vcxproj for VS2010 and up
<basedir>\foobar2k\
<basedir>\foobar2k\sdk\ -- unzip the SDK into this directory in its entirety
<basedir>\foobar2k\src\
<basedir>\foobar2k\src\Main.cpp
<basedir>\foobar2k\src\Resources.h
<basedir>\foobar2k\src\Resources.rc
<basedir>\foobar2k\src\StdAfx.cpp
<basedir>\foobar2k\src\StdAfx.h
foobar2k.vcproj looks like the following for me. You could easily add the sample sources and build the sample component instead.
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="foobar2k"
ProjectGUID="{85FBFD09-0099-4FE9-9DB6-78DB6F60F817}"
RootNamespace="foobar2k"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ProjectName)\out"
IntermediateDirectory="$(ProjectName)\obj"
ConfigurationType="2"
CharacterSet="1"
DeleteExtensionsOnClean=""
ExcludeBuckets="5;6;8;10;13;14;15;16;18"
>
<Tool
Name="VCPreBuildEventTool"
Description="Deleting $(TargetFileName) from player directory..."
CommandLine="ERASE /F /Q "C:\Program Files\foobar2000\components\$(TargetFileName)""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="$(ProjectName)\sdk"
PreprocessorDefinitions="NOMINMAX;WIN32;_WIN32_WINNT=0x501"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
WarningLevel="4"
DebugInformationFormat="3"
DisableSpecificWarnings="4652"
ErrorReporting="0"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="shared.lib shell32.lib user32.lib $(NOINHERIT)"
OutputFile="$(OutDir)\foo_sample.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="$(ProjectName)\sdk\foobar2000\shared"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
ErrorReporting="0"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying $(TargetFileName) to player directory..."
CommandLine="COPY /B /Y "$(TargetPath)" "C:\Program Files\foobar2000\components\""
/>
</Configuration>
</Configurations>
<Files>
<File
RelativePath=".\foobar2k\src\Main.cpp"
>
</File>
<File
RelativePath=".\foobar2k\src\Resources.h"
>
</File>
<File
RelativePath=".\foobar2k\src\Resources.rc"
>
</File>
<File
RelativePath=".\foobar2k\src\StdAfx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
WarningLevel="3"
DisableSpecificWarnings="4995;4996"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\foobar2k\src\StdAfx.h"
>
</File>
</Files>
</VisualStudioProject>
Main.cpp is where the component is defined and initquit lives. It starts out like this:
#include "StdAfx.h"
#include <foobar2000/foobar2000_component_client/component_client.cpp>
DECLARE_COMPONENT_VERSION(...);
class Main : public initquit
{
public:
void on_init();
void on_quit();
};
static const initquit_factory_t<Main> initquit_factory_g;
...
Resources.h and Resources.rc are standard resource files for version, dialog, etc.
StdAfx.h is the precompiled header. It pulls in all the foobar2000 SDK headers like so:
#include <foobar2000/ATLHelpers/ATLHelpers.h> // includes all foobar2000 headers
StdAfx.cpp is marked as the file for generating the precompiled headers and also imports all foobar2000 SDK sources like so:
#include "StdAfx.h"
#include <foobar2000/SDK/abort_callback.cpp>
#include <foobar2000/SDK/advconfig.cpp>
#include <foobar2000/SDK/album_art.cpp>
#include <foobar2000/SDK/app_close_blocker.cpp>
#include <foobar2000/SDK/audio_chunk.cpp>
#include <foobar2000/SDK/audio_chunk_channel_config.cpp>
#include <foobar2000/SDK/cfg_var.cpp>
#include <foobar2000/SDK/chapterizer.cpp>
#include <foobar2000/SDK/commandline.cpp>
#include <foobar2000/SDK/completion_notify.cpp>
#include <foobar2000/SDK/config_object.cpp>
#include <foobar2000/SDK/console.cpp>
#include <foobar2000/SDK/dsp.cpp>
#include <foobar2000/SDK/dsp_manager.cpp>
#include <foobar2000/SDK/file_info.cpp>
#include <foobar2000/SDK/file_info_impl.cpp>
#include <foobar2000/SDK/file_info_merge.cpp>
#include <foobar2000/SDK/file_operation_callback.cpp>
#include <foobar2000/SDK/filesystem.cpp>
#include <foobar2000/SDK/filesystem_helper.cpp>
#include <foobar2000/SDK/guids.cpp>
#include <foobar2000/SDK/hasher_md5.cpp>
#include <foobar2000/SDK/input.cpp>
#include <foobar2000/SDK/input_file_type.cpp>
#include <foobar2000/SDK/link_resolver.cpp>
#include <foobar2000/SDK/mainmenu.cpp>
#include <foobar2000/SDK/mem_block_container.cpp>
#include <foobar2000/SDK/menu_helpers.cpp>
#include <foobar2000/SDK/menu_item.cpp>
#include <foobar2000/SDK/menu_manager.cpp>
#include <foobar2000/SDK/metadb.cpp>
#include <foobar2000/SDK/metadb_handle.cpp>
#include <foobar2000/SDK/metadb_handle_list.cpp>
#include <foobar2000/SDK/packet_decoder.cpp>
#include <foobar2000/SDK/playable_location.cpp>
#include <foobar2000/SDK/playback_control.cpp>
#include <foobar2000/SDK/playlist.cpp>
#include <foobar2000/SDK/playlist_loader.cpp>
#include <foobar2000/SDK/popup_message.cpp>
#include <foobar2000/SDK/preferences_page.cpp>
#include <foobar2000/SDK/replaygain.cpp>
#include <foobar2000/SDK/replaygain_info.cpp>
#include <foobar2000/SDK/service.cpp>
#include <foobar2000/SDK/tag_processor.cpp>
#include <foobar2000/SDK/tag_processor_id3v2.cpp>
#include <foobar2000/SDK/threaded_process.cpp>
#include <foobar2000/SDK/titleformat.cpp>
#include <foobar2000/SDK/ui.cpp>
#include <foobar2000/SDK/ui_element.cpp>
#include <foobar2000/helpers/clipboard.cpp>
#include <foobar2000/helpers/create_directory_helper.cpp>
#include <foobar2000/helpers/cue_creator.cpp>
#include <foobar2000/helpers/cue_parser.cpp>
#include <foobar2000/helpers/cue_parser_embedding.cpp>
#include <foobar2000/helpers/cuesheet_index_list.cpp>
#include <foobar2000/helpers/dialog_resize_helper.cpp>
#include <foobar2000/helpers/dropdown_helper.cpp>
#include <foobar2000/helpers/dynamic_bitrate_helper.cpp>
#include <foobar2000/helpers/file_info_const_impl.cpp>
#include <foobar2000/helpers/file_list_helper.cpp>
#include <foobar2000/helpers/file_move_helper.cpp>
#include <foobar2000/helpers/file_wrapper_simple.cpp>
//#include <foobar2000/helpers/filetimetools.cpp>
#include <foobar2000/helpers/IDataObjectUtils.cpp>
#include <foobar2000/helpers/input_helpers.cpp>
#include <foobar2000/helpers/listview_helper.cpp>
#include <foobar2000/helpers/metadb_io_hintlist.cpp>
#include <foobar2000/helpers/mp3_utils.cpp>
#include <foobar2000/helpers/seekabilizer.cpp>
#include <foobar2000/helpers/stream_buffer_helper.cpp>
#include <foobar2000/helpers/text_file_loader.cpp>
#include <foobar2000/helpers/VisUtils.cpp>
#include <foobar2000/helpers/wildcard.cpp>
#include <foobar2000/helpers/win32_dialog.cpp>
#include <foobar2000/helpers/win32_misc.cpp>
#include <foobar2000/helpers/window_placement_helper.cpp>
#include <foobar2000/ATLHelpers/AutoComplete.cpp>
#include <foobar2000/ATLHelpers/CDialogResizeHelper.cpp>
#include <foobar2000/ATLHelpers/inplace_edit.cpp>
#include <foobar2000/ATLHelpers/inplace_edit_v2.cpp>
#include <foobar2000/ATLHelpers/misc.cpp>
#include <pfc/base64.cpp>
#include <pfc/bsearch.cpp>
#include <pfc/guid.cpp>
#include <pfc/other.cpp>
#include <pfc/pathUtils.cpp>
#include <pfc/printf.cpp>
#include <pfc/profiler.cpp>
#include <pfc/selftest.cpp>
#include <pfc/sort.cpp>
#include <pfc/string.cpp>
#include <pfc/string_conv.cpp>
#include <pfc/stringNew.cpp>
#include <pfc/threads.cpp>
#include <pfc/utf8.cpp>
There was a conflict between one of the cue file sources and filetimetools, so I had to comment one of the two out. A simple edit to either would alleviate the problem, but I wanted to be able to take the SDK in with zero edits.
Cry foul if you like, but it builds my component DLL successfully and I don't need to fuss with any of the SDK project files.