Sign in to follow this  
Followers 0
FractalReactor

Mdaemon api error

3 posts in this topic

hi

Sorry about my English, I speak Spanish.

I'm putting together a library of functions for mdaemon api (mail server) and the following code in vbs it works, but the suit does not work AU3.

I think the problem is the array that is passed to GetDomainsName (XXXX), as in the vbs does not have dimensions, and autoit does not allow ($ Array []).

vbs returns the array (6) with domains, autoit does not fail, but returns the array of a single value and empty.

If anyone can help would be very grateful.

Greetings

vbs code works!!

Dim OMDUser
Dim OMDUserInfo
Set OMDUser = CreateObject ( "MDUserCom.MDUser", "\\mailserver")
Set OMDUserInfo = CreateObject ( "MDUserCom.MDUserInfo","\\mailserver")
OMDUser.LoadUserDll()
cAppDir = OMDUser.GetAppDir 
Dim iTotalAccounts 
Dim iTotalDomains 
iTotalDomains = oMDUser.GetDomainCount 
iTotalAccounts = oMDUser.UserCount 
Dim aDomains()
MsgBox iTotalDomains 
OMDUser.GetDomainNames(aDomains)
MsgBox aDomains(4)
OMDUser.FreeUserDll()

Autoit dont Work!!;)

$oMD_User = ObjCreate("MDUserCOM.MDUser",\\mailserver")
$oMD_UserInfo =ObjCreate("MDUserCOM.MDUserInfo",\\mailserver")
$oMD_List =ObjCreate("MDUserCOM.MDList",\\mailserver")
$oMD_ListMember =ObjCreate("MDUserCOM.MDListMember",\\mailserver")
Local $aMD_Domains[1]
If $oMD_User.LoadUserDll() = True Then
$oMD_User.GetDomainNames($aMD_Domains)
MsgBox(1,"info",$aMD_Domains[0]))
Endif
$oMD_User.FreeUserDll()

Share this post


Link to post
Share on other sites



Hi,

1) MsgBox (1,"info",$aMD_Domains[0]) shows you element 0 of array $aMD_Domains.

Suggstions:

1) Try Local $aMD_Domains instead of Local $aMD_Domains[1]

If this doesn't help, just for debugging:

1) Add #include <array.au3> at beginning of script

2) Dim $aMD_Domains[10]

3) Instead of MsgBox (see above) _Arraydisplay ($aMD_Domains)

;-))

Stefan

Share this post


Link to post
Share on other sites

Thanks for responding.

Hi,

1) MsgBox (1,"info",$aMD_Domains[0]) shows you element 0 of array $aMD_Domains.

Suggstions:

1) Try Local $aMD_Domains instead of Local $aMD_Domains[1]

in this case gives me error when compiling

Local $aMD_Domains

$oMD_User.GetDomainNames($aMD_Domains)

==> The requested action with this object has failed.:

$oMD_User.GetDomainNames($aMD_Domains)

$oMD_User.GetDomainNames($aMD_Domains)^ ERROR

If this doesn't help, just for debugging:

1) Add #include <array.au3> at beginning of script

2) Dim $aMD_Domains[10]

3) Instead of MsgBox (see above) _Arraydisplay ($aMD_Domains)

;-))

Stefan

if I declare the array [10], returns the empty array.

still could not fix it.

This is the page of the API documentation Mdaemon COM API.

Greetings

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0