1
votes

I have a compiled pbd file which I need to edit and make a very small change to the code.

I tried using a HEX editor, but unless I have the wrong settings, that doesnt seem to work?

The file was built with PowerBuilder 6.5.1 and I have PowerBuilder 6.5. I get an error when I try and load any window object. Is there really a big difference between the two version that will fail to load the window object in PB? If I use PBBrowse I can see the window and object properties and could rebuild the window objects in last case scenario.

I also used pbdumper and I can extract the source files from the pbd (once I rename the file to .pbl). But is there another way to rebuild all the source files and successfully generate an updated .pbd with the changes I need?

2
it is weird that you compiled a .pbd as a library containing source objects along with compiled objects is normally a .pbl. Maybe that the .pbd file was renamed by mistake ?Seki
Also you are mentioning an error, could you post the erro message?Seki

2 Answers

1
votes

First the good news: You don't need to dump or import anything for PB 6.5.x. Just rename the PBD to PBL and you have a perfectly good PBL. The old PowerBuilder PBDs are PBLs and contain the source code. The newer PBDs are PBLs too but as Seki noted, they have the source code stripped out.

Now for the bad news. Many of us who have used PowerBuilder for years have learned two things the hard way. First and most important, all of your objects need to be compiled with the exact same build of PB, and you need to run them with that build of the PB runtime. If you don't do this you can get very strange behavior or the app may crash. Second, it's best to compile everything together and distribute a full build. You may have noticed that when you modify an object in the IDE, you often need to recompile other objects that reference it before the app will work correctly. Having the compiled code in a PBD or the EXE doesn't change this. Some people do successfully distribute just some of their PBDs, but you need a full regression test to know if it's safe to to that. The applications that are able to do this usually have very carefully controlled the dependencies between the PBLs.

0
votes

If you can get some source files with pbdumper, you could create a new .pbl file and import the .sr? files into it to recompile.

But it is weird that you can get some source files from a .pbd file as they are stripped by compilation (actually when compiling a .pbl, the corresponding .pbd is created and only the compiled object are written into it, unless the .pbl is not selected in the deployment options to generate .pbd, then the compiled objects are placed into the .exe - that is a win32 PE file, with an additional overlay containing a .pbd at its end).

I suspect that it could have been renamed by error into .pbd.