Hi, I hope someone out there can be of help.
I've been provided a .dll with a number of procedures written in VB5. The
function I'm trying to access requires three inputs as arrays, the last one
being an empty array (with a length) for it to store the results and return.
The function requires all of the arrays by ref. I tried just passing it regular
old arrays, no success. After much reading about arrays in Coldfusion and the
fact that they are passed by value, I found some advice on using CreateObject
to make java ArrayLists, which apparently CAN be passed by ref. This
unfortunately did not solve my problem. I am currently getting the following
error when passing Array Lists:
An exception occurred when accessing a Com object field.
The cause of this exception was that:
coldfusion.runtime.Cast$NumberConversionException: The value
"java.util.ArrayList" cannot be converted to a number.
When I pass Arrays I get the same error but "java.util.ArrayList" is replaced
with "coldfusion.runtime.Array", so I'm guessing the problem isn't with the
type of objects I'm trying to pass.
Taking this error literally, it seems like I'm passing the Array List NAME as a
string, and I'm just not passing the Arrays (or lists) correctly. I've tried a
number of variations to no avail.
Here is my very simple code:
<cfobject type="COM" action="create" class="AAC_Pomme7.clsPommeMouche"
name="Apple">
<cfset températureMaxAir = CreateObject("java","java.util.ArrayList").Init() />
<cfset températureMinAir = CreateObject("java","java.util.ArrayList").Init() />
<cfset outputDegJourCumul = CreateObject("java","java.util.ArrayList").Init() />
<cfset Outcome = CreateObject("java","java.util.ArrayList").Init() />
<cfloop query="getMinMax">
<cfset températureMaxAir[CurrentRow] = Tmax[CurrentRow]>
<cfset températureMinAir[CurrentRow] = Tmin[CurrentRow]>
<cfset outputDegJourCumul[CurrentRow] = 0.0>
</cfloop>
<cfset Outcome =
#Apple.PommeMouche(températureMaxAir,températureMinAir,outputDegJourCumul)#>
Is it something stupid? I've been all over the internet and haven't found
anyone with a similar problem.
Any help is hugely appreciated!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289862
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4