|
<b>CSDCtrlClass.GetMemoryBuffer("BMP", buf);
what returns this function ?
var ReturnValue=CSDCtrlClass.GetMemoryBuffer("BMP", buf);
or
var buf = new Array(200000); // e.g. global var</b>
THE RETURN VALUE OF THE FUNCTION IS ZERO , WHICH INDICATES THAT THE FUNCTION EXECUTED SUCCESSFULLY.
HOWEVER THE FUNCTION HAS 2 ARGUMENTS 1. "BMP" which is an input string and correct!
2. "buf" which is a return object of binary bytes
This is the array that is empty all the time.
It should be populated a block of binary data
representing a bitmap image( approx 154k), after the function is called.
PS when calling this function in c#( windows application) the 'buf' is declared as Object and passed by reference i.e.
<pre lang="c#">object buf = null;
CSDCtrlClassFPLite.GetMemoryBuffer("BMP", ref buf);</pre>
IT WORKS CORRECTLY AND RETURNS THE BINARY DATA, MY QUESTION IS WHY DOES IT NOT WORK IN JAVASCRIPT FUNCTION, AND HOW SHOULD I DECLARE THE 'buf'.
|
|
|
|
|
Javascript needs references of html DOM, of an active-x-control too.
Javascript data types not the same of c#.
Interface between active-x-c# and javascript needed --> <object ...="">
Internal of active x-control NOT needed for javascript.
So, if buf-array null so array-pointer "undefined".
buf=new array(value) --> define a pointer of array with length value
without init buf have no data type (after first set to value).
object buf = null; --> data type "object" ? like buf = new Object() ?
byte buf=new Byte() .... also not exist in standard javascript.
numObj = new Number(value) is a data type of javascript
control returns byte buf or other type in javascript interface ?
Another example: Flash has predfined interface for javascript --> data type conversion.
----------------------------------------------
IE object number
JScript
Number Object
An object representation of the number data type and placeholder for numeric constants.
numObj = new Number(value)
Arguments
numobj
Required. The variable name to which the Number object is assigned.
value
Required. The numeric value of the Number object being created.
Remarks
JScript creates Number objects as required from numerical values. It is rarely necessary to create Number objects explicitly.
The primary purposes for the Number object are to collect its properties into one object, and to allow numbers to be converted into strings via the toString method.
Properties
MAX_VALUE Property | MIN_VALUE Property | NaN Property | NEGATIVE_INFINITY Property | POSITIVE_INFINITY Property | constructor Property | prototype Property
Methods
toLocaleString Method | toString Method | valueOf Method
----------------------------------------------
IE Object Array
JScript
Array Object
Provides support for creation of arrays of any data type.
arrayObj = new Array()
arrayObj = new Array([size])
arrayObj = new Array([element0[, element1[, ...[, elementN]]]])
Arguments
arrayObj
Required. The variable name to which the Array object is assigned.
size
Optional. The size of the array. As arrays are zero-based, created elements will have indexes from zero to size -1.
element0,...,elementN
Optional. The elements to place in the array. This creates an array with n + 1 elements, and a length of n + 1. Using this syntax, you must supply more than one element.
Remarks
After an array is created, the individual elements of the array can be accessed using [ ] notation, for example:
var my_array = new Array();
for (i = 0; i < 10; i++)
{
my_array[i] = i;
}
x = my_array[4];
Since arrays in Microsoft JScript are zero-based, the last statement in the preceding example accesses the fifth element of the array. That element contains the value 4.
If only one argument is passed to the Array constructor, and the argument is a number, it must be an unsigned 32-bit integer (< approximately four billion). That value then becomes the size of the array. If the value is a number, but is less than zero or is not an integer, a run-time error occurs.
If a single value is passed to the Array constructor, and it is not a number, the length property is set to 1, and the value of the only element becomes the single, passed-in argument.
Notice that JScript arrays are sparse arrays, that is, although you can allocate an array with many elements, only the elements that actually contain data exist. This reduces the amount of memory used by the array.
|
|
|
|
|
im not sure what you are trying to say here..
Javascript needs references of html DOM, of an active-x-control too.
Javascript data types not the same of c#.
Interface between active-x-c# and javascript needed --> <OBJECT ...>
THIS I HAVE DONE, AND METHODS ARE CALLED AND EXECUTED CORRECTLY IN ACTIVEX?
Internal of active x-control NOT needed for javascript.
So, if buf-array null so array-pointer "undefined".
buf=new array(value) --> define a pointer of array with length value
without init buf have no data type (after first set to value).
THIS I HAVE DONE
object buf = null; --> data type "object" ? like buf = new Object() ?
I TRIED THIS , SAME RESULT
byte buf=new Byte() .... also not exist in standard javascript.
UNDERSTOOD
numObj = new Number(value) is a data type of javascript
UNDERSTOOD , THIS WILL NOT WORK BECAUSE MY 'buf' RETURN VALUE IS 154000 BYTES OF DATA?
control returns byte buf or other type in javascript interface ?
NOT SURE WHAT TO DO NEXT??
|
|
|
|
|
i tried this still the same result.
All the methods in the activex object work correctly , it is only not returning the array byte buffer (buf) , which remains empty.
|
|
|
|
|
|
hi manfred
what is the link?
|
|
|
|
|
Sorry just a second!
And I'll post it. I somehow forgot to insert it.
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
All fixed now!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Hi
I'm hoping to set up a system similar to Google Adwords that allows
other sites to extact a limited amount of data from my site, and
display it as part of their webpage. Google use a javascript file:
show_ads.js with parameters.
Can anyone explain how the .js file works? In particular how does it
output HTML back to the calling site, and how does it access the
parameters?
|
|
|
|
|
Seriously?
Two identical posts (with different titles) posted just 1 minute apart. I'd love to understand the motive behind such a move.
On a different note, you could probably do worse than visit http://jsbeautifier.org/[^]
You can paste the contents of show_ads.js into the window, hit the button, then see the code de-minified.
The variable names still suck - since they've been squished down to 1 or 2 letters long, but at least it makes it readable now.
If I were doing it, I'd probably save a page to disk that I knew used the file. I would then de-minify the javascript file and save it with a new name. I'd then change the saved-copy of the html so that it referenced the de-minified file.
Now that you have a local copy that references a human-readable file, I'd open it in a browser, place a break-point in the JS file and hit re-load. You should then be able to step-through execution of the code. This may be the easiest way of understanding it since all the variable names screwed-up.
Good luck!
Make it work. Then do it better - Andrei Straut
|
|
|
|
|
Hi
I'm hoping to set up a system similar to Google Adwords that allows
other sites to extact a limited amount of data from my site, and
display it as part of their webpage. Google use a javascript file:
show_ads.js with parameters.
Can anyone explain how the .js file works? In particular how does it
output HTML back to the calling site, and how does it access the
parameters?
|
|
|
|
|
I want to send the data which coming through request object on one tab to other tab.both tabs are on same jsp.how i can do it??
|
|
|
|
|
hello,
Using Javascript, how to access a textbox property in detailsview EditItemTemplate?
thanks
modified 14-Sep-12 7:30am.
|
|
|
|
|
hi
i use this code:
<script type='text/javascript'>
function ValidateFileSize(strFUS) {
var filename = document.getElementById('<%=fuSignature.ClientID%>');
var myFSO = new ActiveXObject("Scripting.FileSystemObject");
var filepath = filename.value;
var thefile = myFSO.getFile(filepath);
var size = thefile.size;
if (size / 1024 < 110)
return true;
alert('the size of file is big');
return false;
}
</script>
this code is work and show me the alert but when i click on ok button in allert box the file uploadbut i want it not be upload.
what should i do?
plz
|
|
|
|
|
you need to call this onSubmit of the form:
<form onsubmit="return ValidateFileSize()">
...
</form>
and the return in there is essential
|
|
|
|
|
oooh , i forgot write return in önsubmit="return ValidateFileSize()"
thanks so much.
|
|
|
|
|
hi ptvc,
you code is ok, you only need to return the function value where you call the function. for example you call it on a button click you would write
<button onclick="return ValidateFileSize();"></button>
|
|
|
|
|
yes, i forgot write return, Thanks
|
|
|
|
|
Hi, I execute the following code and just get a blank (black) window. The window caption shows but I have not yet gotten the images to load. Please help. (I tried using other images than the ones utilized too). the .py and the images are in the same directory.
background_image_filename='checkmark.jpg'
mouse_image_filename='digestive_bw.png'
import pygame, sys
from pygame.locals import*
from sys import exit
pygame.init()
screen=pygame.display.set_mode((800,800),0,32)
#pygame.display.set_caption("Hello, Howdy, Mate, and Hi there Aus world!")
background=pygame.image.load(background_image_filename).convert()
mouse_cursor=pygame.image.load(mouse_image_filename).convert_alpha()
while True:
for event in pygame.event.get():
if event.type==QUIT:
pygame.quit()
sys.exit()
screen.blit(background,(0,0))
x,y=pygame.mouse.get_pos()
x-=mouse_cursor.get_width() /2
y=-mouse_cursor.get_height() /2
screen.blit(mouse_cursor,(x,y))
pygame.display.update()
|
|
|
|
|
I am using an ActiveX which is refered using <object> tag in my JavaScript code. This javascript is used in a Java based web application. When user browse this page first time, my ActiveX get downloaded from server and installed on client machine. I want to show a progress bar when IE downloading ActiveX. Please suggest what apporach I can use to implement this.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
The unfortunate thing is that you can't do a true progress bar, because you don't have access to the count of downloaded bytes. What most sites do is to display an animated gif image that acts as a placebo. It makes people feel like something is happening, but gives no true measure of it.
|
|
|
|
|
Thanks for your reply. I was also thinking to do same but looking for somekind of notification when object is fully downloaded and I have to stop the animation.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
readyState
==========
Retrieves the current state of the object.
Syntax
Scripting [ vState = ] object.readyState
Possible Values
vState Variant that receives one of the following values.uninitialized Object is not initialized with data.
loading Object is loading its data.
loaded Object has finished loading its data.
interactive User can interact with the object even though it is not fully loaded.
complete Object is completely initialized.
The property is read-only. The property has no default value.
Remarks
The states through which an object passes are determined by that object; an object can skip certain states
(for example, interactive) if those states do not apply to that object.
Standards Information
There is no public standard that applies to this property.
Applies To
A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON,
CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, CUSTOM, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED,
FIELDSET, FONT, FORM, FRAMESET, HEAD, hn, HR, HTML, I, IFRAME, INS, ISINDEX, KBD, LABEL, LEGEND, LI,
LISTING, MAP, MARQUEE, MENU, namespace, nextID, NOBR, NOFRAMES, NOSCRIPT, OL, OPTION, P, PLAINTEXT,
PRE, Q, RT, RUBY, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TEXTAREA, TITLE, TT, U, UL, VAR, XML, XMP
----------------------------------------------------------
[ nState = ] XMLHttpRequest.readyState
Possible Values
nState Integer that receives one of the following values.0 The object has been created, but not initialized (the open method has not been called).
1 The object has been created, but the send method has not been called.
2 The send method has been called, but the status and headers are not yet available.
3 Some data has been received. Calling the responseBody and responseText properties at this state to obtain
partial results will return an error, because status and response headers are not fully available.
4 All the data has been received, and the complete data is available.
The property is read-only. The property has no default value.
Applies To
XMLHttpRequest
|
|
|
|
|
My js looks like as
function fnLoadMyo()
{
window.status="Myo Loading..";
var s = <object classid="clsid:A6S60BCD-BC5E-4088-EFCE-B9EED1D84CB3" id="myo" height="100%" width="100%/">';
document.getElementById('myoSection').innerHTML = s;
alert(myo.readyState);
}
In above alert, I always get 4, irrespective of activex downloaded or registered on client or not.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
create an activeX object
don't forget
'OBJECT ID="' ... + '"'
+ ' CLASSID="' .... + '"'
+ ' TYPE="' .... + '"'
....
e.g.
"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"; Mediaplayer Class-ID
"application/x-oleobject" type of Class-ID and media
-----------------------------------
create object directly, not with innerHTML.
X12=document.createElement(....);
X13=document.body.appendChild(X12);
try
{
X13.classid=....
X13.type=....
}
catch(e)
{
...
}
or
X12=document.createElement("<object id="..." classid="..."">); // e.g IE
X13=document.body.appendChild(X12);
after that maybe readystate is 4, but
pointer X13 must be !=null and !=undefined
X13.property too e.g. X14.classid
at this point activex exists (installed an callable)
e.g. Mediapalyer and try ..catch
// - - - check MediaPlayer createable, only IE
function checkMediaPlayer()
{
var X00=false;
var X01;
// ----- only if IE exist
// ----- create
X01=document.createElement("OBJECT");
// X01 mus be !=null and !=undefinded
// ----- set object try-catch so no place for readystate
try
{
// attention: activex must be allowed by user
// maybe NOT possible
// X01.classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95";
// X01.type="application/x-oleobject";
// X01.filename= ..... // dummy-wmv 1 sec must exists !
// maybe only that possible
X01.type="application/x-mplayer2"; // EMBED and not activeX
X01.filename= ..... // dummy-wmv 1 sec must exist !
}
catch(e1)
{X00=false;}
// ----- no append to body so no remove from body
if(X00)
{
try{X01.filename='';}
catch(e3){X00=false;}
}
// ----- clear object
X01=null; // no append to body so no remove from body
return X00;
}
|
|
|
|
|