Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to change the picture name (filename) dynamically in datawindow..

Status
Not open for further replies.

Muralirks

Programmer
Aug 11, 2004
2
US
We have lot of datawindow reports with picture control, which is pointing to c:\Windows\logo.bmp file name. This picture is working for Win95 & 98 but its not working for later OS because of Windows directory. We would like change these datawindows picture dynamically (i.e taking the path from registry and setbitmap on picture control). We have used global function to changing the filename dynamcially but its taking a lot of time to open the reports, which is making slow down the application.

Can anyone of you suggest, how could I achieve or overcome this issue? I would appreciate any kind of suggestion from you.


Murali
 
Simply make "pbr"-resaurce file to link this windows logo staticly in your executable

1. Add this to your project pbr-file:

Code:
c:\Windows\logo.bmp

2. Set right this file name in all dw-oject picture controls

Code:
c:\Windows\logo.bmp

----------
gruss aus Deutschland
 
It is easier to reference the .bmp files in both Powerbuilder and the .pbr file without any paths. This way as long as the files are somewhere in the path (the directories listed in the path variable of the build machine) they will be included in the executable.
 
Thanks for your reply.

My requirements is need to change the file name in picture control programatically, More over I am going to take the current path from registry and to set that path to picture control for all the datawindows (around 100 reports). This registry path will keep on changing depends upon where you installed the application.

For ex: If I install my application in d:\ drive, my path in the registry is d:\app_name\bmp name. So my powerbuilder need to take this path and change it picture control for all datawindows dynamically. I have tried in global function, it doesn't work and also taking a lot of time to place the picture.

Please let me know if you have any other better suggestion.

Murali
 
If you use my suggestion (and don't reference paths at all) as long as the .bmp files are in the path on the system running your application, you should be able to change the file name (name, not path + name) dynamically without any problems.
 
Why can't you link resources staticly in your exe (dll)?
I can't find it out from your explanation.

----------
gruss aus Deutschland
 
You can link statically by specifically designating the path in the .pbr and in the application. My point is to not specifically designate the path in the .pbr and the application so you have the flexability to store the bitmaps in any directory as long as it is in the machines path when you generate the build.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top