Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem traslating VB code
Message
De
05/03/2003 08:08:03
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00761378
Message ID:
00761417
Vues:
17
>I have a little problem.
>
>i need to make a program to maintain Active directory and Exchange 2000 accounts
>and my Fox traslation of original Microsoft VB sample do not works.
>
>One user can have many e-mail address, and that addresses are passed with an
>array.
>
>The problem is assigning an array to a property of a object,
>when i use the syntax (@array) to pass the address fox returns a syntax error,
>and if i write property=array only updates one value, not all the address contained
>on the array.
>
>the code works well, but only updates one e-mail address.
>
>
>I'm testing with COMARRAY function but with no result.
>
>some ideas?
>Thanks in advance
>
>
>
>
>
>
>ORIGINAL VB code
>================
>
>
>Visual Basic
>Sub SetProxyAddress(recipname As String, _
> DomainName As String)
>
> 'DomainName is something like "DC=MYDOMAIN3,DC=microsoft,DC=com"
> 'recipname is something like "jamessmith"
>
> Dim objPerson As New CDO.Person
> Dim objMailRecip As CDOEXM.IMailRecipient
> Dim i
>
> objPerson.DataSource.Open "LDAP://CN=" + recipname + _
> ",CN=users," + DomainName
>
>
> 'Capitalized proxy type for proxies(1) makes it the primary (reply) address.
> 'the others are receive only.
> Dim proxies(3) As Variant
> proxies(0) = "smtp:user@secondarymailproxy.microsoft.com"
> proxies(1) = "SMTP:user@primarymailproxy.microsoft.com"
> proxies(2) = "X400:c=us;a= ;p=Domain;o=First Organization;s=user;"
>
> Set objMailRecip = objPerson
> objMailRecip.ProxyAddresses = proxies
>
> 'look at the results
> Debug.Print Chr(13) + Chr(13) + Chr(13) + Chr(13) + Chr(13) 'add some space
> For i = LBound(objMailRecip.ProxyAddresses) To UBound(objMailRecip.ProxyAddresses)
> Debug.Print objMailRecip.ProxyAddresses(i)
> Next
>
> objPerson.DataSource.Save
> MsgBox "Proxy addresses for " + recipname + " set successfully"
>
>End Sub
>
>================
>
>
>My VFP Traslation
>================
>
>
>DIMENSION proxies(3)
>
>proxies(1)="smtp:uno@uno.com"
>proxies(2)="SMTP:dos@dos.com"
>proxies(3)="smtp:tres@tres.com"
>
>lcString = "smtp:uno@uno.com"+"SMTP:dos@dos.com"+"smtp:tres@tres.com"
>
>objPerson= NEWOBJECT("CDO.person")
>objPerson.DataSource.Open("LDAP://CN=AA0prueba4,CN=Users,DC=redcam,DC=es")
>
>objPerson.EmailAddresses = (@proxies) && Here is the problem
>
>
>objPerson.DataSource.Save
>
>
>================

Enrique,
Ed Rauh's constructor might help - FAQ #7979 (rest in peace my friend).
Second ProxyAddresses in code sounds to be a collection. I think you might set there :
.ProxyAddresses(1) = address1
or it might have an add method :
.ProxyAddresses.Add(address1)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform