There is also a Developers Discussion Forum, and a number of Trackers for bug reporting, patches, etc.
.js) and XML User Interface Language (
.xul) files.
noksync.dll
) is defined in INokSync.idlThe main window functionality is defined in main.js_
The first solution which comes to mind is to use threads in the .dll.
However, XPCOM threading seems to be quite difficult, and not well documented.
Moreover, the functions in the Nokia PC Suite .dll
's are quite "atomic"; i.e. checking for whether a phone is connected returns "immediatly" with "yes" or "no", and reading contacts and appointments is "one-by-one". So, unless something in the Nokia PC Suite is severely broken, it should actually be quite responsive.
So, a better solution would be to implement threads or asynchronous messaging in JavaScript.
However, it does not seem that threading is possible from JavaScript - at least it does not seem to be documented at all.
Further, messaging in Mozilla seems always to be synchronous. E.g. trying commandDispatcher
or creating a new window and using dispatchEvent
both works synchronously.
The solution? Well, in NokSync we use a timer: windows.setTimeout(), e.g.
window.setTimeout(stepPreferences, 0);
stepPreferences
function.void someMethod(otherargs..., inout long hResult, inout long nmpResult);
If the windows com system returns a HRESULT
failure, the value is returned in hResult
.
If the error ultimatly originated in the NMP DLL library, nmpResult
will be set to the NmpAdapterError
returned.
In both of the above cases, NS_ERROR_UNEXPECTED
will be returned as the nsresult
return value.
Other C++ exceptions will not return a specific error code.
A textual description of the error can usually be found using GetLastErrorString
.
However, for XUL the best resource is http://www.xulplanet.com/
And a JavaScript reference: http://www.w3schools.com/jsref/
You may also want reload of the chrome: http://addons.mozilla.org/thunderbird/964/ although NokSync development works fine without.
You may also want to take a look at another addressbook synchronization extension: http://www.gargan.org/extensions/synckolab.html
You must have the Gecko SDK.
Some libraries (e.g. libIDL-0.6.dll) are missing in Gecko SDK, so you will also need: http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools-19990429.zip
How to access a component: http://developer.mozilla.org/en/docs/Creating_XPCOM_Components:Using_XPCOM_Components
Browsing installed components should be possible with http://www.hacksrus.com/~ginda/cview/ but I can not get it to work
..\regxpcom.exe -x . INokSync.xpt Can not initialize XPCOM Glue Can not aquire component registrar Registration failed: (c1f30001) INokSync.xpt
So here is the cool solution: Just copy the .dll and
.xpt file in the
extensions/components
directory, and it works like a charm!
inout
in IDL must be initialized as new Object();
in JavaScript before calling.
For example, myFunction
defined in xidl:
void myFunction(inout long x);
must be called from JavaScript as:
var myX=new Object(); myFunction(myX);
There is a standard for such things: JSR-82 (http://jcp.org/aboutJava/communityprocess/final/jsr082/)
... and there is even implementations which can be downloaded. For example from Sun, as described at http://developers.sun.com/techtopics/mobility/apis/articles/bluetoothintro/
... but this is now only for unix!!!
Anyway there is an implementation somewhere
The problem is, that JSR-82 relies on a transport mechanism, which is not standardized. I could not get UARTTransport
(the default with Sun) to work. Also tried RXTXcomm (http://users.frii.com/jarvi/rxtx/index.html) and could not get it to work.
So, back to Nokia PC Suite...
.dll
's, such as:Stngs3AS.dll
(common functions)
SCM3aS.dll
(contact manager)
Cal3aS.dll
(calendar)
The documentation can be downloaded here: http://forum.nokia.com/info/sw.nokia.com/id/3bc7878b-9ebf-4d26-8a26-e7b13003d3c9/Nokia_PC_Connectivity_SDK_3.0_Component_Library_Reference.pdf.html
Since my phone is a NOKIA 6280, NokSync is using the IPhonebook3
and IContact2
interfaces.
NOKIA is not very clear on which phones are supported by the IPhonebook3
and IContact2
interfaces in the SCM3aS.dll
library used by NokSync. The official statement from year 2002 is, that series 62xx and 71xx are supported.
If the NOKIA phone can store more than one phone number per contact (such as both a cellular number and a landline number), there is a good chance that NokSync will work with the phone.
Whether it works or not, please be so kind as to report your model number and product type on the Open Discussion Forum.
I was considering using doxygen just for the "code documentation", and using DocBook (http://www.docbook.org/) for the "main body" of documentation. There is a nice package for windows at http://www.e-novative.info/software/ede.php
However, why waste time with this, when doxygen has it all?
doc
directory.
The documentation is generated from the (JavaScript, IDL, and C++) source code, plus the additional files in the dox
subdirectory.
The dox
subdirectory contains a doxygen.bat
file which will call js2doxy.pl
for .js files (generating an
.js_ file) and then call doxygen.
The doxygen config file dox/Doxygen
contains a few customizations; most importantly some EXPAND_AS_DEFINED
to make the match between .idl,
.h, and
.cpp definitions.