I work on pnpx, I am not an expert in printing but Delete method should also
delete the print port etc without a reboot. Make sure you call delete after
the printer/driver is completely installed.
Thanks
Gokmen [MSFT]
--
This posting is provided "AS IS" with no warranties, and confers no rights.
The use of any included script samples are subject to the terms specified
at http://www.microsoft.com/info/cpyright.htm
"WSD print" wrote:
> Ok , my program is used for discovering my WSD based printers in the network
> , So for the category and constraints , I used them like this :
>
> if( S_OK == hr )
> hr = m_pFunDisc->CreateInstanceCollectionQuery(
> FCTN_CATEGORY_WSDISCOVERY,
> NULL,
> TRUE,
> this,
> NULL,
> &pQuery);
>
> if( S_OK == hr )
> hr = pQuery->AddQueryConstraint(
> PROVIDERWSD_QUERYCONSTRAINT_TYPE ,
>
> L"http://schemas.microsoft.com/windows/2006/08/wdp/print/PrintDeviceType" );
>
> if( S_OK == hr )
> hr = pQuery->AddQueryConstraint(
> PNP_CONSTRAINTVALUE_NOTIFICATIONSONLY ,
> L"TRUE" );
>
> I have another question that , in Vista once I execute
> PnPXAssociation::Delete , the printer icon and the WSD print port can't be
> deleted immediatly , I have to reboot the PC for deleting them . So is it
> normal ? Can I manually delete them after execution of the method
> PnPXAssociation::Delete ?
>
> Thanks .
>
> "Gokmen Gok [MSFT]" wrote:
>
> > Can you briefly explain what your program does? What category you are
> > querying and constraint are you setting?
> >
> > Thanks
> > Gokmen [MSFT]
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> > The use of any included script samples are subject to the terms specified
> > at http://www.microsoft.com/info/cpyright.htm
> >
> >
> >
> > "WSD print" wrote:
> >
> > > Hi , I mean that the Function Discovery found two times the same WSD device
> > > .And I have added a constraint for filrating the WSD printer . So is it
> > > normal ? i should add a flag for filrating them .
> > >
> > > "Gokmen Gok [MSFT]" wrote:
> > >
> > > > You should use the Delete method. Can you explain what you mean by "my
> > > > program detects one more time"?
> > > >
> > > > Thanks
> > > > Gokmen [MSFT]
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > > > The use of any included script samples are subject to the terms specified
> > > > at http://www.microsoft.com/info/cpyright.htm
> > > >
> > > > "WSD print" wrote:
> > > >
> > > > > Hi , I'm trying to write my program to study the Function
> > > > > Discovery and IPNPXAssociation , but , I saw that in the MSDN's doc , There
> > > > > are two methods Delete and Unassocite , I dont know when I should use Delete
> > > > > and Unassociate ? And in my test's program , once I associated the WSD
> > > > > printer(install the driver , create the port ) , my program detects one more
> > > > > time , so it did the associate one more time . How can I avoid this ?
> > > > >
> > > > > Thanks in advance
> > > > >
> > > > >
Thanks
Gokmen [MSFT]
--
This posting is provided "AS IS" with no warranties, and confers no rights.
The use of any included script samples are subject to the terms specified
at http://www.microsoft.com/info/cpyright.htm
"WSD print" wrote:
> Hi , I mean that the Function Discovery found two times the same WSD device
> .And I have added a constraint for filrating the WSD printer . So is it
> normal ? i should add a flag for filrating them .
>
> "Gokmen Gok [MSFT]" wrote:
>
if( S_OK == hr )
hr = m_pFunDisc->CreateInstanceCollectionQuery(
FCTN_CATEGORY_WSDISCOVERY,
NULL,
TRUE,
this,
NULL,
&pQuery);
if( S_OK == hr )
hr = pQuery->AddQueryConstraint(
PROVIDERWSD_QUERYCONSTRAINT_TYPE ,
L"http://schemas.microsoft.com/windows/2006/08/wdp/print/PrintDeviceType" );
if( S_OK == hr )
hr = pQuery->AddQueryConstraint(
PNP_CONSTRAINTVALUE_NOTIFICATIONSONLY ,
L"TRUE" );
I have another question that , in Vista once I execute
PnPXAssociation::Delete , the printer icon and the WSD print port can't be
deleted immediatly , I have to reboot the PC for deleting them . So is it
normal ? Can I manually delete them after execution of the method
PnPXAssociation::Delete ?
Thanks .
Thank you
Delete method is designed to delete the association which triggers the
uninstallation. Same method gets used when you click "Uninstall" in Network
Explorer. Note that for Delete Method to work you need to be calling it from
an elevated process (running as administrator). After your delete call, you
can take a look at HKLM/Software/Microsoft/Function Discovery/Registry
Store/Association DB and see if it really went through and removed the
association. There's an entry for under this key for each device that gets
associated.