Author Topic: Errors in 'Projects'  (Read 5395 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
Errors in 'Projects'
« on: April 25, 2012, 10:24:00 AM »
I recive very strange errors in folder Projects
conected with win64.inc.

I use latest oxygen.dll from which work fine with my incude file but
something is wrong with win64.inc
Did i miss something or is problem in latest oxygen.dll  ???

On second computer i use older oxygen.dll who work fine with this graphics examples.
weird...
Any help ,what to do...?

Aurel

  • Guest
Re: Errors in 'Projects'
« Reply #1 on: April 26, 2012, 09:56:49 AM »
people...
In first place Peter.
Do you can explain me ...
what to use for some examples because nothing work as espected.
Do i must use window.h or window.inc or win64.inc
which one work properly with latest oxygen.dll or

Charles...
is there a newest version of oxygen.dll which work stable ?

By the way i stuck with my own function which i need to add into awinh.inc
because i must have handler of window that i can set font for that window.
Any suggestion are welcome... :)

Peter

  • Guest
Re: Errors in 'Projects'
« Reply #2 on: April 27, 2012, 03:10:06 AM »
Hi Aurel,

Take win64.inc!

If it does not goes, then have fun with my sunflower.  :D

Code: [Select]
include "win64.inc"
Window "SUN FLOWER",640,480,2

single r0=7.21,r1=2.11,r2=1.55,fc=30,st=.005,i
single inic=0,fi=80,pi=3.141592,x2,y2,a0,a1,x1,y1

x0 = 8*fc
y0 = 8*fc

ClsColor 200,200,248
For i=inic to fi step st
    a0=(i/r0)*(2*pi)
    a1=((i/r1)*(2*pi))*-1
    x1=x0+(sin(a0)*((r0-r1)*fc))
    y1=y0+(cos(a0)*((r0-r1)*fc))
    x2=x1+(sin(a1)*((r2)*fc))
    y2=y1+(cos(a1)*((r2)*fc))
    Poke x2+80,y2-12,0,0,0
Next
Oval 210,120,220,220,255,255,0
Pause
WinEnd

Aurel

  • Guest
Re: Errors in 'Projects'
« Reply #3 on: April 27, 2012, 04:36:25 AM »
Hi peter...
I am sorry but not work as i say before.
latest oxygen.dll work ok with my gui stuff but not with yours win64
on the 'contra' older work with win64 but not with mine... ::)
look screenshot...
maybe we must wait new release... ;)

Peter

  • Guest
Re: Errors in 'Projects'
« Reply #4 on: April 27, 2012, 05:16:43 AM »
Aurel,  try this!

Charles Pegge

  • Guest
Re: Errors in 'Projects'
« Reply #5 on: April 27, 2012, 05:26:24 AM »

Hi Aurel,

The latest Oxygen (today) is pretty stable. There is only one broken demo, I've found: projects/GDIwindowBigBang.o2bas.

There are 2 versions of the OpenFile dialog in examples/GUI

Window.inc is updated from win64.in and kept in sync with all the examples.

Charles

PS: Thanks for the cheery Sunflower, Peter.


Aurel

  • Guest
Re: Errors in 'Projects'
« Reply #6 on: April 27, 2012, 08:59:19 AM »
Peter...
with this files from temp.zip - gxo and win64 your examples work but again
not work with mine GUI awinh.
When i replace oxygen.dll with 038 version then mine awinh include work but yours not ???
this really drive me crazy... >:(

Charles...
You told me that you work on strptr,and that is ok.
But how is then possible that i have same problematic errors.
my example which i will send you in attachment constantly stuck in memory.. ???
As i say with old 038 work ok but not with from Peter temp.zip.

In attachment is also version of dll who work with my gui example.
Open this dll proprties and under summary you wil see under panel comment 039
which is modifyed version of 038.
« Last Edit: April 27, 2012, 09:25:09 AM by Aurel »

Peter

  • Guest
Re: Errors in 'Projects'
« Reply #7 on: April 27, 2012, 11:46:02 AM »
Hi Aurel,

I got this funny message.

Aurel

  • Guest
Re: Errors in 'Projects'
« Reply #8 on: April 27, 2012, 12:07:13 PM »
It's not funny...then uncomment in awinh this:
'def NULL 0

Peter

  • Guest
Re: Errors in 'Projects'
« Reply #9 on: April 27, 2012, 12:32:48 PM »
Hi Aurel,

is that a joke?  there is running nothing!
it appears to me, here is everything wrong.   ;D

the best way is: try again...  and use the latest ob.dll

Aurel

  • Guest
Re: Errors in 'Projects'
« Reply #10 on: April 27, 2012, 12:45:22 PM »
What you mean - here is everything wrong?
where?
On similiar way most stuff work for example in XBlite.
So why same thing not work in oxygen, both use same api?
I really don't know what to say more...

Peter

  • Guest
Re: Errors in 'Projects'
« Reply #11 on: April 27, 2012, 02:45:13 PM »
Aurel,

I mean,  I get no reaction, if I start this Gui thing.
I tried two older dll's, but without success.

What can it be?  Windows7? Or have you forget something?

What is xblite? Never heard.

Aurel

  • Guest
Re: Errors in 'Projects'
« Reply #12 on: April 27, 2012, 09:09:35 PM »
maybe i forget but how then work with older version  ???

Aurel

  • Guest
Re: Errors in 'Projects'
« Reply #13 on: April 28, 2012, 11:18:39 AM »
maybe is something conected with win7 but i can't confirm that...
xblite is basic like compiler which use GoAsm .

Aurel

  • Guest
Re: Errors in 'Projects'
« Reply #14 on: April 28, 2012, 11:54:02 AM »
Just to show that work with older dll i put example in attachment
with opening new window by clicking button.
This new window can be closed separately if is created as new main, or closed as child of parent.
Read txt file 'ReadMe'.
Exemple work fine without any error on my xp-machine.

Code: [Select]
'test new window
Include "awinh.inc"
#lookahead ' for procedures
% LR_LOADTRANSPARENT = &H20
% LR_LOADMAP3DCOLORS = &H1000
INT TransparentMap3D = LR_LOADTRANSPARENT or LR_LOADMAP3DCOLORS
INT win,win2
INT winstyle
INT button1,button2,button3,button4,button5
INT edit1,edit2,edit3
INT Lbox,static1,static2,static3,richedit1
INT ed1ID,ed2ID,ed3ID
INT b1ID,b2ID,b3ID,b4ID,b5ID,b6ID,b7ID
INT LboxID = 300
INT st1ID,st2ID
INT reID
b1ID=100
b2ID=101
b3ID=102
b4ID=103
b5ID=104
'-----------------
ed1ID=200
ed2ID=201
ed3ID=202
'----------------
st1ID=350
st2ID=351
st3ID=352
'----------------
reID=400
'loadbmp
'##########################################
INT bmpB1,bmpS1
bmpB1 = LoadImage(0,"data/xpBopen.bmp",0,76,20,16)
bmpS1 = LoadImage(0,"data/xpStatic.bmp",0,82,82,16)
'##########################################

winstyle = WS_MINMAXSIZE or WS_CLIPCHILDREN
'create window **************************************************
win = SetWindow("Test AwinH",100,100,640,400,0,winstyle)
'****************************************************************

'create buttons ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
button1 = SetButton(win,280,20,100,24,"OpenFileDialog",0x50000000,0x200,b1ID)
'set bitmap on button 1
SendMessage button1 , BM_SETIMAGE, 0, bmpB1
button2 = SetButton(win,390,20,80,24,"Run Counter",0x50000000,0x200,b2ID)
button3 = SetButton(win,490,20,80,24,"Load Text",0x50000000,0x200,b3ID)
button4 = SetButton(win,490,50,84,24,"Get Line Count",0x50000000,0x200,b4ID)
button5 = SetButton(win,490,80,84,24,"Get Line 2",0x50000000,0x200,b5ID)

':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'create edit control
edit1 = SetEditBox(win,100,80,380,23,"edit 1",0x50004000,0x200,ed1ID)

'create listbox
Lbox = SetListBox(win,100,140,180,150,"LB 1",0x50000140,0x200,LboxID)

'create static control
static1 = SetStatic(win,10,20,254,16," This is a STATIC text control with EX_CLIENTEDGE",0,0x200,st1ID)
static2 = SetStatic(win,10,40,254,13," This is a STATIC text control without ex_ClientEdge     ",0,0,st1ID)
'crete static control with bitmap
static3 = SetStatic(win,10,60,82,82,"",0x5000030E,0,st3ID)
SendMessage static3 ,370, 0, bmpS1

'create Rich Edit control
INT reStyle = WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_WANTRETURN|WS_VSCROLL|WS_HSCROLL|ES_AUTOVSCROLL|ES_AUTOHSCROLL|ES_SUNKEN
'INT reStyle = 0x508010C4
richedit1 = SetRichEdit(win,300,120,300,200,"Text in Richedit...",reStyle ,0x200,reID)

INT LCount = 0
'---------------------------------------------------------------------
GoSub AddListboxItems
'--------------------------------------------------------------------
'draw text
'DrawText("HELLO!", 10,300 , 0x000000)
'setfont & print AT
SetFont(win,10,400,0,"Courier New")
PrintAt(win,10,320,"Hello Print_At!",0xFF0000)
'--------------------------------------------------------------------
'WHILE GetMessage (&wm,0,0,0)<>0
'TranslateMessage &wm
'DispatchMessage &wm
'WEND
sys bRet
  '
  Do While bRet := GetMessage (&wm, 0, 0, 0)
    If bRet = -1 then
      'show an error message
    Else
      TranslateMessage &wm
      DispatchMessage &wm
    End If
  Wend



Function WndProc(byval win as long,byval wMsg as long, byval wParam as long,byval lparam as long) as long callback

SELECT wMsg
'----------------------------

CASE WM_DESTROY
DestroyWindow (win)
PostQuitMessage 0
'-------------------------------------------------------------
CASE WM_COMMAND
controlID = LoWord(wParam) 'get control ID
notifyCode = HiWord(wParam) 'get notification message

Select controlID
   CASE b1ID
If notifycode=0 
'Beep(1660,50)
    'Print "Button 1 Clicked!"
Gosub Test
End If
   CASE b2ID
     If notifycode=0
UpdateWindow(win)
    SetControlText()
End If
  CASE b3ID
If notifycode=0
LoadFromFile()
End If
  CASE b4ID
If notifycode=0
GetLineCount()
End If
  CASE b5ID
If notifycode=0
GetLine()
End If




End Select
'-----------------------------------------------------
END SELECT


FUNCTION = DefWindowProc win,wMsg,wParam,lParam


END FUNCTION

'########################################################
SUB AddListboxItems
bstring i$ : i$=""

For n = 0 To 100
i$=Str(n) + "..listbox item"
SendMessage Lbox,LB_ADDSTRING,0,i$
Next n
END SUB
'#########################################################
SUB SetControlText
bstring n$
n$=""

'loop
For i = 0 To 10000
n$ = Str(i)
SendMessage edit1,WM_SETTEXT,0,n$
UpdateWindow(edit1)
Next

END SUB
'#########################################################
SUB LoadFromFile

string fName = "richtext.txt"
bstring source =  getfile fName
SendMessage richedit1,WM_SETTEXT,0,source

if not source
    print fName " file not found"
end if

END SUB

'************************************************************

Sub Test
bstring fR
dir=""
bstring sep=chr 0
filter="Text files"+sep+"*.txt"+ sep+"All Files"+sep+"*.*"+sep
'filter="text"+sep+"*.txt"+sep+
       '"basic"+sep+"*.bas;*.o2bas"+sep+
       '"include"+sep+"*.inc"+sep+
       '"header"+sep+"*.h"+sep+
       'sep

title="Test File Opening Dialog"
hwnd=0
fR = FileDialog(dir,*filter,*title,0,0,"txt")

SendMessage edit1,WM_SETTEXT,0,fR
bstring tx =  getfile fR
SendMessage richedit1,WM_SETTEXT,0,tx

End Sub
'*************************************************************

SUB GetLineCount

LCount = SendMessage richedit1,EM_GETLINECOUNT,0,0
bstring count$ = ""
count$ = Str(LCount)
SendMessage edit1,WM_SETTEXT,0,count$

END SUB

'*************************************************************

SUB GetLine
INT Lpos
INT LLen
bstring LText=""
string pText

FOR Lpos = 0 TO LCount-1
LLen = SendMessage richedit1, EM_LINELENGTH,Lpos, 0 ' not important
'print "LineLen;" + str(LLen)
pText = Space (255)  ' it use 255 without error
SendMessage richedit1,EM_GETLINE,Lpos,*pText
'print "LineText;" + pText
'convert to bstring & show line in edit control
LText = pText
LText = rtrim(ltrim(LText))
LText =Mid(Ltext,1,3)
SendMessage edit1,WM_SETTEXT,0,LText
UpdateWindow(edit1)
'check command
IF Ltext = "NWF" then showw()
Next

'test - load file
'with 12560 lines of text
'read line by line ,finished
'cca 7 seconds

END SUB

'////////////////////////////////////////////////////////////////////

SUB showw
print "Command NWF found!"

'try open new window >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
winstyle = WS_MINMAXSIZE or WS_CLIPCHILDREN 'or WS_CHILD
'create window - parent HWND_DESKTOP
win2 = SetWindow("Test NewWindow",400,100,400,300,0,winstyle)
Dim wm2 as MSG

IF win2 <> 0
DO WHILE GetMessage(&wm2,0,0,0)
TranslateMessage &wm2
DispatchMessage &wm2

Select wm2
  CASE WM_Quit
  DestroyWindow (win2)
  PostQuitMessage 0

End select

WEND

END IF

'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
END SUB

'////////////////////////////////////////////////////////////////////

Unfortunately SetFont() function still not work . :-\
PrintOn() work but can be erased because is not buffered properly.