Leonardo- Thanks for the full explanation. I'll look into it, attempt to reproduce, and file a bug.
Collin Tobin CFMX QA Engineer Macromedia� What the web can be.(tm) Announcing Macromedia DevNet Subscriptions Maximize your power with our new premium software subscription for Macromedia developers Find out more: <http://www.macromedia.com/go/devnetsubs/> -----Original Message----- From: Leonardo Crespo - Cftop.COM [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 5:58 PM To: CF-Talk Subject: Re: Urgent problem with COM and CFMX Yes they are. Let me explain better: I have 2 servers. One with CFMX and win2k and other CFMX and winxp (both in english). Both are running the same .cfm code (setLocale("Portuguese(Brazilian)"). Both have the language in Regional Options set to ENGLISH(United States), so the #DecimalFormat(13.43)# returns 13.43, even thought the locale in cf is portuguese. note: If i change the language in Regional Options in ctrl panel, #DecimalFormat(13.43)# is 13,43 (note the comma) The problem with the COM object is that in one of the computers, 13.43 is > 30 and 13,43 is < 30 (it must be stripping the decimal point or count it as thousand separator) and on the other, the oposite occurs. Both have the same code, the same COM object, the same language (i've double checked all the currencies, decimal definitions and so) in ctrl panel... BUT, i had to write diferent code to use this COM with CFMX. example of the code i had to wrote: (the parameter passed to the COM must not be greater than 30, or it returns the error code "2") <cfset variable = "#attributes.variable#"> <cfobject.... name="bla" action="create"> <cfset testvar = bla.Function("#NUMBERFormat(variable,'999999999.99'#")> <cfif testvar EQ 2> <cfset testvar = bla.Function("#LSnumberFormat(variable,'9999999.99'#")> (note the LS) </cfif> <cfswitch expression="#testvar"> <cfcase value = 0> code </cfcase> <cfcase value= "1,2"> code </cfcase> </cfswitch> If you pass value "13.56" to the variable, it tries both 13.56 and 13,56. I had to make that modification in order to run the same code on both servers.. and i has not having to do this with cf5... As i say before, MEGA WIERD. I think MM does not like brazilians as Allaire does =) anyway, CARNAVAL is aproaching and i will soon forget about it LOL =) Leonardo Crespo Ps: CFMX has also a "bug" in LsCurrencyFormat when locale is set to portuguese. 13.50 should be R$ 13,50 and CFMX outputs as R$ 13,5 . I had to get a UDF to correct this in cflib.org... If there are any1 having this problem, the UDF is called BrCurrencyFormat (www.cflib.org). ----- Original Message ----- From: Collin Tobin To: CF-Talk Sent: Wednesday, February 26, 2003 7:10 PM Subject: RE: Urgent problem with COM and CFMX Leonardo- I just want to be clear on this: Aren't Brazilian decimal points commas? Not sure if there's a bug here. Collin Tobin CFMX QA Engineer Macromedia� What the web can be.(tm) Announcing Macromedia DevNet Subscriptions Maximize your power with our new premium software subscription for Macromedia developers Find out more: <http://www.macromedia.com/go/devnetsubs/> -----Original Message----- From: Leonardo Crespo - Cftop.COM [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 10:43 AM To: CF-Talk Subject: Re: Urgent problem with COM and CFMX ARRRGGGGGHHH i got the problem! That should be related how JAVA interprets numbers in diferent locales. Using Locale("portuguese(Brazilian)") in CF5, the number #DecimalFormat(14.57)# was displayed as 14.57. In CFMX, it is displayed as 14,57 (note the coma). So, in my COM object, when i try to pass the value 0.50, witch means 500g as weight, it interprets as 50kg, returning a wrong shipping charge. I didnt notice that beuse the value returned by the COM is used in other expressions to calculate the shipping. I did a workaround as follow: ======= ......... <cfobject type="COM" name="tar" class="Tarifa.clsServicoDLL" action="Create"> <cfset CtErro = tar.CalcularTarifa("#attributes.servico#", "#attributes.cepInicial#", "#attributes.cepFinal#", "#DecimalFormat(pesoKg)#")> <cfswitch expression="#CtErro#"> <cfcase value="1"> <cfset ValorTarifa = tar.ValorTarifa / 1000> (NOTE THE / 1000) </cfcase> </cfswitch> You gotta love Macromedia..... BTW, am i the only brazilian in this list? =) Cheers ----- Original Message ----- From: Leonardo Crespo - Cftop.COM To: CF-Talk Sent: Wednesday, February 26, 2003 12:22 PM Subject: Urgent problem with COM and CFMX Hi, i used to have a COM object (Tarifa.dll) that connects to a .MDB database to calculate shipping charges for my e-commerce. Both files were provided by the a the govern shipping company (i have no idea how to say that in english). Everything works fine with cf5, but when i migrate to cfmx, i got the following error: ------------------------------- Error casting an object of type java.lang.Double to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed. java.lang.Double -------------------- Since i know nothing about java, i dont know where to start. Code was working fine, files are registered with regsvr32 and in place. all the attributes where passed as usually with cf5. My code for the custom tag is: ========================== <cfset pesoKg = attributes.peso / 1000> <cfobject type="COM" name="tar" class="Tarifa.clsServicoDLL" action="Create"> <cfset CtErro = tar.CalcularTarifa("#attributes.servico#", "#attributes.cepInicial#", "#attributes.cepFinal#", pesoKg)> <cfswitch expression="#CtErro#"> <cfcase value="1"> <cfset ValorTarifa = tar.ValorTarifa> </cfcase> </cfswitch> <!--- zera variaveis ---> <cfset tar=""> <cfset tarSerAd=""> ============================== If i remove all the lines exept the cfobject, it does not show errors. I think the problem is in the line: <cfset CtErro = tar.CalcularTarifa("#attributes.servico#", "#attributes.cepInicial#", "#attributes.cepFinal#", pesoKg)> I tried to wrap "#pesoKG#" in quotes, no sucess. The only way i can make this error dissaper is by using the #ToString(pesoKG)#, but this leads me to incorrect values (very incorrect) returned by the COM object. If you have some experience, please let me know what kind of error this is and where should i look for to try to fix it. Should this be code related? THANK YOU VERY MUCH! icq: 198810 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

