steveauckly
7th December 2001, 15:59
Once connected to Baan through Baan OLE, you can start the Menu Browser, Desktop, or DEM Browser with the following (at least in Baan IV, not sure about Baan 5):


function extern start.user.menu()
{
string l.user(8) fixed,
l.parm(12) fixed
long flags,
old.mwindow,
new.mwindow,
child.pid

l.user = strip$(logname$)
select ttaad200.*
from ttaad200
where ttaad200._index1 = {:l.user}
and ttaad200._compnr = 000
selectdo
graphical.mode = true
on case ttaad200.stpr
case ttaad.stpr.menu.browser:
child.pid = act.and.sleep("ttdskmbrowser")
break
case ttaad.stpr.org.browser:
child.pid = act.and.sleep("tgbrg4260m000")
break
case ttaad.stpr.desktop:
l.parm = "-u " & l.user
child.pid = act.and.sleep("ttdskprogman", l.parm)
break
endcase

old.mwindow = current.mwindow()
flags = DSAUTORESIZE OR DSMENUOFF
new.mwindow = create.mwindow("Main Window", DSPIXELBASED,flags)
change.mwindow(new.mwindow)

if child.pid then
set.pgrp (child.pid, child.pid)
grab.mwindow(new.mwindow, child.pid)
reactivate(child.pid)
endif
change.mwindow(old.mwindow)
selectempty
message("User not found, cannot start browser.")
endselect
}

gfasbender
7th December 2001, 20:35
Steve,

Can you provide a VB coding example that shows how the function might be used and called? Where are the function variables initialized?

Thanks,
Gordon

steveauckly
7th December 2001, 21:20
Oops, I guess I could have given a little more info:

Here is the VB call:


Private Sub mnuStartBrowser_Click()
B_function = "start.user.menu()"
Baan4obj.ParseExecFunction "otccomdllbaan", B_function
End Sub


From VB, you may only execute Baan functions that are in a DLL. You asked about initializing, there is none.

So, why would you want to start a Baan browser from inside VB? In my case, I had a VB app that was connected to Baan which the user would have up all the time. By starting Baan from VB, only 1 license gets used.

Getting the initial connection to Baan from VB is another issue, I'll post a way to do that in the near future in this forum.

sns0707
30th January 2003, 11:06
I had created DLL from baan (otcjubvblink), and now i am writhing following script in VB, but it is giving some error. please you can provide full script so it will help use link baan with VB.

Dim Baan4obj As Object
Dim B_function As String

Private Sub Command1_Click()
B_function = "start.user.menu()"
Baan4obj.parseExecFunction "otcjubvblink", B_function
End Sub

thnaks
sorabh

niteshsharma
27th September 2003, 09:48
Its good to see
but

myself want to know how can i create dll in baan4c3??

thanx
n.s.