Defect #655
JSCom-object as parameter
0%
Description
In the following code the var folder becomes always null :
The JSCom-object recipient looks ok and is resolved. We suspect that something
goes wrong with passing the recipient object as parameter in getChildJSCOM...
All other getChildJSCOM-calls we use have primitive datatypes as parameter.
globals.outlook = plugins.servoyguy_servoycom.getNewClientJSCOM("Outlook.Application")
globals.outlook_namespace = globals.outlook.getChildJSCOM("getnamespace", ["MAPI"])
var recipient = globals.outlook_namespace.getChildJSCOM("createrecipient", ["helpdesk@infogroen.nl"])
var folder
if (recipient.call("resolve", []).getBoolean()) {
folder = globals.outlook_namespace.getChildJSCOM("getshareddefaultfolder", [recipient, 9]) // 9 = Calendar
}
Same code in Visual Foxpro through active-x on same machine works ok.
History
Updated by Scott Butler about 12 years ago
Thank you for submitting. The getChildJSCOM is a bit experimental, so I know there is some work to do on this.
Updated by Lambert Willemsen about 12 years ago
Ok, we are very pleased with the introduction of the getChildJSCOM() last year by you.
I hope you can fix it for us, for some customers it now is a show stopper...
Thanks a lot anyway !
Updated by Michel van Klink about 12 years ago
- Status changed from New to Feedback
With the introduction of getChildJSCOM() the following problem was introduced:
recipient = namespace.getChildJSCOM("createrecipient", ["mymailbox"])
folder = namespace.getChildJSCOM("getshareddefaultfolder", [recipient, 9])
That is using a variable (recipient) returned by getChildJSCOM in a subsequent getChildJSCOM-call. Variable recipient is of type RemoteCOM and the jacob-library expects an ActiveXComponent. If RemoteCOM gets a function getActiveXComponent() we would be helped:
folder = namespace.getChildJSCOM("getshareddefaultfolder", [recipient.getActiveXComponent(), 9])
Updated by Imre Tokai almost 12 years ago
Dispatch & ActiveX objects can be reached explicitly in uploaded plugin version. Sample usage:
@globals.outlook = plugins.servoyguy_servoycom.getNewClientJSCOM("Outlook.Application")
globals.outlook_namespace = globals.outlook.getChildJSCOM("getnamespace", ["MAPI"])
var recipient = globals.outlook_namespace.getChildJSCOM("createrecipient","Outlook.Application", ["email@address.com"])
application.output("recipient: "+recipient)
if (recipient.call("resolve", []).getBoolean())
{
application.output('within IF')
application.output("recepient: "+recipient.getActiveXComponent()+" "+recipient.getDispatch())
application.output("getlasterror "+recipient.getLastError())
var address = recipient.getChildJSCOM("addressentry","Outlook.Application",[])
application.output("address: "+address.getActiveXComponent()+" "+address.getDispatch())
application.output( 'address: '+address.get("address") )
var contact_card = globals.outlook_namespace.getChildJSCOM("createcontactcard","Outlook.Application",[address.getDispatch()])
application.output('contactcard: '+contact_card )
application.output('contactcard Creator: '+contact_card.get("Creator") )
application.output('contactcard Application: '+contact_card.get("Application") )
}@
Regards