Discussion:
when I should use delete , unassociate ?
(too old to reply)
Gokmen Gok [MSFT]
2009-06-19 17:55:01 UTC
Permalink
This is a query against the WSD category so whenever you execute this query
you will discover the WSD printer as long as it is online. THe fact that you
associated the printer does not affect the discoverability. When your printer
is associated though, if you discover the printer using this query again you
will see that PKEY_PNPX_Installed is set to VARIANT_TRUE in the property
store of the function instance you receive.

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
Ok , my program is used for discovering my WSD based printers in the network
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 .
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
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 .
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
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
WSD print
2009-06-17 08:25:01 UTC
Permalink
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 .
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
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
Gokmen Gok [MSFT]
2009-06-18 20:46:04 UTC
Permalink
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
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 .
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
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
WSD print
2009-06-19 09:56:01 UTC
Permalink
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 .
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
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 .
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
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
Gokmen Gok [MSFT]
2009-06-16 17:22:01 UTC
Permalink
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
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
WSD print
2009-06-24 13:37:01 UTC
Permalink
Hi , thank you for your response . I have got to delete the printer with the
system function DeletePrinter , and the port immediately . But I got another
problem that was the PKEY_PNPX_Installed/PKEY_PNPX_Associated you talk about
. Once I have deleted my printer by using PNPXDeviceAssociation::Delete and
DeletePrinter , and then I relaunch my prog , I compare the
PKEY_PNPX_Installed/PKEY_PNPX_Associated , it always shows me true , but I
have already deleted printer in the section Device and Printer . So perhaps
there is always somewhere has not changed ? So I found in the section Network
, my printer icon that I have already deleted is always over there(I think
that it's normal because this is a network device) , but when I right click ,
it shows me Uninstall . And then after uninstalling , I can relaunch my prog
, and PKEY_PNPX_Installed becomes false . So I don't know how to resolve
this problem .It seems that the function PNPXDeviceAssociation::Delete
doesn't uninstall this .

Thank you
Post by Gokmen Gok [MSFT]
This is a query against the WSD category so whenever you execute this query
you will discover the WSD printer as long as it is online. THe fact that you
associated the printer does not affect the discoverability. When your printer
is associated though, if you discover the printer using this query again you
will see that PKEY_PNPX_Installed is set to VARIANT_TRUE in the property
store of the function instance you receive.
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
Ok , my program is used for discovering my WSD based printers in the network
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 .
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
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 .
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
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
Gokmen Gok [MSFT]
2009-06-24 21:23:01 UTC
Permalink
Hi,

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.

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
Post by WSD print
Hi , thank you for your response . I have got to delete the printer with the
system function DeletePrinter , and the port immediately . But I got another
problem that was the PKEY_PNPX_Installed/PKEY_PNPX_Associated you talk about
. Once I have deleted my printer by using PNPXDeviceAssociation::Delete and
DeletePrinter , and then I relaunch my prog , I compare the
PKEY_PNPX_Installed/PKEY_PNPX_Associated , it always shows me true , but I
have already deleted printer in the section Device and Printer . So perhaps
there is always somewhere has not changed ? So I found in the section Network
, my printer icon that I have already deleted is always over there(I think
that it's normal because this is a network device) , but when I right click ,
it shows me Uninstall . And then after uninstalling , I can relaunch my prog
, and PKEY_PNPX_Installed becomes false . So I don't know how to resolve
this problem .It seems that the function PNPXDeviceAssociation::Delete
doesn't uninstall this .
Thank you
Post by Gokmen Gok [MSFT]
This is a query against the WSD category so whenever you execute this query
you will discover the WSD printer as long as it is online. THe fact that you
associated the printer does not affect the discoverability. When your printer
is associated though, if you discover the printer using this query again you
will see that PKEY_PNPX_Installed is set to VARIANT_TRUE in the property
store of the function instance you receive.
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
Ok , my program is used for discovering my WSD based printers in the network
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 .
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
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 .
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
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
WSD print
2009-06-25 08:53:01 UTC
Permalink
Hi , I have look at the registers , when I executed associate , It didn't
create the entry , same for deleting ,it didn't delete the entry , it only
adddd/removed the printer in the section printer , I have executed the progm
by running as admin . So that's why I cant receive the good value for
PKEY_PNPX_Installed/PKEY_PNPX_Associated . In network explorer , when I
install/uninstall , the entry is created/deleted , but the printer in the
section printer was not be added/removed , is it normal? ...... how should I
resolve this problem ?


Thank you
Post by Gokmen Gok [MSFT]
Hi,
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.
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
Post by WSD print
Hi , thank you for your response . I have got to delete the printer with the
system function DeletePrinter , and the port immediately . But I got another
problem that was the PKEY_PNPX_Installed/PKEY_PNPX_Associated you talk about
. Once I have deleted my printer by using PNPXDeviceAssociation::Delete and
DeletePrinter , and then I relaunch my prog , I compare the
PKEY_PNPX_Installed/PKEY_PNPX_Associated , it always shows me true , but I
have already deleted printer in the section Device and Printer . So perhaps
there is always somewhere has not changed ? So I found in the section Network
, my printer icon that I have already deleted is always over there(I think
that it's normal because this is a network device) , but when I right click ,
it shows me Uninstall . And then after uninstalling , I can relaunch my prog
, and PKEY_PNPX_Installed becomes false . So I don't know how to resolve
this problem .It seems that the function PNPXDeviceAssociation::Delete
doesn't uninstall this .
Thank you
Post by Gokmen Gok [MSFT]
This is a query against the WSD category so whenever you execute this query
you will discover the WSD printer as long as it is online. THe fact that you
associated the printer does not affect the discoverability. When your printer
is associated though, if you discover the printer using this query again you
will see that PKEY_PNPX_Installed is set to VARIANT_TRUE in the property
store of the function instance you receive.
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
Ok , my program is used for discovering my WSD based printers in the network
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 .
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
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 .
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
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
Continue reading on narkive:
Loading...