Pointer to javascript data structure

I have a web application that uses a third party activeX control to perform various functions using java scripting. One of the functions parameters (settings) requires the passing of a pointer to a data structure that would be similar to how it is done in vb. Below is the vb code example of the data structure and the call to the function. My question is how can I implement something similar in java script. The third party vendor said it should be possible but they are not sure how to code it.

Visual Basic structure definition

         color As OLE_COLOR
         nChannel As enumHorizontalLineChannel
         nDashStyle As enumWaveformLineDashStyles
         nHeightInPix As Integer
         nTranspFactor As Integer
         nVertPosInPerc As Integer
         nLeftCap As enumLineCaps
         nRightCap As enumLineCaps
         nDashCap As enumLineDashCaps
End Type

[Visual Basic function]

control.WaveformAnalzyer.GraphicItemHorizontalLineAdd (
strFriendlyName as String,
strDescription as String,
nStartPosInMs as Long,
nEndPosInMs as Long,
settings as Long (Address of a structure of type WANALYZER_HORIZONTAL_LINE )
) as Integer
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
I think you may have trouble doing that in javascript.  Javascript data type are much looser than what you have posted.  http://www.w3schools.com/js/js_datatypes.asp
dssisupportAuthor Commented:
I was afraid someone might say that. I have been able to implement all of their other functions but this one. It is the only one that requires passing the data structure as a long. I will leave this open for a while to see if anyone else has any ideas.
Are you looking for a sort of converter that changes the declarations from VB to JS...?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

dssisupportAuthor Commented:
I guess that might work. Here is what the vendor said:

creating graphic items requires the usage of data structures which are available in most development languages: the data structure is then passed to the method by passing the pointer to the memory buffer which contains the data structure itself; we are not JavaScript experts so we are not aware if JavaScript allows passing pointers to methods.
For example in VB6 you can create a data structure through the "Type" keyword then the data structure can be passed to the method using the "VarPtr" statement: may be that you have knowledge about this possibility in JavaScript?
dssisupportAuthor Commented:
I took a look at your links but unless I am missing something I don't think this will help. Basically, I have to create a data structure, which I could easily do by creating an array with all of the required parameters, and then pass a pointer (long) to the memory buffer where that array is stored to the function. How do I get the value of the pointer?
Dave BaldwinFixer of ProblemsCommented:
How do I get the value of the pointer?
In javascript, you don't.  Javascript does not have 'pointers'.  You would have to rewrite the code to use javascript arrays or objects.  Note that javascript also doesn't have 'local' variables in that if you declare something outside a function, it is also available inside all functions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.