pjohns
3rd May 2002, 13:41
Is it possible to put a button on a form that when pressed the user's web browser will launch to a specified URL?
If so, could you please tell me how to do it?
Thank you
PJ
alejandro
3rd May 2002, 14:20
Yes you can
Example:
long ret,ret2,ret3,ret4
#pragma used dll ottdllbw
ret=exec_dll_function("ottdllbw","app_start",ret2,"C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.baanboard.com","","","","")
ret4=exec_dll_function ("ottdllbw","app_status",ret3,ret2)
while ret3
ret4=exec_dll_function ("ottdllbw","app_status",ret3,ret2)
endwhile
Of course maybe you have to change C:\Program Files\Internet Explorer\IEXPLORE.EXE, to the correct location. and http://www.baanboard.com with your URL.
Hope this help
~Vamsi
3rd May 2002, 22:50
Monitoring the status of the webbrowser may not be required depending on your situation. Also the launching of the browser should be browser independant. Here is the simplified code that does that.
long ret
domain tcmcs.s256 url
#pragma used dll ottdllbw
url = "http://www.baanboard.com/"
ret = app_start(url, "", "", "", "")
alejandro
4th May 2002, 01:07
Vamsi,
In my system, IV c4 UNIX, when using app_start, i have to put the application with full path and then the file to open.
I am not able to open xls files directly,for example; first I have to put c:\....\excel.exe example.exe. The same for any other application. That is, BaaN does not recognize in my system any file extension association.
That is why i wrote iexplore.exe path before the URL to open in the example sended before.
How can I overgive that? What am I missing?
~Vamsi
4th May 2002, 02:05
Do this on your windows machine.
Start...Run Program (or if you have a new keyboard, press windows+R). In there type "http://www.baanfans.com/" without the quotes and see what happens. If your default browser does not launch then your windows registry is messed up. Fixing that would be a better solution than hard-coding the application path in Baan.
Ofcourse if the above test does work but Baan is not able to launch the url, then perhaps you need the latest version of BW.
Hi Alejandro,
If you already have the Internet Explorer on your system, you can check if its the default browser or not, from the menu -> Tools -> Internet Options -> Program Tab
alejandro
4th May 2002, 12:20
Thank you Vamsi and NPRao. Well, I checked what you both said, and the only thing i couldn't test was BW version. Next monday, i will install latest version and i will tell you. The other checks was OK. No registry problem, nor default browser problem.
Many problems related with paths, etc.. will be solved if i can fix this issue.
Thank you again.
pjohns
7th May 2002, 14:08
Thanks Guys,
I followed ~Vamsi's recommendation, no problems. All I need to do now is understand the code!
What does the #pragma used dll ottdllbw line do?
Regards
PJ
The #pragma statement is equivalent to attaching libraries to your program script (ttadv2143m000) from the specific option of the program scripts session (ttadv2530m000).
The #pragma statement is useful that the compiler puts the entry into the where used tables and also if you like more like the "C" coding style, you can see the related libraries/includes/declarations inside the same script.