Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using GetObject()
Message
De
04/07/2014 14:23:44
 
 
À
04/07/2014 13:45:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01603235
Message ID:
01603243
Vues:
51
>>Hi All
>>
>>I am trying to find a way to code GetObject() in WinDev but I am not sure how to do it. I want to access the user's login full name and description as per the help file - from VFP Help:
>>
>>
>>
>>   * For example, on a network that has implemented Active Directory Services, 
>>   * you can query the network for information on a particular user.
>> 
>>   *  Replace "DomainName" with the domain name, and "UserLoginID" with
>>   * the login ID of the user you are looking up.
>>
>>   oUser = GetObject("WinNT://DomainName/UserLoginID,user")
>>
>>   ? oUser.FullName
>>
>>
>>
>>I cant find a similar thing in WinDev although there are so many functions that it might be there but I just cant find it right now. Is GetObject() calling some sort of Windows API that I could call directly instead? Or is there another approach to getting this info (the user's full name and description) ?
>
>The above code fails with an OLE error on a standalone Win7 machine (i.e. no AD), substituting the local machine name for the domain.
>
>ISTR WMI can be used to get logon info. You can Google [wmi vfp], I think there have been threads here discussing how to access WMI, maybe even logon info.
>
>Having said that, if WinDev is as mature as you've told us I can't imagine there would not be functions that do this for you.

Well, to be honest, I have found various functions dealing with LDAP in WinDev and I have found a complete LDAP example written in WinDev (in the WinDev examples section) and will study it tomorrow. The help pages say its all possible but I keep getting "server down" error message and I'm not sure where the fault lies - I assume with me. So I was just wondering if there was a quickie way by calling a Windows API or something. So, yes, WinDev has LDAP access but I was seeing if there was an easier way than RTFM :)

By the way, re the VFP example above - works perfectly for me on my Windows 7 & 8 laptops and Windows Server 2008 so not sure why it fails for you?

Thanks
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform