mr_suleyman
18th January 2006, 11:02
Hi Dear Friends, I work on graphical part of Baan and I searched some documents about it and then I found sample on Baanboard Wiki like following
When I compile it , I got some errors about functions on program. When I want to see functions of bic_pcm DLL by using bic_info6.1 , I got error that is # bic_info6.1 -d /data1/baan/bse/include6.1/bic_pcm
bic_pcm: Fatal Error: object '/data1/baan/bse/include6.1/bic_pcm' not in proper format.
1 ERROR REPORTED..
I think that my compiler couldn't find functions of the DLL. In other words, compiler didn't recognize bic_pcm. But I see bic_pcm in my include files on server.Its permission is all read mode. How can I run following code ?

Thank YOu All for your suggestions



#include <bic_pcm>
#define MI_MENU1 100
#define MI_MENU2 101
#define MI_BUTTON1 200

long plan_id
long time_start
long time_finish
long actv1

function main()
{
| check if display server supports graphics
if is.graphical.server() then
start.planboard() | start pcm server; create objects
handle.event.loop() | handle pcm events
endif
}

function long is.graphical.server()
{
long srv_type, srv_data(SRVMAXSIZE)

srv_type = get.display.data(srv_data)
return( srv_type = DSBW )
}

function handle.event.loop()
{
string data list(256)
long event(EVTMAXSIZE)

while next.event(event)
on case evt.type(event)
case EVTBUCKETMESSAGE:
data list = bms.receive$()

on case evt.bms.sender(event)
case plan_id:
on case evt.bms.command(event)
case PCM_EVTMENUSELECT:
handle.evtmenuselect(data list)
break
case PCM_EVTPUSHBUTTON:
handle.evtpushbutton(data list)
break
case PCM_EVTOBJECTPRESS:
handle.evtobjectpress(data list)
break
case PCM_EVTOBJECTDPRESS:
handle.evtobjectdpress(data list)
break
case PCM_EVTOBJECTMOVE:
handle.evtobjectmove(data list)
break
case PCM_EVTCLOSED:
handle.evtclosed()
break
endcase
break
endcase
break
endcase
endwhile
}

function handle.evtmenuselect( ref string data list() )
{
long menu_id | selected menu
long object_type | type of selected object
long object_id | selected object

pcm.get.data( PCM_EVTMENUSELECT, data list,
menu_id, object_type, object_id )
on case menu_id
case MI_MENU1:
....
break
.
.
endcase
}

function handle.evtobjectdpress( ref string data list() )
{
long object_type | type of selected object
long object_id | selected object
double time | time of selected object

pcm.get.data( PCM_EVTOBJECTDPRESS, data list,
object_type, object_id, time )
on case object_type
case PCM_OT_ACTIVITY:
pcm.change.object( plan_id, object_id,
PcmActivityExpand, PCM_EM_TOGGLE )
pcm.refresh(plan_id)
break
case PCM_OT_RELATION:
....
break
case PCM_OT_MARKER:
....
break
endcase
}

function handle.evtobjectmove()
{
long object_type | type of selected object
long object_id | selected object
double start | new start time
double finish | new finish time

pcm.get.data( PCM_EVTOBJECTMOVE, data list,
object_type, object_id, start, finish )
on case object_type
case PCM_OT_ACTIVITY:
move.activity( object_id, start, finish )
break
.
.
endcase
}

function move.activity( long actv_id, double strt, double fnsh )
{
pcm.change.object( plan_id, actv_id,
PcmActivityStart, strt,
PcmActivityFinish, fnsh,
PcmActivityFreeStart, strt - 1,
PcmActivityFreeFinish, fnsh + 2 )
pcm.refresh( plan_id )
}

function handle.evtclosed()
{
close.planboard()
exit(0)
}

function start.planboard()
{
long par_menu, menu2, butt1

time_start = date.num()
time_finish = time_start + 100

plan_id = pcm.create(PcmPlanName, "Project 1993",
PcmPlanFontHeight, 15,
PcmPlanLineHeight, 2.0,
PcmPlanBackgroundColor, RGB.WHITE,
PcmPlanForegroundColor, RGB.BLACK,
PcmPlanTimescaleStart, time_start,
PcmPlanTimescaleFinish, time_finish,
PcmPlanTimescaleWidth, 3.0,
.
.
PcmPlanMarkersVisible, TRUE )

| -- create objects

par_menu = pcm.create.object( plan_id, PCM_OT_MENU,
PcmMenuParent, 0,
PcmMenuId, MI_MENU1,
PcmMenuName, "File" )

menu2 = pcm.create.object( plan_id, PCM_OT_MENU,
PcmMenuParent, par_menu,
PcmMenuId, MI_MENU2,
PcmMenuName, "open" )

butt1 = pcm.create.object( plan_id, PCM_OT_BUTTON,
PcmButtonId, MI_BUTTON1,
PcmButtonName, "Close" )

pcm.create.object( plan_id, PCM_OT_TIMESCALE,
PcmTimescaleVisible, TRUE,
PcmTimescaleDesc, "%D(%H)",
PcmTimescaleExprV, "PCM_MONTHDAYNO = 1",
PcmTimescaleExprD, "PCM_DAYNO",
PcmTimescaleInterval, 1 )

pcm.create.object( plan_id, PCM_OT_TIMESCALE,
PcmTimescaleVisible, TRUE,
PcmTimescaleDesc, "%D(%d)",
PcmTimescaleExprV, "TRUE",
PcmTimescaleExprD, "PCM_DAYNO",
PcmTimescaleInterval, 1 )

pcm.create.object( plan_id, PCM_OT_COLUMN,
PcmColumnVisible, TRUE,
PcmColumnName, "Id",
PcmColumnWidth, 10,
PcmColumnIndent, FALSE )

actv1 = pcm.create.object( plan_id, PCM_OT_ACTIVITY,
PcmActivityParent, 0,
PcmActivityStart, time_start + 5,
PcmActivityFinish, time_start + 20,
PcmActivityProgress, 0,
PcmActivityFreeStart, time_start + 4,
PcmActivityFreeFinish, time_start + 22,
PcmActivityText1, "Activity 1",
PcmActivityCritical, TRUE,
PcmActivityExpand, PCM_EM_EXPAND,
PcmActivityEdit, PCM_ED_START + PCM_ED_FINISH )
}

function close.planboard()
{
pcm.destroy(plan_id)
}

günther
18th January 2006, 13:51
A link to the programmers manual page would have been enough, 'cause you are using all the "..." lines that have been intended to be programmed. There is another typo error; replace "data list" by "data_list", remove some "." lines and some unimplemented functions and you will be able to compile it within 10 minutes (3 GL Script!) -- I did it in that time. But: I cannot start it ...

Günther

mr_suleyman
18th January 2006, 14:51
I am OK but Why didn't I see contents of the DLL by using bic_info ?

Thanks

günther
18th January 2006, 15:21
As far as I know, bic_info6.1 is for 'objects' (= compiled scripts and/or libraries). The files under $BSE/include6.1 are 'crypted' text files.

günther
18th January 2006, 16:48
But: I cannot start it ...


Solved my problem. You need to add a line "pcm.refresh(plan_id)" at the end of function start.planboard() to see the thing coming up on screen ...

mr_suleyman
18th January 2006, 17:34
Thanks Gunther I will try it !

solepeder
8th May 2007, 18:01
Hi,
I modified the script removing some ".", functions, etc as you said, I added this:
Solved my problem. You need to add a line "pcm.refresh(plan_id)" at the end of function start.planboard() to see the thing coming up on screen ...

but I can't start the program. I'm running the 3GL script with Run from main menu "otcxxxxxxx", but nothing happend...

Could you help me, Please????

Thanks in advance.

Sole.

günther
9th May 2007, 08:43
Your need to create a session (without forms or reports); just the 3gl script is required - and then you can start the session as usual.

Günther

solepeder
9th May 2007, 15:55
Thanks!
I tried with an example posted by Marcel named "Games? or Technology?"
on General Discussion & Chat forum....this is a session with form that allows the same functionality.

Thanks... again....

Sole