Page 1 of 1

standalone does not work

Posted: Sun Jul 06, 2014 2:53 pm
by francof
Hi all,
just for test I've tried to bild the standalone application of my progr. I have found several problems

1 - a image (into a Image Area) is not show in the card.
the image is a .jpg about of 90k.
into the folder created for the standalone application there is the folder "Immagini" ("Images") containing the image file I used..... if I try to open it, I can't: corrupt File is the message.
I substituted it with the original image file into the folder "Immagini" and now the image it's show....... boh!


2 - this the script of a button used to go to the previous card (crdInizio):

Code: Select all

on mouseUp
   global tDatabaseID
   
   put empty into field "fldDistill"
   put empty into field "fldViniSpec"
   put empty into field "fldDescr"
   put empty into field "lblDistilSel"
   put empty into field "lblZonaProd"
   put empty into field "lblMatPrima"
   
                           --This closes the Database connection
    revCloseDatabase tDatabaseID
    put empty into tDatabaseID
    
    go to card "crdInizio"
end mouseUp
the problem is that don't go to the previous card :D the empty lines are carried out and no more


3 - (the bigger) into my project I use a access DB in ODBC mode:

Code: Select all

command databaseConnect
     global tDatabaseID

    put revOpenDatabase("ODBC", "quizOrigineDati", "QUIZ", "NomeAccesso", "abcd12987" ) into tDatabaseID

              ## Store the database id so other handlers can access it
    setDatabaseID tDatabaseID
end databaseConnect
no data are show into the fields. obviously, into the LC ide everything works fine....
into the folder created for the standalone application there is a file"revdb.dll" and the folder "Externals" containing the file "revdb.dll" and another folder "database_drivers" containing the file "dbodbc.dll".

any idea?
franco

Re: standalone does not work

Posted: Sun Jul 06, 2014 4:11 pm
by Klaus
Hi Franco,

sounds like the database libs are not (yet) loaded!

WHEN do you execute your "databaseConnect" handler?
I mean "on openstack", "on preopenstack" or what?


Best

Klaus

Re: standalone does not work

Posted: Mon Jul 07, 2014 8:59 am
by francof
Hi Klaus.... how much time has elapsed since the last time we felt :)

I connect to Db on preOpenCard (in both my 2 cards).
I found this topic http://forums.livecode.com/viewtopic.php?f=18&t=13460 I'm reading it but,.. emh... at present the only thing I understood is that try to connect the DB on preopencard may cause problems.

franco

Re: standalone does not work

Posted: Mon Jul 07, 2014 12:26 pm
by Klaus
Hi Franco,

yes, "preopenstack" is not the right place, because the database libraries have not been loaded at that time!

Do this: "Fire" your "databaseConnect" handler with a little delay from "openstack" like this:

Code: Select all

on openstack
  send "databaseConnect" to me in 100 millisecs
  ## This will LC the time to load all libraries!
  ## more openstack stuff here...
end openstack
Best

Klaus

Re: standalone does not work

Posted: Mon Jul 07, 2014 5:30 pm
by francof
Klaus, you said on preopenstack. I call the databaseConnect command into the preOpenCard script, is it the same? anyway, reading your post I I did (I made?) so (upload all the code of handler for completeness):

Code: Select all

on preOpenCard
                                  -- prepara campi, radio btn e label x la visualizzazione
   put empty into field "lblTipoLivello"
   put empty into field "txtRisposta"
   set the visible of field "txtRisposta" to false
   put empty into field "txtDomanda"
   set the disabled of button btnDomSuccessiva to true     --prima della scelta del livello i tasti domanda e risposta non sono attivi
   set the disabled of button btnRisposta to true
   
   repeat with i = 1 to the num of btns of grp "btnLivelli"
      if the hilite of btn i of grp "btnLivelli" then
         set the hilite of  btn i of grp "btnLivelli" to false
      end if
   end repeat
   
   if the visible of group "grpDomande" = false then        --se i campi relativi alle domande sono nascosti, li visualizza
      set the visible of group "grpDomande" to true
   end if
   
   hide group "grpRicerca"                   --nasconde gli oggetti (raggruppati in grpRicerca)
   
   send "databaseConnect" to me in 100 millisecs 
   --databaseConnect            --connette al database
   
end preOpenCard
the code above works in run mode of LC ide
still does not work in the standalone .exe


and now comes the fun......

Code: Select all

on preOpenCard
   put empty into field "fldDescr"
   put empty into field "lblDistilSel"
   put empty into field "lblZonaProd"
   put empty into field "lblMatPrima"
   
   send "databaseConnect" to me in 100 millisecs
   --databaseConnect
   
   put databaseGetDistillati() into field "fldDistill"
   put databaseGetViniSpec() into field "fldViniSpec"
end preOpenCard
instead this code never works (no run mode, no standalone .exe) and returns this conn.error: revdberr,invalid connection id

ciao
franco

Re: standalone does not work

Posted: Mon Jul 07, 2014 5:46 pm
by Klaus
Hi Franco,
francof wrote:Klaus, you said on preopenstack. I call the databaseConnect command into the preOpenCard script, is it the same?
yes, should also work.

Code: Select all

on preOpenCard
    ...  
   send "databaseConnect" to me in 100 millisecs   
   put databaseGetDistillati() into field "fldDistill"
   put databaseGetViniSpec() into field "fldViniSpec"
end preOpenCard
instead this code never works (no run mode, no standalone .exe) and returns this conn.error: revdberr,invalid connection id
Oh, come on!

You delay the DB connection by 100 millisecs but then try IMMEDIATELY to do something with the not yet established database connection?
Of course you need to call your db routines like "databaseGetDistillati()" also AFTER that delay, otherwise it MUST fail! 8)


Best

Klaus

Re: standalone does not work

Posted: Mon Jul 07, 2014 7:49 pm
by francof
Klaus wrote: ...........
You delay the DB connection by 100 millisecs but then try IMMEDIATELY to do something with the not yet established database connection?
....
Klaus
Yes, I'm an idiot. as soon as you said that I realized how much was obvious :oops: sorry.

Klaus wrote: ...
Of course you need to call your db routines like "databaseGetDistillati()" also AFTER that delay, otherwise it MUST fail! 8)
...
not knowing the syntax, I tried swear, I've moved these

Code: Select all

put databaseGetDistillati() into field "fldDistill"
put databaseGetViniSpec() into field "fldViniSpec"
into databaseConnect command handler.

the .exe file of standalone app. still not works, the same 3 wrong behaviors

franco

P.S.:
the button problem used to go to the previous card, as mentioned in the first post, was due to these 2 lines of code:

Code: Select all

--revCloseDatabase tDatabaseID
--put empty into tDatabaseID
marked like comments the script button works properly. also if I don't now why

franco