Menu
Search




Articles & Documents

Close Tutorials

Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
22 Subscribers
CPDB.Net

Friends News
Visits

   visitors

   visitors online

Webmaster - Infos
forum.gifForum - ppCompiler - Topic #9

Forum - Forum
ppCompiler - ppCompiler


active  Topic # 9  Writing a DA with PP

23/02/2009 @ 23:47
by enotar

Anonymous



I use the code post here sometimes ago but it stop on compiling at the red line saying "Duplicate frmhandleevent":

Why and how can I fix it?    d

Thank you very much

{$r FirstDA.rsrc}
{$code DAcc,DA01,code,1000}
// DA01 est le CreatorID

Program FirstDA;
{$­­i PalmAPI.pas}
Const
FORM1=1000;

function FrmHandleEvent(formP:FormPtr;var event:EventType):boolean;inline(SYSTRAP,$­A17A);
procedure EvtAddEventToQueue(const event:EventType);inline(SYSTRAP,$­­A11B);

function HandleEvent(var evt:EventType):boolean;
var
frmP : FormPtr;
begin
frmP:=FrmGetActiveForm;
HandleEvent:=false;

case evt.eType of

appStopEvent:
begin
EvtAddEventToQueue(evt);
HandleEvent:=true;
end;


ctlSelectEvent:
begin
WinDrawChars('Hello World !',13,20,20);
end;

penDownEvent:
begin
if (evt.ScreenX<1) or (evt.ScreenX>100) or (evt.ScreenY<1) or (evt.ScreenY>80) then HandleEvent:=true;
end;
end;
end;

procedure AppEventLoop;
var
evt : EventType;
done : boolean;
begin
repeat
EvtGetEvent(evt,evtWaitForever);
if not SysHandleEvent(evt) then
if not FrmHandleEvent(FrmGetActiveForm,evt) then
done:=HandleEvent(evt);
until (evt.eType=appStopEvent) or (done=true);
end;

Var
form:FormPtr;
evt : EventType;
begin

form := FrmInitForm(FORM1);
FrmSetActiveForm(form);
FrmDrawForm(form);

AppEventLoop;

FrmEraseForm(form);
FrmDeleteForm(form);

end.


enotar

Write to enotar   Post an answer  Top
Answer n° 1
--------
24/02/2009 @ 00:00
by enotar

Anonymous

visitor

I didnt find another way to suscribe to this thread beside answering! l

Maybe there is a way arround

 

tkz 


enotar

Write to enotar   Post an answer  Top
Answer n° 2
--------
24/02/2009 @ 00:29
by Philippe

Anonymous

visitor
FrmHandleEvent has been added to PalmAPI1.pas. Just delete the red line.
Write to Philippe   Post an answer  Top
Answer n° 3
--------
24/02/2009 @ 00:58
by enotar

enotar

visitor

It works now

 

Tkze


enotar

Write to enotar   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 




^ Top ^