Project

General

Profile

Defect #655

JSCom-object as parameter

Added by Lambert Willemsen about 11 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
-
Start date:
03/11/2013
Due date:
% Done:

0%

Estimated time:
Browser (if web client):

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", [""])
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

#1

Updated by Scott Butler about 11 years ago

Thank you for submitting. The getChildJSCOM is a bit experimental, so I know there is some work to do on this.

#2

Updated by Lambert Willemsen about 11 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 !

#3

Updated by Michel van Klink almost 11 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])

#4

Updated by Imre Tokai almost 11 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", [""])
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

#5

Updated by Scott Butler almost 9 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF