• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Convert PB DDT dialogs to O2 dialogs

Started by Chris Chancellor, September 16, 2018, 05:17:23 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Charles Pegge

If an includepath is not specified then o2 will first look in the current folder, then it will look in "$\inc\"

Mike Lobanovsky

Mike
(3.6GHz Intel Core i5 w/ 16GB RAM, 2 x GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Brian Alvarez

Hello Again, I was wondering if o2 is at the point that controls have a custom callback function.

Brian Alvarez

After a few successful compiles, i started getting a virus warning, is this sometihng with a known fix?
(see image attached)




Chris Chancellor

#19
Hello Brian

this looks like PB source codes?   Probably you need to know that 32bits executatble 
are always captured by Anti virus programs,  that's why we all need to compile in 64bits

32bits exe is a real threat in terms of virus infection

see this 
https://www.symantec.com/content/dam/symantec/docs/security-center/white-papers/32-bit-virus-threats-64-bit-windows-02-en.pdf

Chris Chancellor

#20
Hello Brian


looks like you are generating O2 codes
Always  add this into the code at the start to compile to 64bits


uses rtl64



and then set your Antivirus  to have exclusion on the output folder so that the AV won't capture the
resultant exe file

Avast ,  BTW is not a good antivirus software

i think we should not be compiling to 32bits as it is virus prone



Brian Alvarez

Chris, this is what i get when i use the 64Bit mode, this is what i wanted to change the includes path, can you help me?
Maybe i can send you a copy of PluriBASIC when this starts working a bit better, maybe you can add stock code if you want?

Basically what PluriBASIC does is that it includes different portions of code depending on the features of the compiled
application. For example, if a TEXTBOX control is used, it includes the code of CONTROL_TEXTBOX.bin, so, you can include
anything required to initialize text boxes there, and even put different codes in different sections of the generated code, or
even external files.

But since those are empty, it needs coding. Right now, since the DDT features are used, it needs to add the contents of your
dialogs.inc file in the DIALOG.bin file.

Chris Chancellor

Hello Brian

i have attached the zip file for the Simple DDT
Please see how i did the batch file  Build_SimpleDDT.bat (as shown below)  to get it compile



::@echo off

::Set the Oxygenbasic compiler path
set o2dir=C:\OxygenBasicProgressSep4

::Compile
%o2dir%\gxo2.exe SimpleDDT.o2bas


echo done
pause


all the Charles's  OxygenProgressZip  are placed inside my computer 's  folder  C:\OxygenBasicProgressSep4

so you either place the Dialog.inc file inside this folder  C:\OxygenBasicProgressSep4
or  inside the folder that contains  SimpleDDT.o2bas

and then inside SimpleDDT.o2bas , you enter the following codes at the start


$ filename "SimpleDDT.exe"

uses rtl64
uses dialogs
#lookahead   


i don't have any problem compiling using a batch file like this ?

maybe you need to modify your Pluribasic program so that it generate a batch file similar
to Build_SimpleDDT.bat
and then shell execute this batch file to obtain the compile file

in this way you can place your source file and inc files in any folder as you like.

Test compile using my batch file and see the results.







Brian Alvarez

I am using a custom DLL caller, im sure the problem resides there, as i recently modified it. Here is the code i am calling internally:


    CL = "#file """ & TRIM$(PATHNAME$(PATH, COMMAND$), ANY "/\") & "\" & PATHNAME$(NAME, COMMAND$) & ".exe""" & $CR & _
         FC

    SP = STRPTR(CL)

    CALL O2_MODE(9)

    O2_ASMO(SP)

    ER = O2_ERROR()   


I am using mode 9 to get strings like in PowerBASIC, then i call O2_ASMO() as advised... should i use something else??

Thanks.

Brian Alvarez

#24
 Note that i had to do it this way to avoid getting popups from the compiler's dll and for
being able to capture the console output. I was also told this way i would not have to write BAT
files. I would prefer not write any BAT files. So, i have no option. This way used to work as intended.

I would like the internal structure of the DLL to remain intact so my caller
doesnt break in the future... So, if any changes are going to be made, i will appreciate if
i am told before calling my own "final".

Chris Chancellor

Brian

If you don't wish to have batch file screen popup then make the Build_SimpleDDT.bat code as below


@echo off

::Set the Oxygenbasic compiler path
set o2dir=C:\OxygenBasicProgressSep4

::Compile
%o2dir%\gxo2.exe SimpleDDT.o2bas


While your PB code in DLL caller , maybe make it longer code
and not to have too complex


    LOCAL  pnam , filnam, givComm AS STRING
      givComm = COMMAND$
      pnam = TRIM$(PATHNAME$(PATH, givComm), ANY "/\")
      filnam = PATHNAME$(NAME, givComm) & ".exe"

     CL = "#file """ & pnam & "\" & filnam & "" & $CR &  FC

     SP = STRPTR(CL)       



As for CALL O2_MODE(9)  and   O2_ASMO(SP)
you would need to check with Charles as i have never use these commands before



Brian Alvarez


I would rather completely avoid bat files. I dont want my executable executing bat files at all.

Lets see what direction charles points us at. :)

Charles Pegge

Hi Brian,

o2_asmo is now obsolete, use o2_basic instead. (they were identical)

You can also test for compiler errors by checking o2_errno:

if o2_errno() then
  er=o2_error()
  ...
else
  ...

Brian Alvarez

Yes, doing that changed the error to:

ERROR: Problem with file: C:\Oxygen\projects\tests\inc\rtl64.inc
WORD: rtl64
LINE: 5
PASS: 2

Anthon Com

This could be a problem in the rtl64.inc file, you ought to download the latest copy of
oxygenbasicprogress.zip and replace this inc file. Always use the latest copy.

Alternately, it could be something is blocking access to the rtl64.inc file possibly by the Avast program?
In this case,  before compiling, Brian should use a  command to copy the rtl64.inc file
into the same folder as the source code, get it ready for the Oxygen compiler gxo2.exe
to access it.