Using Win32 functions in Visual FoxPro Image Gallery
PnP Configuration Manager
CM_Connect_Machine
CM_Disconnect_Machine
CM_Get_Child_Ex
CM_Get_Sibling_Ex
CM_Locate_DevNode_Ex
CM_Request_Device_Eject_Ex
Code examples:
Disconnecting USB Mass Storage Device programmatically
Enumerating devices installed on the local machine
CM_Connect_Machine
..msdn    Add comment     W32 Constants      Translate this page
Creates a connection to a remote machine
Code examples:
Enumerating devices installed on the local machine
Disconnecting USB Mass Storage Device programmatically
Declaration:
CMAPI CONFIGRET WINAPI
    CM_Connect_Machine(
    IN PCTSTR UNCServerName,
    OUT PHMACHINE phMachine
);
FoxPro declaration:
DECLARE INTEGER CM_Connect_Machine IN cfgmgr32;
    STRING UNCServerName,;
    INTEGER @phMachine
Parameters:
UNCServerName
Caller-supplied pointer to a text string representing the UNC name, including the \\ prefix, of the system for which a connection will be made. If the pointer is NULL, the local system is used.

phMachine
Address of a location to receive a machine handle.
Return value:
If the operation succeeds, the function returns CR_SUCCESS (0).
Usage:
LOCAL cMachine, hMachine
hMachine=0
cMachine = "\\"+SUBSTR(SYS(0), 1, AT(" ",SYS(0))-1)

= CM_Connect_Machine(cMachine, @hMachine)

. . .

= CM_Disconnect_Machine(m.hMachine)
My comment:
Callers of CM_Connect_Machine must call CM_Disconnect_Machine to deallocate the machine handle, after it is no longer needed.

Use machine handles obtained with this function only with the PnP configuration manager functions.
Word Index links for the CM_Connect_Machine :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2008-12-19 12:09:20
Modified: 2008-12-19 12:12:45
Visited in last 7 days: 16
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.166.203.76)
1 sec.Function: 'PathYetAnotherMakeUniqueName'
3 sec.Function: 'WinHttpSetCredentials'
4 sec.Function: 'GdipRotateMatrix'
6 sec.Function: 'sndPlaySound'
7 sec.Function: 'GetNamedSecurityInfo'
9 sec.
Function group: 'Region'
11 sec.Function: 'SQLAllocHandle'
12 sec.Function: 'ExpandEnvironmentStrings'
14 sec.Function: 'DrawCaption'
16 sec.Function: 'IsIconic'
Google
Advertise here!