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
                                

Reply via email to