• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1992
  • Last Modified:

iTunes Development Kit for windows

Hi i'm just learning to do some windows programming and i need to figure out how to use the windows iTunes development kit.  I want to write some plug-ins to help manage my music and to brush up on my C++/VB/Java.  The only coding i've ever done was command line and never did any COM stuff.  I'm using VisualStudio.NET, and i added the iTunes .h and .c file, and add the code as given by apple into my main .cpp file, but i get errors when i try to compile.  Do i have to compile the iTunes files as a library and then include them?  Also i'm trying to learn VisualBasic by looking at some code, and it seems extremely easy but i have no idea how to include the iTunes library.  THis should be an easy answer for someone..  I'm no novice at C++ but i find windows GUI programming unneccessarily complex.  
0
windark
Asked:
windark
  • 4
  • 4
  • 2
  • +1
1 Solution
 
jkrCommented:
>> but i get errors when i try to compile

What errors exactly? Sorry to ask, but my crystall ball is on repair...
0
 
windarkAuthor Commented:
well in my c++ code, the SDK tells to put in these two lines:

HRESULT hRes;    //i have no idea what this is
IiTunes iItunes;   //declares an object of type IiTunes

the error i get is that 'IiTunes is an undeclared identifier'.  I assume it means it can't find the library to which this class belongs.  Its added to my project tho.  I've read that I don't even need the libraries that come in the SDK and it can get everything from iTunes.exe, but is there some way i have to instanciate it?
0
 
jkrCommented:
HRESULT is a standard COM type. I assume you forgot about adding the relevant header files to your code, like

#include <windows.h>
#include <itunes.h>

The name of the latter file however is just a guess...
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
flashdriverCommented:
MMC - How do I create a Win Console
0
 
flashdriverCommented:
Sorrt - did not mean to post that here ...
0
 
windarkAuthor Commented:
heres what i do to get a barebones MFC DLL(called itunestest) including the itunes libraries:
1.  Go to New Project->MFC DLL
2.  Add to project->iTunesCOMInterface.h, iTunesCOMInterface.c
3.  in itunestest.cpp i add:  
                #include <windows.h>
                 #include <iTunesCOMInterface.h>
4.  The error that visual studio gives me is:
       iTunesCOMInterface.c(132): fatal error C1010: Unexpected EOF while looking for precompiled header directive.


I know there isn't an unexpected end of file because its exactly what i dowloaded from apples web site.
Is visaul studio unable to support a c library in a c++ project?
0
 
jkrCommented:
>>iTunesCOMInterface.c(132): fatal error C1010: Unexpected EOF while looking for

This is a problem with VC's standard settings on precompile header files - go to the project settings, choose the C++ tab. go to "Precompiled Headers" and turn that feature off in that dialog (for the time being - for performance reasons, we'll set that again once you can at least build the project)
0
 
windarkAuthor Commented:
Ok it does compile(thanks jkr) but when i added the construction code(declare the itunes object), it gives me an error about not able to make the abstract error type.  WEll, heres the error output:

------ Build started: Project: itunestest, Configuration: Debug Win32 ------

Compiling...
itunestest.cpp
c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\itunestest.cpp(51) : error C2259: 'IiTunes' : cannot instantiate abstract class
        due to following members:
        'HRESULT IUnknown::QueryInterface(const IID &,void ** )' : pure virtual function was not defined
        c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\Unknwn.h(113) : see declaration of 'IUnknown::QueryInterface'
        'ULONG IUnknown::AddRef(void)' : pure virtual function was not defined
        c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\Unknwn.h(117) : see declaration of 'IUnknown::AddRef'
        'ULONG IUnknown::Release(void)' : pure virtual function was not defined
        c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\Unknwn.h(119) : see declaration of 'IUnknown::Release'
        'HRESULT IDispatch::GetTypeInfoCount(UINT *)' : pure virtual function was not defined
        c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\OAIdl.h(2712) : see declaration of 'IDispatch::GetTypeInfoCount'
        'HRESULT IDispatch::GetTypeInfo(UINT,LCID,ITypeInfo ** )' : pure virtual function was not defined
        c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\OAIdl.h(2715) : see declaration of 'IDispatch::GetTypeInfo'
        'HRESULT IDispatch::GetIDsOfNames(const IID &,LPOLESTR * ,UINT,LCID,DISPID *)' : pure virtual function was not defined
        c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\OAIdl.h(2720) : see declaration of 'IDispatch::GetIDsOfNames'
        'HRESULT IDispatch::Invoke(DISPID,const IID &,LCID,WORD,DISPPARAMS *,VARIANT *,EXCEPINFO *,UINT *)' : pure virtual function was not defined
        c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\OAIdl.h(2727) : see declaration of 'IDispatch::Invoke'
        'HRESULT IiTunes::BackTrack(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6941) : see declaration of 'IiTunes::BackTrack'
        'HRESULT IiTunes::FastFor
ward(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6943) : see declaration of 'IiTunes::FastForward'
        'HRESULT IiTunes::NextTrack(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6945) : see declaration of 'IiTunes::NextTrack'
        'HRESULT IiTunes::Pause(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6947) : see declaration of 'IiTunes::Pause'
        'HRESULT IiTunes::Play(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6949) : see declaration of 'IiTunes::Play'
        'HRESULT IiTunes::PlayFile(BSTR)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6951) : see declaration of 'IiTunes::PlayFile'
        'HRESULT IiTunes::PlayPause(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6954) : see declaration of 'IiTunes::PlayPause'
        'HRESULT IiTunes::PreviousTrack(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6956) : see declaration of 'IiTunes::PreviousTrack'
        'HRESULT IiTunes::Resume(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6958) : see declaration of 'IiTunes::Resume'
        'HRESULT IiTunes::Rewind(void)' : pure virtual function was not defined
        c:\Documents and Settin
gs\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6960) : see declaration of 'IiTunes::Rewind'
        'HRESULT IiTunes::Stop(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6962) : see declaration of 'IiTunes::Stop'
        'HRESULT IiTunes::ConvertFile(BSTR,IITOperationStatus ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6964) : see declaration of 'IiTunes::ConvertFile'
        'HRESULT IiTunes::ConvertFiles(VARIANT *,IITOperationStatus ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6968) : see declaration of 'IiTunes::ConvertFiles'
        'HRESULT IiTunes::ConvertTrack(VARIANT *,IITOperationStatus ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6972) : see declaration of 'IiTunes::ConvertTrack'
        'HRESULT IiTunes::ConvertTracks(VARIANT *,IITOperationStatus ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6976) : see declaration of 'IiTunes::ConvertTracks'
        'HRESULT IiTunes::CheckVersion(long,long,VARIANT_BOOL *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6980) : see declaration of 'IiTunes::CheckVersion'
        'HRESULT IiTunes::GetITObjectByID(long,long,long,long,IITObject ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6985) : see declaration of 'IiTunes::GetITObjectByID'
        'HRESULT IiTunes::CreatePlaylist(BSTR,IITPlaylist ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6992) : see declaration of 'IiTunes::CreatePlaylist'
        'HRESULT IiTunes::OpenURL(BSTR)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6996) : see declaration of 'IiTunes::OpenURL'
        'HRESULT IiTunes::GotoMusicStoreHomePage(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(6999) : see declaration of 'IiTunes::GotoMusicStoreHomePage'
        'HRESULT IiTunes::UpdateIPod(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7001) : see declaration of 'IiTunes::UpdateIPod'
        'HRESULT IiTunes::Authorize(long,VARIANT [],BSTR [])' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7003) : see declaration of 'IiTunes::Authorize'
        'HRESULT IiTunes::Quit(void)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7008) : see declaration of 'IiTunes::Quit'
        'HRESULT IiTunes::get_Sources(IITSourceCollection ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7010) : see declaration of 'IiTunes::get_Sources'
        'HRESULT IiTunes::get_Encoders(IITEncoderCollection ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7013) : see declaration of 'IiTunes::get_Encoders'
        'HRESULT IiTunes::get_EQPresets(IITEQPresetCollection ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7016) : see declaration of 'IiTunes::get_EQPresets'
        'HRESULT IiTunes::get_Visuals(IITVisualCollection ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7019) : see declaration of 'IiTunes::get_Visuals'
        'HRESULT IiTunes::get_Windows(IITWindowCollection ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7022) : see declaration of 'IiTunes::get_Windows'
        'HRESULT IiTunes::get_SoundVolume(long *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7025) : see declaration of 'IiTunes::get_SoundVolume'
        'HRESULT IiTunes::put_SoundVolume(long)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7028) : see declaration of 'IiTunes::put_SoundVolume'
        'HRESULT IiTunes::get_Mute(VARIANT_BOOL *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7031) : see declaration of 'IiTunes::get_Mute'
        'HRESULT IiTunes::put_Mute(VARIANT_BOOL)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7034) : see declaration of 'IiTunes::put_Mute'
        'HRESULT IiTunes::get_PlayerState(ITPlayerState *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7037) : see declaration of 'IiTunes::get_PlayerState'
        'HRESULT IiTunes::get_PlayerPosition(long *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7040) : see declaration of 'IiTunes::get_PlayerPosition'
        'HRESULT IiTunes::put_PlayerPosition(long)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7043) : see declaration of 'IiTunes::put_PlayerPosition'
        'HRESULT IiTunes::get_CurrentEncoder(IITEncoder ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7046) : see declaration of 'IiTunes::get_CurrentEncoder'
        'HRESULT IiTunes::put_CurrentEncoder(IITEncoder *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7049) : see declaration of 'IiTunes::put_CurrentEncoder'
        'HRESULT IiTunes::get_VisualsEnabled(VARIANT_BOOL *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7052) : see declaration of 'IiTunes::get_VisualsEnabled'
        'HRESULT IiTunes::put_VisualsEnabled(VARIANT_BOOL)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7055) : see declaration of 'IiTunes::put_VisualsEnabled'
        'HRESULT IiTunes::get_FullScreenVisuals(VARIANT_BOOL *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7058) : see declaration of 'IiTunes::get_FullScreenVisuals'
        'HRESULT IiTunes::put_FullScreenVisuals(VARIANT_BOOL)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7061) : see declaration of 'IiTunes::put_FullScreenVisuals'
        'HRESULT IiTunes::get_VisualSize(ITVisualSize *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7064) : see declaration of 'IiTunes::get_VisualSize'
        'HRESULT IiTunes::put_VisualSize(ITVisualSize)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7067) : see declaration of 'IiTunes::put_VisualSize'
        'HRESULT IiTunes::get_CurrentVisual(IITVisual ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7070) : see declaration of 'IiTunes::get_CurrentVisual'
        'HRESULT IiTunes::put_CurrentVisual(IITVisual *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7073) : see declaration of 'IiTunes::put_CurrentVisual'
        'HRESULT IiTunes::get_EQEnabled(VARIANT_BOOL *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7076) : see declaration of 'IiTunes::get_EQEnabled'
        'HRESULT IiTunes::put_EQEnabled(VARIANT_BOOL)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7079) : see declaration of 'IiTunes::put_EQEnabled'
        'HRESULT IiTunes::get_CurrentEQPreset(IITEQPreset ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Docu
ments\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7082) : see declaration of 'IiTunes::get_CurrentEQPreset'
        'HRESULT IiTunes::put_CurrentEQPreset(IITEQPreset *)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7085) : see declaration of 'IiTunes::put_CurrentEQPreset'
        'HRESULT IiTunes::get_CurrentStreamTitle(BSTR * )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7088) : see declaration of 'IiTunes::get_CurrentStreamTitle'
        'HRESULT IiTunes::get_CurrentStreamURL(BSTR * )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7091) : see declaration of 'IiTunes::get_CurrentStreamURL'
        'HRESULT IiTunes::get_BrowserWindow(IITBrowserWindow ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7094) : see declaration of 'IiTunes::get_BrowserWindow'
        'HRESULT IiTunes::get_EQWindow(IITWindow ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7097) : see declaration of 'IiTunes::get_EQWindow'
        'HRESULT IiTunes::get_LibrarySource(IITSource ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7100) : see declaration of 'IiTunes::get_LibrarySource'
        'HRESULT IiTunes::get_LibraryPlaylist(IITLibraryPlaylist ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7103) : see declaration of 'IiTunes::get_LibraryPlaylist'

        'HRESULT IiTunes::get_CurrentTrack(IITTrack ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7106) : see declaration of 'IiTunes::get_CurrentTrack'
        'HRESULT IiTunes::get_CurrentPlaylist(IITPlaylist ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7109) : see declaration of 'IiTunes::get_CurrentPlaylist'
        'HRESULT IiTunes::get_SelectedTracks(IITTrackCollection ** )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7112) : see declaration of 'IiTunes::get_SelectedTracks'
        'HRESULT IiTunes::get_Version(BSTR * )' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7115) : see declaration of 'IiTunes::get_Version'
        'HRESULT IiTunes::SetOptions(long)' : pure virtual function was not defined
        c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\iTunesCOMInterface.h(7118) : see declaration of 'IiTunes::SetOptions'

Build log was saved at "file://c:\Documents and Settings\Matthew Crider\My Documents\Visual Studio Projects\itunestest\Debug\BuildLog.htm"
itunestest - 1 error(s), 0 warning(s)


---------------------- Done ----------------------

    Build: 0 succeeded, 1 failed, 0 skipped


0
 
jkrCommented:
>>error C2259: 'IiTunes' : cannot instantiate abstract class

You cannot use that like

IiTunes it;

since this is an *interface*, not a class implementation. It should be more like

IiTunes* pit;

CoCreateInstance ( &clsid, NULL, CSLCTX_SERVER, &IID_ITunes, (LPVOID) &pit);
0
 
windarkAuthor Commented:
Gotcha..  I've never used an interface before.  I'll try this when i get home from work.  Its just that the code i used is copied directly from the help file that comes w/ the SDK.
0
 
kileenchengCommented:
Hi,

I am doing the same thing and seeing the same problems.  However, the previous comment by jkr to declare "IiTunes* pit" did allow my program to compile, but the use of "CoCreateInstance" is now throwing errors:  

Compiling...
LViTunes.cpp
c:\documents and settings\kcheng\desktop\lvitunes\lvitunes.cpp(14) : error C2501: 'CoCreateInstance' : missing storage-class or type specifiers
c:\documents and settings\kcheng\desktop\lvitunes\lvitunes.cpp(14) : error C2373: 'CoCreateInstance' : redefinition; different type modifiers
        c:\program files\microsoft visual studio\vc98\include\objbase.h(649) : see declaration of 'CoCreateInstance'
c:\documents and settings\kcheng\desktop\lvitunes\lvitunes.cpp(14) : error C2078: too many initializers
c:\documents and settings\kcheng\desktop\lvitunes\lvitunes.cpp(14) : error C2440: 'initializing' : cannot convert from 'void ** ' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.

LViTunes.dll - 4 error(s), 0 warning(s)


My code is as follows:  

#include "iTunesCOMInterface.h"

HRESULT hRes;
IiTunes* piITunes;

CoCreateInstance ( CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER, IID_IiTunes, (PVOID *) &piITunes);

I think I do need to set the return value of CoCreateInstance to hRes, but that gives errors too.  

Ideas?  Thanks!

Kileen
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now