Using Win32 functions in Visual FoxPro Image Gallery
PnP Configuration Manager
Code examples:
Disconnecting USB Mass Storage Device programmatically
Enumerating devices installed on the local 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
    IN PCTSTR UNCServerName,
    OUT PHMACHINE phMachine
FoxPro declaration:
DECLARE INTEGER CM_Connect_Machine IN cfgmgr32;
    STRING UNCServerName,;
    INTEGER @phMachine
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.

Address of a location to receive a machine handle.
Return value:
If the operation succeeds, the function returns CR_SUCCESS (0).
LOCAL cMachine, hMachine
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 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: 55
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.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (
16 sec.Function: 'IcmpCreateFile'
33 sec.Function: 'inet_ntoa'
47 sec.Example: 'GDI+: how to make VFP controls visually shake and shudder'
1.07 min.Function: 'LCIDToLocaleName'
1.33 min.Function: 'DrawAnimatedRects'
1.6 min.Example: 'Retrieving information specific to the current Time Zone'
1.9 min.Example: 'How to block the ALT+TAB shortcut (WinXP)'
2.23 min.Example: 'GDI+: Scrolling through large image using the mouse'
2.52 min.Example: 'Using Shell for performing operations on files'
2.85 min.Function: 'CallWindowProc'
Advertise here!