PDA

View Full Version : Search Printer in Network using SelectDirEx



fxsdcc
04-10-2002, 04:58 AM
Hi all,
We want to implement searching shared printer through network using function SelectDirEx as following:

// Display the dialog and return the next dialog event.
nCmdValue = WaitOnDialog(szDlg_BrowseNetworkPrinter);
switch (nCmdValue)
case DLG_INIT:
nResult = CtrlSetText (szDlg_BrowseNetworkPrinter, IDC_NETWORK_PATH_TEXT, NetworkPath);
bPrinter = FALSE;

case IDC_BROWSE_CMD:
//get select network directory dialog
nReturn = SelectDirEx(@SelectDirEx_display, @SelectDirEx_Printer_path ,"","", BIF_STATUSTEXT| BIF_BROWSEFORPRINTER ,NetworkPath);
if (nReturn = IDOK) then
bDone = TRUE;
//get select path to dialog next edit
nResult = CtrlSetText (szDlg_BrowseNetworkPrinter, IDC_NETWORK_PATH_TEXT, NetworkPath);
svPRINTERPORT = NetworkPath;
goto BrowseNetworkPrinter;

elseif (nReturn = IDCANCEL)then
goto BrowseNetworkPrinter; endif;

It works in Windows NT4/98/2000, but fails in Windows Me/XP. We can just get the items in desktop. It shows as attached jpg file.
How can we deal with it?