English
C ++ Forum

Zugriffsverletzungen with Callbacks over TIimer...

 
- Page 1 -


Hello Sebastian...

it's about subesquent View source from [...]  Thread:
CompileMarkSeparation
Testprogramm Timer
Profan Version 9
 $H Windows.ph
-Proc Einstellungen

Proc Einstellungen

    Declare hD%, hA%, hB%, OK%, hTime%
    Declare hF1%, hT1%
    Clear OK%
    Dialogfenster erzeugen
    hD% = @Create("Dialog",%hWnd,"Einstellungen",%WinLeft+80,%WinTop+155,230,190)
    hF1% = @Create("Font","Arial",16,0,0,0,0)
    hT1% = @Create("Text",hD%,"Einstellungen...",10,10,220,20)
    SetFont hT1%,hF1%
    hTime% = @Create("TimeEdit", hD%, "00:00:00", 10, 35, 70, 24)
    hB% = @Create("Button",hD%,"&Nachstellen",10,120,100,28)
    hA% = @Create("Button",hD%,"&Abbrechen",120,120,100,28)

    WhileNot Ok%

        WaitInput

        If @Clicked(hB%)  Nachstellen

            Ok% = 1
            Aktionen hier

        ElseIf @Clicked(hA%) Abbrechen

            Ok% = 1

        ElseIf (%Key = 2) ALT+F4 bzw. schließen

            Ok% = 1

        EndIf

    EndWhile

    DeleteObject hF1%
    @DestroyWindow(hD%)

EndProc

-Prozedur die in bestimmten Zeitintervallen ausgefuehrt wird (4x pro Sekunde)

Proc Timer

    Inc Timer_Busy%
    Locate 5,5
    Print "Timer:" + @str$(Timer_Busy%) + " Durchläufe"

EndProc

-Main----------------------------------------------------------------
Declare Timer_Busy%,Ende%
WindowStyle 26
WindowTitle "Timertest PHU-60"
Window 100,100 - 370,200
cls
Timer setzen (4x pro Sekunde, 250ms)
Declare TimerID&
TimerID& = ~SetTimer(0, 0, 250, @ProcAddr("Timer", 0))
-Menue---------------------------------------------------------------
PopUp "&Programm"
AppendMenu 108,"&Einstellungen"
AppendMenu 109,"&Ende"
Ende% = 0

WhileNot Ende%

    WaitInput

    If @MenuItem(108)

        Einstellungen

    Endif

    If @MenuItem(109)

        ~KillTimer(0, TimerID&)
        Ende% = 1

    Endif

Wend

End

with my Profan2Cpp versions Gibts not only Kuddelmuddel in the Dialog-Window, separate it arise even (zeitweise) a Access violation. Can the somehow to fix?
[...]  is the Statement for Profan.
 
09/06/06  
 



 
- Page 1 -


actually Beta not yet, make I but yet. The Error exit on, if over the Menu the dialog called becomes - but not always (Rechnerabhängig). in the attachment is my EXE.

2 kB
Hochgeladen:09/06/06
Downloadcounter79
Download
 
09/06/06  
 



have you got time whom Downloadlink?
with the Beta, The I me even Downloaded have, exit the Error still on (Access violation), is mere seltener...
 
09/06/06  
 




Sebastian
König
with the second code could I under XProfan self whom Error now reproduzieren (Dialog-Window remaining empty and reagiertt not Closing). with Profan2Cpp though withal numerous try though yet always not... lying it Perhaps really on my System or should the Error, if it on one computer with XProfan appears too with Profan2Cpp appear?

what I already say can is, that at least The cause with Profan2Cpp another his should. here benefit nämliche only normal Procedures whom joint Parameter-Stack - with CallBack-functions and installed command and functions becomes the integrally normal Stack (How in ASM) to Übergabe using, so itself here The Aufrufe not mutual disturbing can...

P.s.: your EXE is unfortunately only The .cpp-File...
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/06/06  
 




Sebastian
König
[quote:f458ed4358]have you got time whom Downloadlink?
with the Beta, The I me even Downloaded have, exit the Error still on (Access violation), is mere seltener... [/quote:f458ed4358]
here the direct Link: [...] .

which Version very have Thou now?
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/06/06  
 



shows 1.5a on. The EXE have I new uploaded (hopefully now correctly., come straight from the night shift )
 
09/06/06  
 




Sebastian
König
[quote:bebe64f95b]shows 1.5a on.[/quote:bebe64f95b] OK, The is again relatively old . under the Link supra find You The actually Beta-Version 1.5.9f. therein are next to some Bugfixes already The new XProfan 10-Features include.

[quote:bebe64f95b]The EXE have I new uploaded (hopefully now correctly., come straight from the night shift )[/quote:bebe64f95b] Ähmm... where? under the Link supra befindet itself still The same File... (EDIT: I see straight: the double concept Link supra is naturally kontextabhängig To interpetieren )
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/06/06  
 



Hello Sebastian...

i'll a View source ,building with the the trouble more frequently appears, can but something last....
 
09/06/06  
 




Sebastian
König
[quote:5ea9f5dcc3]i'll a View source ,building with the the trouble more frequently appears, can but something last.... [/quote:5ea9f5dcc3]
super - thanks!

then exit the trouble means too with 1.5.9f yet on? if so, have I another idea: attempt time Please, whom SetTimer-appeal so To style:

P2CPP: <USE_CALL_ST,USE_EXTERNAL_ST>
Timerid& = ~Settimer(%Hwnd,333,25,@Procaddr(Timer,4))
P2CPP: </USE_CALL_ST,/USE_EXTERNAL_ST>

(functions though not yet with 1.5a) Perhaps lying The cause Yes in the Multithread-concept the übersetzten programs...
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/06/06  
 



whether the Error appears or not depends u.a. from the Speicherauslastung ex. under the new Beta could I the Error not yet understand. under windows2000 I had too with the older Profan2Cpp Version bislang yet no Error Message. Register again.
 
09/06/06  
 



 
- Page 2 -


Hello Sebastian...

good Messages => in the new Beta is the Error not any more present, The runs tadellos.

in the attachment the Testprogramm with the both Profan2Cpp versions kompilert. Timerbug3.exe causes by me whom Error under windows98, Timerbug4.exe not.

Greeting

Andreas
CompileMarkSeparation
DEF @GetDlgCtrlID(1) !"USER32","GetDlgCtrlID"
DEF @ButtonClicked(1) @GetDlgCtrlID(@&(1))=-%MENUITEM
Testprogramm Timer
Profan Version 9
 $H Windows.ph
-Main----------------------------------------------------------------
Declare Timer_Busy%,Ende%,Durch%
Declare TimerID&,Create%,T_Text&,Test#
WindowStyle 26
WindowTitle "Timertest mir Profan2Cpp Version 1.5.9f"
Window 100,100 - 370,200
cls
Let T_TEXT&=@CREATETEXT(%HWND,"",30,30,300,30)
-Menue---------------------------------------------------------------
PopUp "&Programm"
AppendMenu 108,"&Einstellungen"
AppendMenu 109,"&Ende"
Ende% = 0
Timer setzen (4x pro Sekunde, 250ms)
TimerID& = ~SetTimer(%HWND,333,20,@ProcAddr("Timer",4))
Settimer 100

WhileNot Ende%

    WaitInput

    IF @RND(10)=1

        Setmenuitem 108

    endif

    If @MenuItem(108)

        Einstellungen

    Endif

    If @MenuItem(109)

        ~KillTimer(%HWND,333)
        Ende% = 1

    Endif

Wend

End
-Proc Einstellungen

Proc Einstellungen

    Declare hD%, hA%, hB%, OK%, hTime%
    Declare hF1%, hT1%
    Clear OK%
    Dialogfenster erzeugen
    hD% = @Create("Dialog",%hWnd,"Einstellungen",%WinLeft+80,%WinTop+155,230,190)
    hF1% = @Create("Font","Arial",16,0,0,0,0)
    hT1% = @Create("Text",hD%,"Einstellungen...",10,10,220,20)
    SetFont hT1%,hF1%
    hTime% = @Create("TimeEdit", hD%, "00:00:00", 10, 35, 70, 24)
    hB% = @Create("Button",hD%,"&Nachstellen",10,120,100,28)
    hA% = @Create("Button",hD%,"&Abbrechen",120,120,100,28)

    WhileNot Ok%

        WaitInput

        IF @RND(30)=1

            LET OK%=1

        endif

        If @ButtonClicked(hB%)  Nachstellen

            Ok% = 1
            Aktionen hier

        ElseIf @ButtonClicked(hA%) Abbrechen

            Ok% = 1

        ElseIf (%Key = 2) ALT+F4 bzw. schließen

            Ok% = 1

        EndIf

    EndWhile

    DeleteObject hF1%
    @DestroyWindow(hD%)

EndProc

-Prozedur die in bestimmten Zeitintervallen ausgefuehrt wird (4x pro Sekunde)

Proc Timer

    Parameters P1&,P2&,P3&,P4&

    IF Durch%=0

        LET Durch%=1
        Dim Test#,1000000
        Inc Timer_Busy%
        Locate 7,5
        Print "Timer:" + @str$(Timer_Busy%) + " Durchläufe"
        Settext T_Text&,"Timer:" + @str$(Timer_Busy%) + " Durchläufe"
        Drawtext 30,0,@Time$(0)
        Drawtext 100,0,@Time$(1)
        Dispose Test#
        Let Durch%=0

    endif

ENDPROC


265 kB
Hochgeladen:09/06/06
Downloadcounter55
Download
 
09/06/06  
 




Sebastian
König
Hello Andreas,

[quote:fc655c1c78]good Messages => in the new Beta is the Error not any more present, The runs tadellos.[/quote:fc655c1c78]
OK, super! is naturally heavy To say, but I suspect time, that The supra already mentioned Anpassung in 1.5.9f the trouble resolved has...

[quote:fc655c1c78]in the attachment the Testprogramm with the both Profan2Cpp versions kompilert. Timerbug3.exe causes by me whom Error under windows98, Timerbug4.exe not.[/quote:fc655c1c78]integrally sure? by me is it namely very inverse - 4 crashes, 3 not... Timerbug3 is loudly Headline too The, The with 1.5.9f prepares watts.

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/06/06  
 



[quote:a8aaf87176=Sebastian king]Hello Andreas,

[quote:a8aaf87176]in the attachment the Testprogramm with the both Profan2Cpp versions kompilert. Timerbug3.exe causes by me whom Error under windows98, Timerbug4.exe not.[/quote:a8aaf87176]integrally sure? by me is it namely very inverse - 4 crashes, 3 not... Timerbug3 is loudly Headline too The, The with 1.5.9f prepares watts.

MfG

Sebastian[/quote:a8aaf87176]
Hello Sebastian...

Yes, have right - Have me vertan.

Greeting

Andreas
 
09/06/06  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.539 Views

Untitledvor 0 min.
gerd01/12/13

Themeninformationen

this Topic has 2 subscriber:

unbekannt (9x)
Sebastian König (6x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie