Re: using WORD pointer with Jawin - possible?

Morten Andersen <[email protected]>
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <[email protected]>
Hi Benjamin

(Robert, Roger and other wondering why I haven't answered any questions
for the last couple of months: Please see the NB at the bottom of the mail)

Benjamin Sommerfeld wrote:
> Hi altogether,
>
> I'm new to Jawin and want to use it to call some C-Methods.
> I already achieved some prosperities with Jawin, but now I have a
> problem with the "WORD" type in C.

I think the problem is not with "word" (probably a 2 byte number? == a
java short). But instead with the parameter being a [out]-parameter.

> Here's the method syntax for the method I have problems with:
>
> Syntax : WORD P100X_Polling(word *wAdVal);
> Parameter:
> wAdVal : [Output] address of wAdVal, which store the AD data
> Data is returned as an integer value in the range 0-4095.
>
> I tried to call this method the following way:
>

[out]-parameters are a little tricky. And no socalled "shortcut"-method
exists your exact signature, so unfortunately you will have to use the
generic "invoke", where you handle the marshalling yourself.

I think this thread (use "next in topic" to follow the thread):
        http://discuss.develop.com/archives/wa.exe?A2=ind0406C&L=JAWIN&D=0&I=-3&P=932
and especially this mail:
        http://discuss.develop.com/archives/wa.exe?A2=ind0406C&L=JAWIN&D=0&I=-3&P=1284
is a discussion about the same type of problem.

Since then, we (with the help from Alex Kotchnev) actually got this
documented in the Jawin documentation. Please see section 3.2 of the
docs/jawinuserguide_dll.html file (you can read it (with no style
applied) directly from CVS here:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/jawinproject/jawin/docs/jawinuserguide_dll.html
).

Unfortunately we haven't made a binary release with these changes, so it
requires that you check out the source from SourceForge.net and build it
yourself, as described here:
http://jawinproject.sourceforge.net/jawindeveloper.html (you don't need
to build the native C++ part).

Hope this helps you
Best Regards Morten

NB: To Roger, Robert and others following this list, that may wonder why
there has been almost no response from me for the last couple of months:
My "bad" excuse, is that I changed workplace in the middle of october,
which unfortunately required that I also moved to the other end of the
country (well Denmark probably seems very small to you, as it is only a
couple of 100 kilometres from where I lived before :-)). So I have been
pretty busy with my new job, and with getting settled in my new home.
Unfortunately I also lost my previous work email address, so for the
future you will have to reach my on this email adress. Also I previously
used my work-notebook for Jawin development. This, I of course also had
to leave behind, when changing workplace. And until now I haven't really
had time to set up a Jawin development environment on my home PC (which
is actually a Mandrake machine, with a seldom used Windows partition).

But enough of these "bad" excuses. Hopefully I will soon find time to at
least set up a development environment again.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.