Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 5 Jahren, 8 Monaten
Letzter Beitrag:
vor 5 Jahren, 8 Monaten
Beteiligte Autoren:
Jeff Graham, pat.pcs.crosspost

Re: "WD Java Controls" example for Eclipse + using java code

Startbeitrag von Jeff Graham am 01.03.2012 17:25

Has anyone used the WD Java Controls to create a Jar for Eclipse? I get errors that prevent it from generating the Eclipse project. I have tried to compile from the command line like suggested and I edited src files to put a space after the "new" but still not able to compile yet.

Jeff

Error:

Failure creating the Java archive ().


Reason: Failure compiling the generated Java source files.
An error was returned by the compiler.

Possible solutions:
- Check the parameters specified in the command line of the compiler.
- In some complex cases, the code converter (WLanguage to Java) may generate an incorrect or incomplete Java code.
In most cases, this problem can be directly corrected in the WLanguage code.
The corresponding WLanguage code can be found in the Java source file, in comment above the line containing the error returned by the compiler.
(See the error below to define the correction to perform).


Command Line: "C:\Program Files\Java\jdk1.7.0_02\bin\javac.exe" -nowarn -source 1.4 -classpath .;WD160Java.jar *.java


Error returned:
GWDFIIW_INSIDE.java:305: error: cannot find symbol
GWDPWD_Java_Controls.ms_Project.mWD_IW_INSIDEAdapter = GWDPWD_Java_Controls.ms_ProjectAdapter.newIW_INSIDEAdapter(this);
^
symbol: method newIW_INSIDEAdapter(GWDFIIW_INSIDE)
location: variable ms_ProjectAdapter of type WD_Java_ControlsAdapter
1 error


Antworten:

Re: WD Java Controls (no replies)

Hi Jeff

I can create a JAR and it's working. But I can't generate the eclipse project. There is an error.

cannot find symbol
symbol : method newIW_INSIDEAdapter(GWDFIIW_INSIDE)


--
pat

Message forwarded from pcsoft.us.windev

von pat.pcs.crosspost - am 06.03.2012 10:44

Re: "WD Java Controls" example for Eclipse

Thanks for the feedback Pat.

PC Soft has replied:
Quote
Patrick Philipot
The "WD Java controls" example compiles fine for Java, but indeed you get an error if you compile for Eclipse. This is a bug. Please use this reference if you contact me upon this matter again: #76 216/356275. As a workaround remove the internal window used by the program. It is responsible for the error.


Also, the WD JavaMail has a bug in compiling for Eclipse that has been submitted.

What I am trying to accomplish, is to put finger print templates in a HFCS field. If anyone is interested, I will post a solution when I figure out how to do this. If anyone has suggestions, please let me know.

von Jeff Graham - am 06.03.2012 15:48

Re: "WD Java Controls" example for Eclipse + using java code

For Those using WinDev with Java,

The error may have been a good thing. I discovered in the generated source files (that get deleted if it compiles correctly) the code below. Note that it shows (in French) how to execute and access a query. The key import is fr.pcsoft.wdjava.api.*; This interface is NOT documented in the javadoc.

I have searched all through the help trying to find out how to do Hxxxx commands or some way to access HFCS from my finger scanner java code. This is necessary as the JavaExecuteFunction does not support returning a Byte array or any object other than String.

I have suggested to PC Soft that

1) I see that the fr.pcsoft.wdjava.framework.hf seems to have the commands for HF access. They must be used by the generated code to create a .jar file. However the framework is not in the javadoc. There should be a javadoc or other documentation for HF access from java code. The fr.pcsoft.wdjava complete api would be most useful.

2) The only source that actually contains the Hxxxx equivalent calls are the GWDF....java files in the WD Java Controls that gets the error in generation. THERE SHOULD BE AN OPTION TO SAVE THESE GENERATED FILES AS EXAMPLES.

3) The help should have examples for HF access from java code, not just references to a WinDev Java Project!

If any of you are interested in this thread, let me know and I will post more as I progress. Also, if anyone has a better way to access HFCS from java, I would like to hear from you.

Another point is that my suggestion alone will never get implemented. So if any other WinDev developers want more flexibility document with java, please send your suggestions to PC Soft as well.

Jeff
Some code from the file: WinDev 16\Examples\Training\WD Java Controls\Java\Compile\GWDFWIN_TreeView_Table.java


import fr.pcsoft.wdjava.framework.*;
import fr.pcsoft.wdjava.framework.assertion.*;
import fr.pcsoft.wdjava.framework.projet.*;
import fr.pcsoft.wdjava.framework.ihm.*;
import fr.pcsoft.wdjava.framework.ihm.menu.*;
import fr.pcsoft.wdjava.api.WDMAT.*;
import fr.pcsoft.wdjava.api.WDOBJ.*;
import fr.pcsoft.wdjava.api.WDSTD.*;
import fr.pcsoft.wdjava.api.WDVM.*;
import fr.pcsoft.wdjava.api.WDJava.*;
import fr.pcsoft.wdjava.framework.poo.*;
import fr.pcsoft.wdjava.api.WDHF.*;
import fr.pcsoft.wdjava.framework.hf.*;
import fr.pcsoft.wdjava.framework.indirection.*;
import fr.pcsoft.wdjava.api.WDCOM.*;
import fr.pcsoft.wdjava.framework.exception.*;
import fr.pcsoft.wdjava.api.WDPRN.*;
import fr.pcsoft.wdjava.ext.ui.*;
import fr.pcsoft.wdjava.api.WDZIP.*;
import fr.pcsoft.wdjava.framework.pourtout.*;
import fr.pcsoft.wdjava.api.WDXML.*;
import fr.pcsoft.wdjava.framework.ihm.action.*;
import fr.pcsoft.wdjava.framework.ihm.binding.fichier.*;
import fr.pcsoft.wdjava.framework.ihm.zr.WDAttributZR;

// A lot of window java code and then:

////////////////////////////////////////////////////////////////////////////
// Déclaration des variables locales au traitement
// (En WLangage les variables sont encore visibles après la fin du bloc dans lequel elles sont déclarées)
////////////////////////////////////////////////////////////////////////////
WDObjet vWD_nSubscript = new WDEntier();
WDObjet vWD_sCurrentCity = new WDChaine();

// nSubscript is int


// sCurrentCity is string


// HExecuteQuery(QRY_ListModels)
WDAPIHF.hExecuteRequete(WDAPIHF.getRequeteSansCasseNiAccent("qry_listmodels"));

// HReadFirst(QRY_ListModels)
WDAPIHF.hLitPremier(WDAPIHF.getRequeteSansCasseNiAccent("qry_listmodels"));

// WHILE NOT HOut(QRY_ListModels)
while((!WDAPIHF.hEnDehors(WDAPIHF.getRequeteSansCasseNiAccent("qry_listmodels")).getBoolean()))
{
// IF sCurrentCity QRY_ListModels.city THEN
if(vWD_sCurrentCity.opDiff(WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("city")))
{
// sCurrentCity = QRY_ListModels.city
vWD_sCurrentCity.setValeur(WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("city"));

// nSubscript = TableAddLine(TVT_JavaTable,QRY_ListModels.city)
vWD_nSubscript.setValeur(WDAPITable.tableAjouteLigne(mWD_TVT_JavaTable,new Object[] {WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("city")} ));

// TableAddChild(TVT_JavaTable,nSubscript,"",QRY_ListModels.LastName,QRY_ListModels.FirstName,QRY_ListModels.Telephone,QRY_ListModels.Agency)
WDAPITable.tableAjouteFils(mWD_TVT_JavaTable,vWD_nSubscript,new Object[] {"",WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("lastname"),WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("firstname"),WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("telephone"),WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("agency")} );

}
else
{
// TableAddChild(TVT_JavaTable,nSubscript,"",QRY_ListModels.LastName,QRY_ListModels.FirstName,QRY_ListModels.Telephone,QRY_ListModels.Agency)
WDAPITable.tableAjouteFils(mWD_TVT_JavaTable,vWD_nSubscript,new Object[] {"",WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("lastname"),WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("firstname"),WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("telephone"),WDAPIHF.getFichierSansCasseNiAccent("qry_listmodels").getRubriqueSansCasseNiAccent("agency")} );

}

// HReadNext(QRY_ListModels)
WDAPIHF.hLitSuivant(WDAPIHF.getRequeteSansCasseNiAccent("qry_listmodels"));

}

}



von Jeff Graham - am 08.03.2012 14:16
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.