Please i need Help.. ( HOW delete a record from internet explorer 's history)

Hi

(Sorry for my very bad english)

I try to delete  a record from Internet  explorer' history in Visual c++,
and i found this sample code on the  microsoft web site

                USES_CONVERSION;
                CoInitialize(NULL);

                IUrlHistoryStg2* pUrlHistoryStg2 = NULL;
    	HRESULT hr = CoCreateInstance(CLSID_CUrlHistory,NULL, CLSCTX_INPROC,
IID_IUrlHistoryStg2,(void**)&pUrlHistoryStg2);

    	IEnumSTATURL* pEnumURL;
    	hr = pUrlHistoryStg2->EnumUrls(&pEnumURL);

    	STATURL suURL;
    	ULONG pceltFetched;
    	suURL.cbSize = sizeof(suURL);
    	hr = pEnumURL->Reset();

    	while((hr = pEnumURL->Next(1, &suURL, &pceltFetched)) == S_OK)
    	{
    		hr = pUrlHistoryStg2->DeleteUrl(suURL.pwcsUrl, 0);
    		printf("\"%s\" deleted.\n", W2T(suURL.pwcsUrl));
    	}

    	pEnumURL->Release();
    	pUrlHistoryStg2->Release();
    	CoUninitialize();


But  when i execute this code the fonction pUrlHistoryStg2->DeleteUrl(...)
has no effect.

Please have you a solution ?





0
1/24/2005 10:20:32 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
425 Views

Similar Articles

[PageSpeed] 27

bertrand doradoux wrote:
> Hi
>
> (Sorry for my very bad english)
>
> I try to delete  a record from Internet  explorer' history in Visual
c++,
> and i found this sample code on the  microsoft web site
>
>                 USES_CONVERSION;
>                 CoInitialize(NULL);
>
>                 IUrlHistoryStg2* pUrlHistoryStg2 = NULL;
>     	HRESULT hr = CoCreateInstance(CLSID_CUrlHistory,NULL,
CLSCTX_INPROC,
> IID_IUrlHistoryStg2,(void**)&pUrlHistoryStg2);
>
>     	IEnumSTATURL* pEnumURL;
>     	hr = pUrlHistoryStg2->EnumUrls(&pEnumURL);
>
>     	STATURL suURL;
>     	ULONG pceltFetched;
>     	suURL.cbSize = sizeof(suURL);
>     	hr = pEnumURL->Reset();
>
>     	while((hr = pEnumURL->Next(1, &suURL, &pceltFetched)) == S_OK)
>     	{
>     		hr = pUrlHistoryStg2->DeleteUrl(suURL.pwcsUrl, 0);
>     		printf("\"%s\" deleted.\n", W2T(suURL.pwcsUrl));
>     	}
>
>     	pEnumURL->Release();
>     	pUrlHistoryStg2->Release();
>     	CoUninitialize();
>
>
> But  when i execute this code the fonction
pUrlHistoryStg2->DeleteUrl(...)
> has no effect.
>
> Please have you a solution ?

Why don't you figure out what DeleteURL is returning?

hr = pUrlHistoryStg2->DeleteUrl(suURL.pwcsUrl, 0);
if (FAILED(hr))
_tprintf(  _T("Failed to delete \"%s"\ (hr=%#08x)\n"),
W2T(suURL.pwcsUrl),
hr
);
else
_tprintf(  _T("\"%s\" deleted.\n"),
W2T(suURL.pwcsUrl)
);

Note you really shouldn't trust code just because it is there. If
you're going to use W2T at least use TCHAR methods (_tprintf,_T etc.)

0
rquirk1 (133)
1/26/2005 1:44:29 PM
Reply:

Similar Artilces:

deleting data, keep formulas
I want to delete the data in a worksheet, but keep the formulas so tha I have a worksheet pattern of formulas that I use frequently -- elviejo4 ----------------------------------------------------------------------- elviejo41's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2356 View this thread: http://www.excelforum.com/showthread.php?threadid=39389 Cells.SpecialCells(xlCellTypeConstants, xlNumbers).ClearContents I don't know how large your spreadsheet is, but you could try changin the setting to display Formulas (Tools>Options | View tab, in th Win...

Deleting Phantom Lines in Excel
I am finding phantom lines when I print. They are not in the file and don't show up on the print preview. Please help ...

Accessing Record Buffer in MCI
Hi all, I am using MCI to record user audio through mic or any other recording device. While I can play it back and save the audio easily, I have not found any method to directly access recorded buffer. How do i do this? Thanks in advance nightcrawler wrote: > Hi all, > > I am using MCI to record user audio through mic or any other recording > device. While I can play it back and save the audio easily, I have not > found any method to directly access recorded buffer. > > How do i do this? > > Thanks in advance I think you can save your recorded buffer to a mem...

Windows for newly converted records not showing up...
We seems to have a problem with our CRM system where someone tries to "Convert a Lead" and clicks the "Open newly created record(s)" checkbox. The system will convert the lead and create all the necessary records, but it will NOT open the newly created records. At first I thought it was a Pop-Up block issue, but I tried it myself with all Pop-Up blocking turned OFF and it still is happening. Any Ideas? Regards, Eric S. ...

HELP: "Delete Team" Privilege
Hi, I'm new to MS CRM. The default installation of MS CRM does not provide a privilege to delete a team in any of the roles (some other privileges missing as well). The manual states that the sysdamin should enable this privilege. How can this be done? What am I missing? Thanks for your help! Andrew ...

i need to format a column as microseconds ? how do i do this
i need to format a column as microseconds ? how do i do this eg : hh:mm:ss.___ Format>Cells>Custom In the Type box, enter hh:mm:ss.000 -- Kind Regards, Niek Otten Microsoft MVP - Excel "SMT" <SMT@discussions.microsoft.com> wrote in message news:CF0BAF0B-FEC9-46CD-9784-3FDBEBA6729F@microsoft.com... >i need to format a column as microseconds ? how do i do this > eg : hh:mm:ss.___ ...

voting buttons not recording.
On occasions when voting Yes/No buttons (Outlook 2002) have been used the replies do not always tally on the original sender's e-mail. Any suggestions as to why and any fix. ...

Urgent Help #4
Okay here is a sequence of events that have led to a bad situation that I can't solve. User account logon was set to NAME Use account logon was renamed to NAME.SURNAME POP Mail was then configured to be delivered to the MAILBOX OF NAME (NAME.SURNAME did not exist in list of options) Logon to NAME.SURNAME and no mail existed Use account logon was renamed back to NAME Logon and no mail existed but was starting to recieve new mail It would now appear that the mail that went in to the "black hole" is in the system mailbox that is not openable. What can I do???? Help please. ...

Help #25
I own a small moving company, and I am looking for a program that will allow me to give faster quotes. I need some thing where I can give each piece of furniture a certain code and save a price for that code, and when I enter all the different types of furniture it will calculate the total of all the pieces for me. If any one has any ideas of what I could use please email me at: 2MOVERS.COM@OPERAMAIL.COM Thanks Tyrone Hi Tyrone if you'ld like to email me direct (julied_ng at hcts dot net dot au) i'll be happy to send you a workbook that might give you some ideas. Cheers Juli...

Report Footer Help Needed Please
I have a report (a bill of lading) that I want to print 4 copies of. But at the bottom of each page I need a different statement printed (1st copy - "Original", 2nd copy "Customer Copy", 3rd copy "File Copy", etc.) Can anyone guide me in the right direction to accomplish this? Duane: Thanks for your quick response. I tried this, but I can not get it to work. Any other suggestions? Thanks, T "Duane Hookom" <duanehookom@NO_SPAMhotmail.com> wrote in message news:988241CB-1FD8-4EA7-98AD-7310A005CAA2@microsoft.com... > Allen Browne has a ...

Offline Outlook Synchronization should allow ALL records
I finally got my Great Plains integration with CRM working, and I have to say that I am very disappointed that my customers do not synch with Outlook. I just realized that only records that are "owned" by me will synchronize, and not my entire database. All of my Great Plains records are owned by the Integration user. I'm not sure that if I change ownership to myself, whether that will mess up the integration with Great Plains. (does anyone know the answer to this?) My suggestion is that all users should be able to synchronize all accounts, contacts & leads with th...

In offline mode, need send/receive twice
I have a customer and he has a strange issue in outlook. He uses XP, Outlook2002 and exchange server. When he use "connect" mode, everything is OK. When he use "work offline" mode, he has a problem. After he create a new mail, click "send" button, this mail goto outbox.(It is normal process) Then he click "send/receive" button or F9, but this mail still in his outbox, no send out. He need to double click this mail to open again, click "send" button again. Then click "send/receive" button again, this time this mail can send out. So...

delete old exchange server from AD
Exchange System Manager shows two servers - one of which no longer exists. Now I can't remove the old server, because it does not exist! (I get the error message shown below) Just to be clear: the old exchange server hardware is gone. I cannot uninstall the old exchange server because the hardware is gone. I can't connect to the old exchange server because the hardware is gone. My existing exchange server is still trying to replicate to the old exchange server which no longer exists. Presumably the information is held in Active Directory. How do I tell my Exchange server not...

Need to add Section Letters after page numbers in my footers
I need to add a section (i.e. SB) after the page number in my footer so it will show up in my TOC. How do I do that? There is no way to do exactly what you want in Word. The best you can do is insert the numbering from Word's heading styles (see http://word.mvps.org/faqs/numbering/chapternumber.htm) or from SEQ fields (see the "Adding chapter numbering" section of the article at http://sbarnhill.mvps.org/WordFAQs/TOCTips.htm). -- Stefan Blom Microsoft Word MVP "Barbados56" <Barbados56@discussions.microsoft.com> wrote in message news:657...

Deleting Rows 04-20-10
Hi Folks, I want to delete two rows - one row has the words "Employee Name" in the first column, and the row before it. This for-next loop removes the row with "Employee Name": For Lrow = LastRow To FirstRow Step -1 If .Cells(Lrow, "A").Value = "Employee Name" Then _ .Rows(Lrow).Delete Next Lrow Any suggestions how to delete the row with "Employee Name" and the one before it? Thanks! Scott Here is one way, without a lot of re-write. For Lrow = LastRow To FirstRow S...

Cannot delete a public folder #2
Hello, I have a public folder under all public folders that I cannot delete. When I try to delete it in Outlook is says "Some items could not be deleted. They were either moved or already deleted, or access was denied." When I try to delete the folder from ESM it asks me if if I'm sure, I click yes and then get prompted for authentication. I have tried both the domain adminstrators account and the account I use to administer the domain and Exchange. It just keeps prompting me for a user name and password until finally it says access denied. I've gone through just abou...

Can't delete Favorites folder!
When I attempt to delete a Favorites folder in IE8, I get: "Access is denied. Make sure the disk is not full or write protected and that the file is not currently in use". Any suggestions? Hi, That is the expected behavior for Vista and Win7(?). Can I ask why you want to delete your Favorites folder? IE8 will not work properly without a Favorites folder. On Vista and Win7 it is a special folder that cannot be moved or deleted. Regards. "J. Earthling" <earthling@planet.earth> wrote in message news:eb73gk0sKHA.4712@TK2MSFTNGP04.phx.gbl......

Need template to show considerations/alternatives-reach decision
Would like to be able to fill in columns of info to have comparisons available to reach appropriate decision. Could you please provide specifics so we could suggest a solution? "Oneforages" wrote: > Would like to be able to fill in columns of info to have comparisons > available to reach appropriate decision. ...

How to delete/update controls and related codes?
Hello all, I am using VS 2005 to generate a MFC application. I am wondering after I generating an application using Unicode, how can I delete it without regenerating the application? Also, if I use recourse editor to add some controls and class wizard to add variables to connect these controls, how can I delete or update them completely? If I delete a button from the resource editor, I have to delete some related codes elsewhere. I also found that class wizard will change variables into grey (do not allow to change). What should I do? Thanks in advance. Zhidian Du You just have to...

help with combo box display...plz...
i have a multicolumn combo box...with columns FName, MName, and LName...how can i enable it to display the 3 values of the column when a row is selected?? it's like that i'm merging the 3 values int the text box display of the combo box...please....thank yu -- ai® On Fri, 20 Apr 2007 08:30:20 GMT, ai_enjoi wrote: > i have a multicolumn combo box...with columns FName, MName, and LName...how > can i enable it to display the 3 values of the column when a row is selected?? > it's like that i'm merging the 3 values int the text box display of the combo > box......

deleted folder
Version: Older version Operating System: Mac OS X 10.2 (Jaguar) Email Client: imap I accidentally deleted a folder from my Entourage folders list. How do I restore it? > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3342528516_1429726 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit On 12/1/09 3:47 PM, in article 59baded8.-1@webcrossing.JaKIaxP2ac0, "RenaP@officeformac.com" <RenaP@officeformac.com> wrote: > I accidentall...

Can not get Excel macros to format/save charts--help??? :(((((
Help??:((( I've spent the last 5 days searching on this forum for problems similar to what I have but no luck! I am trying to use Excel macro to create a simple bar chart and to format the chart type/etc...but the macro keeps erroring when I try to run it. The debug points to " ' Set ActiveChart = ActiveSheet.ChartObjects(Chart1)" run time error 1004. No matter what I name the chart, it errors. I'm advanced at Excel but not editing macros with VB. I'm at my wits end and hope that someone can help me :(( Hi, You do not set the Activechart ob...

delete log files
have a filled up drive- no need for logfiles in this instance circumstance would allow circular logging for next few months, before setting though, need to reclaim space on hdd. how to tell which logfiles I can delete and not hose the db? In news:14ABD827-B264-4626-8970-20E5578A4053@microsoft.com, AlexandrDiogenes@hotmail.com <AlexandrDiogeneshotmailcom@discussions.microsoft.com> typed: > have a filled up drive- no need for logfiles in this instance > circumstance would allow circular logging for next few months, before > setting though, need to reclaim space on hdd. how ...

MSCRM API failing with User defined fields.Help !
Iam programming in ASP.NET for my company's MSCRM. I use MSAPI to retrieve and update field values in MSCRM. Iam able to do it with ease by programming in VB.NET with the MSCRM object library. Eg. strUpdateXml = "<account><name>Steve Langer</name><owninguser>{19838938-705A-4AB9-BC2E-2EDD88035EE5}</owninguser> </account>" CRMAccount.Update(UserAuth, RECID, strUpdateXml) It works fine for the normal MSCRM fields LATER, I created USERDEFINED fields in MSCRM. ( with the Deployment Manager and published). The new field created can been seen in...

Help, experts needed! Auto notification
I have an excel spreadsheet with five columns. On column D I have a drop down list with four choices ("n/a" , "Grp1" , "Grp2" , "Grp3"). When a row is filled in, one of the four choices in column D has to be choosen. When the user exits the spreadsheet an email is automatically sent to three different individuals based on what was choosen in column D. I.E. If "Grp1" was choosen person A, B, and C gets and email notifying them that they need to do something. When "Grp2" is choosen then person D, E, F are notified. And so o...