Click here to Skip to main content
15,917,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Menu and document Pin
«_Superman_»7-Apr-09 23:22
professional«_Superman_»7-Apr-09 23:22 
GeneralRe: Menu and document Pin
gopalan.kaliyamoorthy8-Apr-09 18:40
gopalan.kaliyamoorthy8-Apr-09 18:40 
GeneralRe: Menu and document Pin
«_Superman_»8-Apr-09 19:07
professional«_Superman_»8-Apr-09 19:07 
Questionprint in splitted window Pin
susanne17-Apr-09 22:35
susanne17-Apr-09 22:35 
Questionhow to set a class member function as parameter of an other class in its constructor ? Pin
pedefetoll7-Apr-09 22:22
pedefetoll7-Apr-09 22:22 
AnswerRe: how to set a class member function as parameter of an other class in its constructor ? Pin
TinyDevices7-Apr-09 22:26
professionalTinyDevices7-Apr-09 22:26 
GeneralRe: how to set a class member function as parameter of an other class in its constructor ? Pin
pedefetoll7-Apr-09 22:40
pedefetoll7-Apr-09 22:40 
AnswerRe: how to set a class member function as parameter of an other class in its constructor ? Pin
Stuart Dootson7-Apr-09 22:34
professionalStuart Dootson7-Apr-09 22:34 
QuestionWriting a similar function as ComboBox SelectString Pin
beko7-Apr-09 21:16
beko7-Apr-09 21:16 
AnswerRe: Writing a similar function as ComboBox SelectString Pin
Stuart Dootson7-Apr-09 21:53
professionalStuart Dootson7-Apr-09 21:53 
GeneralRe: Writing a similar function as ComboBox SelectString Pin
beko7-Apr-09 22:09
beko7-Apr-09 22:09 
QuestionRe: Writing a similar function as ComboBox SelectString Pin
TinyDevices7-Apr-09 22:23
professionalTinyDevices7-Apr-09 22:23 
AnswerRe: Writing a similar function as ComboBox SelectString Pin
Stuart Dootson7-Apr-09 22:27
professionalStuart Dootson7-Apr-09 22:27 
GeneralRe: Writing a similar function as ComboBox SelectString Pin
TinyDevices7-Apr-09 22:33
professionalTinyDevices7-Apr-09 22:33 
QuestionDLL multy [modified] Pin
denisxfrom7-Apr-09 20:49
denisxfrom7-Apr-09 20:49 
AnswerRe: DLL multy Pin
Stuart Dootson7-Apr-09 21:20
professionalStuart Dootson7-Apr-09 21:20 
Questionhai Pin
roopa.n7-Apr-09 20:39
roopa.n7-Apr-09 20:39 
AnswerRe: hai Pin
TinyDevices7-Apr-09 22:26
professionalTinyDevices7-Apr-09 22:26 
JokeRe: hai Pin
Nelek8-Apr-09 0:30
protectorNelek8-Apr-09 0:30 
AnswerRe: hai Pin
0x3c08-Apr-09 1:32
0x3c08-Apr-09 1:32 
Questionhai Pin
roopa.n7-Apr-09 20:38
roopa.n7-Apr-09 20:38 
AnswerRe: hai Pin
Cedric Moonen7-Apr-09 21:01
Cedric Moonen7-Apr-09 21:01 
AnswerRe: hai Pin
Rajesh R Subramanian7-Apr-09 22:31
professionalRajesh R Subramanian7-Apr-09 22:31 
QuestionAddScanPackageService is retruning E_INVALIDARG Pin
ashish8patil7-Apr-09 20:29
ashish8patil7-Apr-09 20:29 
Hello All ,
My following Code is in cpp and use COM interfaces, My complile and build with 0 errors and 0 warnings .But at run it gives exception .In code line
hr=serviceManager->AddScanPackageService(BSTR("Offline SyncService"),BSTR("c:\\wsusscan.cab"),0,&service);

when this line exicute value of hr is E_INVALIDARG.
plz help my code is as folloing .

/////////////////////////////////////////////////////////////////////

{
IUpdateSession * session = 0;
IUpdateServiceManager * serviceManager = 0;
IUpdateService * service = 0;
IUpdateSearcher * searcher = 0;
ISearchResult * searchResult = 0;
IUpdateCollection *collection=0;
IUpdate *update=0;
HRESULT hr;
CoInitialize(NULL);
hr = CoCreateInstance(CLSID_UpdateServiceManager, 0, CLSCTX_ALL,
IID_IUpdateServiceManager,(LPVOID *)&serviceManager);

hr=CoCreateInstance(CLSID_UpdateSession,0,CLSCTX_ALL,IID_IUpdateSession,
(LPVOID *)&session);
////////////////////////////////////////////
hr=serviceManager->AddScanPackageService(BSTR("Offline Sync Service"),BSTR("c:\\wsusscan.cab"),0,&service);
//////////////////////////////////////////////////////////
hr=session->CreateUpdateSearcher(&searcher);

ServerSelection ss={ ssOthers } ;
BSTR str=0;
hr=searcher->put_ServerSelection(ss);
hr=service->get_ServiceID(&str);
hr=searcher->put_ServiceID(str);
hr=searcher->Search(L"IsInstalled=0",&searchResult );
hr=searchResult->get_Updates(&collection);
LONG count;
hr=collection->get_Count(&count);

for(LONG i=0;i<count;i++)
{
collection->get_Item(i,&update);
update->get_Title(&str);
printf("%s",(char *)str);
}

}


///////////////////////////////////////////////////////////////////////



Thanks for reading this
question/ replying answer.
AnswerRe: AddScanPackageService is retruning E_INVALIDARG Pin
Stuart Dootson7-Apr-09 21:30
professionalStuart Dootson7-Apr-09 21:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.