?
Solved

-# Internet Explorer creating offline sites #-

Posted on 2001-08-26
7
Medium Priority
?
318 Views
Last Modified: 2008-03-17
I'm trying to create a offline site using the ISubscritpionMgr interface. The site should be synchronized every 12 hours.
I currently got stucked with the code below - I always get an "invalid parameter" error. I've no idea why.

void CSubscriptionMgr::SubcribeURL(CString strURL, CString strFiendlyName, TASK_TRIGGER_TYPE Interval, TRIGGER_TYPE_UNION IntervalSettings, int iStartHour, int iStartMinute)
{
     HRESULT hr;
     BSTR bstrURL;
     BSTR bstrName;
     SUBSCRIPTIONINFO sinfo;
    TASK_TRIGGER trig;
     SYSTEMTIME st;
     
     memset(&sinfo, 0, sizeof(sinfo));
     sinfo.cbSize = sizeof(sinfo);
     memset(&trig, 0, sizeof(trig));
     trig.cbTriggerSize = sizeof(trig);
     
     bstrURL = strURL.AllocSysString();
     bstrName = strFiendlyName.AllocSysString();

// Fill in current local date and time
     GetLocalTime(&st);
     trig.wBeginYear = st.wYear;
     trig.wBeginMonth = st.wMonth;
     trig.wBeginDay = st.wDay;
     trig.wStartHour = iStartHour;
     trig.wStartMinute = iStartMinute;
     trig.TriggerType = Interval;
     trig.Type = IntervalSettings;

     sinfo.fUpdateFlags = SUBSINFO_SCHEDULE | SUBSINFO_RECURSE | SUBSINFO_WEBCRAWL | SUBSINFO_TASKFLAGS | SUBSINFO_GLEAM | SUBSINFO_FRIENDLYNAME | SUBSINFO_NEEDPASSWORD | SUBSINFO_TYPE;
     sinfo.schedule = SUBSSCHED_WEEKLY; //SUBSSCHED_CUSTOM;
     sinfo.pTrigger = &trig;
     sinfo.dwRecurseLevels = 3;
     sinfo.fWebcrawlerFlags = WEBCRAWL_GET_IMAGES & WEBCRAWL_GET_VIDEOS & WEBCRAWL_GET_BGSOUNDS & WEBCRAWL_GET_CONTROLS;
     sinfo.bMailNotification = false;
     sinfo.bGleam = true;
     sinfo.bChangesOnly = false;
     sinfo.bNeedPassword = false;
     sinfo.fChannelFlags = 0; //CHANNEL_AGENT_PRECACHE_ALL;
     sinfo.bstrFriendlyName = bstrName;
     sinfo.dwMaxSizeKB = 500;
     sinfo.subType = SUBSTYPE_URL;
     sinfo.fTaskFlags = 1040; /////0000000000000
     sinfo.dwReserved = 0;
     
//     hr = pSubscriptionMgr->IsSubscribed(bstrURL, &Bool);
     hr = pSubscriptionMgr->CreateSubscription(NULL,
                                        bstrURL,
                                        bstrName,
                                        CREATESUBS_NOUI | CREATESUBS_ADDTOFAVORITES | CREATESUBS_FROMFAVORITES,
                                        SUBSTYPE_URL,
                                        &sinfo);
     SysFreeString (bstrURL);
     SysFreeString (bstrName);
     CheckHResult(hr);
}
0
Comment
Question by:ptmcomp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6433602
Did you check the sample at http://support.microsoft.com/support/kb/articles/Q264/4/60.ASP ?

BTW,

sinfo.fWebcrawlerFlags = WEBCRAWL_GET_IMAGES & WEBCRAWL_GET_VIDEOS & WEBCRAWL_GET_BGSOUNDS & WEBCRAWL_GET_CONTROLS;

should probably read

sinfo.fWebcrawlerFlags = WEBCRAWL_GET_IMAGES | WEBCRAWL_GET_VIDEOS | WEBCRAWL_GET_BGSOUNDS | WEBCRAWL_GET_CONTROLS;

(to combine bitflags, you have to use the bitwise 'or', not the bitwise 'and')
0
 
LVL 10

Author Comment

by:ptmcomp
ID: 6438580
Hi jkr

The MSDN sample above won't work since the trig structure is not correct initialized (cbSize is not set!).
I found out why my code didn't work. Whenever I set the pTrigger pointer, it failed. Actually I worked around by setting everything but the pTrigger pointer. Then I retrieve the cookie CLSID value and enumerate the triggers (ITaskScheduler interface) looking for same CLSID. Then I set the properties through the ITaskItem interface. This works for me. However if someone can tell me how to do this without this workaround, I still offer this 200 points.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6676602
ptmcomp:

You logged in as recently as November, but have not updated/finalized your open questions, many of which are very old.  You've asked 20 questions, but only graded/closed 10 of them.  I have updated all your open questions with this information so that you can easily navigate through the and finalize them.  

Here are the options:
 
1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.
 
2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
3.  Ask Community Support to help split points between participating experts.  Just comment here with details.
 
4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  
 
PLEASE DO NOT AWARD THE POINTS TO ME.  
____________________________________________
 
 
Hi Experts:
 
In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.
 
Experts, please do not add further "answer" information to this question.  I will be back as quickly as I can to finalize this, if it remains open.
 
Thank you everyone.
 
Moondancer :)
Community Support Moderator @ Experts Exchange
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 10

Author Comment

by:ptmcomp
ID: 6677123
No answer till now :o(
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6780422
ptmcomp,

These questions are still open and our records indicate you logged in as recently as today. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days.

http://www.experts-exchange.com/jsp/qShow.jsp?qid=20114574
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20174312
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20114575
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20114691
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20154079
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20257617

EXPERTS: Please leave your thoughts on this question here.

Thanks,

Netminder
Community Support Moderator
Experts Exchange
0
 
LVL 10

Author Comment

by:ptmcomp
ID: 6784144
Still no answer :o(((
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 6821923
Points refunded and question closed.

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question