AX component wizard and WMI scripting

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

AX component wizard and WMI scripting

Pieter Emmelot-2
Generating wrappers for the Microsoft WMI Scripting library fails for
some methods. (Note: the wizards doesn't show this, all interfaces get
a green check sign).

An example of a problem with double quotes in the method comment is:
Error: ISWbemLocator>>ConnectSer<snip> at line 6: invalid expression
start
----------------
ConnectServer: strServer strNamespace: strNamespace strUser: strUser
strPassword: strPassword strLocale: strLocale strAuthority:
strAuthority iSecurityFlags: iSecurityFlags objWbemNamedValueSet:
objWbemNamedValueSet objWbemServices: objWbemServices
        "Private - Invoke the ConnectServer() method of the COM object.
        Helpstring: 'Connect to a Namespace'

                HRESULT __stdcall ConnectServer(
                        [in, defaultvalue(".")] BSTR strServer,
                        [in, defaultvalue("")] BSTR strNamespace,
                        [in, defaultvalue("")] BSTR strUser,
                        [in, defaultvalue("")] BSTR strPassword,
                        [in, defaultvalue("")] BSTR strLocale,
                        [in, defaultvalue("")] BSTR strAuthority,
                        [in, defaultvalue(0)] long iSecurityFlags,
                        [in, defaultvalue((null))] IDispatch* objWbemNamedValueSet,
                        [out, retval] ISWbemServices** objWbemServices);"

        <virtual stdcall: hresult 8 bstr bstr bstr bstr bstr bstr sdword
IDispatch* ISWbemServices**>
        ^self invalidCall
----------------

Another example is with complex initialization:
Error: WbemISWbemLocator>>connectServer at line 13: undeclared 'an'
----------------
connectServer
        "Answer the <ISWbemServices> result of invoking the ConnectServer()
method of the COM object.
        Default values are passed for all optional parameters."

        ^self
                 connectServer: '.'
                 strNamespace: ''
                 strUser: ''
                 strPassword: ''
                 strLocale: ''
                 strAuthority: ''
                 iSecurityFlags: 0
                 objWbemNamedValueSet: an IDispatch(an ExternalAddress(NULL))
----------------

Regards,
Pieter