C++ COM Object Code (Very Small)

Cancelado Publicado Sep 23, 2008 Pagado a la entrega
Cancelado Pagado a la entrega

This project is to fix the below functions with the missing code. Its only a few lines of code - a working program is not needed.

==============================

void iTunesConnect() {

CoInitialize(0);

HRESULT hRes;

hRes = ::CoCreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER, IID_IiTunes, (PVOID *)&iTunes);

// NEEDED: Code needed here to disable COM "Server Busy" messages

}

void DoSomething() {

IITSource *source;

IITPlaylistCollection *playlists;

int d;

iTunes->get_LibrarySource(&source);

source->get_Playlists(&playlists);

playlists->get_Count((long*)&d);

return d;

}

void iTunesDisconnect() {

// NEEDED: Code needed here to fully disconnect the COM object

iTunes->Release();

iTunes = NULL;

return;

}

======================

The code above sets up a COM connection with the iTunes program and performs functions on it. There are two problems: Occasionally the code will show a COM error message: "Server is Busy" if the DoSomething() function is called while iTunes is in use and (2) The iTunesDisconnect function does not fully work - even after the program is closed if the user tries to quit iTunes a message that "another program is connected" to iTunes is displayed.

This project is for the lines of code needed below to make sure the "Server Busy" message does not display and for fully disconnecting the COM object. Please include any "#include" statements that would be needed.

I am just looking for the code. This should be easy if you know what you are doing - I don't need a full program. I will plug your code in to the full program for testing.

Let me know if you have any questions.

Programación en C Ingeniería Microsoft MySQL PHP Arquitectura de software Verificación de software Windows Desktop

Nº del proyecto: #3252199

Sobre el proyecto

Proyecto remoto Activo Sep 23, 2008