Click here to Skip to main content
       

JavaScript

 
Questionfyi: accidental find: using JavaScript DOM in browser to parse a URL PinmemberBillWoodruff14-Sep-12 22:54 
AnswerRe: fyi: accidental find: using JavaScript DOM in browser to parse a URL Pinmemberziggyfish10-Oct-12 6:26 
Questiongoogle map splite write problem Pinmemberchogrf13-Sep-12 2:48 
QuestionFastest way to select all elements in a *ListBox* PinmemberA*****12-Sep-12 19:32 
AnswerRe: Fastest way to select all elements in a *ListBox* PinmemberBobJanova12-Sep-12 23:04 
GeneralRe: Fastest way to select all elements in a *ListBox* PinmemberA*****13-Sep-12 12:27 
GeneralRe: Fastest way to select all elements in a *ListBox* PinmemberA*****13-Sep-12 18:55 
Questionjavascript _> activex passing by reference PinmemberJohan000112-Sep-12 1:40 
Hi
I hope somebody can help.
Apologies if the code below is not clear ,because this is my first post/query.
 
Basically i   have a javascript function   that is executed on the client side using   onclientclick   in my aspx , html page.
 
The javascript   function   "capt(fingerpos)" below invokes the   activex   objects which is declared in the   aspx page in an object tag( see below).It is also registered in the client machine.
 
All the method calls work correctly , until i need to pass an array ( buf) by reference to the   method
CSDCtrlClass.GetMemoryBuffer("BMP", buf);
This   always   returns an empty array . Ive tried declaring an object (BmpObject)   and sending it to the activex   method   with the same result.
 
In c#( windows application)   this com object works correctly when declaring BmpObject as object ,
and the return value of (buf) is populated by the   activex method CSDCtrlClass.GetMemoryBuffer("BMP", buf);
My problem is   i cannot   understand why   this   method does not return the buffer/object   in   javascript , but does work in   a   normal windows application.
 
Obviously the handeling of the reference variable(   either array or object) is different   in javascript. But   i have tried many different approaches , the   return   variable is   always the same ( empty or null).
Any suggestions   on how to handle this?
 
The actual return data is just a block of 8 bit bytes( bmp image) when   executed in the working windows application.
 

 

 
html code snippet:
 

 

<object id="CSDCtrlClass" name="CSDCtrlClass"classid="CLSID:B228B13B-AD31-4523-AD58-5D52553EEC47" width="100" height="100"></object>
 
<script type ="text/javascript">
 

function capt(FingPos)
{
   var BmpObject = {};
   var buf            = new Array(200000);
              
 
            CSDCtrlClass.InitScannerExternal();
            CSDCtrlClass.bInitKillScannerExternal = 1;
            CSDCtrlClass.bAutoCapture = 1;
            CSDCtrlClass.OutputFileMode = 0;
            CSDCtrlClass.TransNo = "TranSample";
            CSDCtrlClass.FingPos = FingPos;
            CSDCtrlClass.OutputSaveFormat= "BMP_RAW_WSQ";
           
                  CSDCtrlClass.Capture();
                  if (CSDCtrlClass.ErrCode == -999)
                  {
                        alert("Capture Error:" + CSDCtrlClass.ErrCode);
                        return false;
                  }
 
                  try
                  {
                        CSDCtrlClass.GetMemoryBuffer("BMP", buf);
                        if (CSDCtrlClass.ErrCode != 0) {
                              alert("Capture Error:" + CSDCtrlClass.ErrCode);
                              return false;
                        }
                       
                                   
                        alert(buf);
                                            
                       
                       
                                             CSDCtrlClass.TerminateScannerExternal();
                  }
                  catch (err)
                  {
                        var txt = "";
                        txt = "ERROR[" + err.message + "]";
                        alert(txt);
                  }
 

</script>
AnswerRe: javascript _> activex passing by reference Pinmembertwseitex16-Sep-12 1:09 
GeneralRe: javascript _> activex passing by reference PinmemberJohan000117-Sep-12 0:46 
GeneralRe: javascript _> activex passing by reference Pinmembertwseitex17-Sep-12 8:30 
GeneralRe: javascript _> activex passing by reference PinmemberJohan000117-Sep-12 21:38 
GeneralRe: javascript _> activex passing by reference Pinmembertwseitex18-Sep-12 8:58 
GeneralRe: javascript _> activex passing by reference PinmemberJohan000118-Sep-12 23:28 
GeneralRe: javascript _> activex passing by reference PinmemberJohan000117-Sep-12 1:03 
AnswerRe: javascript _> activex passing by reference [modified] PinmvpManfred R. Bihy19-Sep-12 1:02 
GeneralRe: javascript _> activex passing by reference PinmemberJohan000119-Sep-12 2:02 
GeneralRe: javascript _> activex passing by reference PinmvpManfred R. Bihy19-Sep-12 2:06 
GeneralRe: javascript _> activex passing by reference PinmvpManfred R. Bihy19-Sep-12 2:12 
QuestionCreate AD block functionality for my website Pinmemberswayam.test1.gmail10-Sep-12 19:58 
AnswerRe: Create AD block functionality for my website Pinmemberenhzflep11-Sep-12 22:06 
QuestionHow does Google show_ads.js work? Pinmemberswayam.test1.gmail10-Sep-12 19:57 
QuestionHow to send request data from one tab to other tab which are on same jsp Pinmembermayureshdh9-Sep-12 18:52 
Questionjavascript/jquery [modified] Pinmemberchaim_zvi8-Sep-12 8:50 
Questionshow alert in javascript and not continue Pinmemberptvce6-Sep-12 21:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 16 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid