Good day PB Gurus,
I have an old pfc application, currently migrated to PB2017 R3 and PB2019 R2 Build 2328. All the code is the same except for the application object, but I have it split up in 4 different folder structures, dev, test, stage, prod. All the app objects are in one pbl, as AppD, AppT, AppS, AppP and propagated to all four folders. I have a separate target that corresponds to each app object. There are also 4 different project objects which when built, creates an AppD.exe, AppT.exe, AppS.exe, AppP.exe. This works fine except that merging changes has become a pain.
I have combined all of this into one folder with the 4 targets delineating the 4 apps. Just like they were before except the folder structure is one, instead of 4. The app runs fine in the IDE whenever I run it from each separate target. The problem lies with the built exe. It works fine for the first one built, for example, AppD.exe, but when I build AppT.exe, it builds fine. But copying it to the application folder and running it there, it fails to run with a null object reference.
The app is built with 24 separate pbds and an exe.
Is there something special I need to do with the app object and or the project object? Put them in a separate pbl? Or is this something that can't be done?
Thanks for any help you can provide.
Suggestion: I would place each App Object and its associated Project object pair in their own PBL. Then tie these together individually via a corresponding Target (per pair). Then add all the regular PBL's to the librayr list for each target. That should then produce one unique App object and EXE pair per Target. Thus, the compiles and EXE's should be clear to the compiler and run-time. HTH
I failed to mention that the app is run out of 4 different folders as well. Program Files (x86)\app\Dev, Program Files (x86)\app\Test, etc. That was apparently the main reason for this approach.
So I added a new app object and set it up to run from Program Files (x86)\app, and added a login to pick the environment to run in. Subfolders underneath this have the Program Files (x86)\app\logs\Dev, Program Files (x86)\app\logs\Test, etc instead of Program Files (x86)\app\Dev\logs, Program Files (x86)\app\Test\logs. The only issue with this approach is themes. If the user selects different themes for each environment, I won't know which one to pick (cause it's set in the preferences in the registry for that environment). The user is presented with a window to select their environment after the ApplyThemes command, thus I have to pick the last used theme. Unless someone can think of a better way?
The main difference with our implementation compared to Daniel's is that we keep the EXE names the same and deploy prod and beta to different folders. Like Daniel's situation, we have been doing this for over twenty years, although in our case, we do not have any problems. Currently we are on PB2017R3, although I had played about with 2019 and experienced no issues either.
The only issues we have ever had would be the ones Michael mentioned being adding a global variable to one app object and forgetting to add it to the other, although that generates a compile error vs. a runtime error. For the runtime error, I guess I would focus my efforts on the different build objects and look for differences. We do our builds using OrcaScript, so it is pretty easy to make sure that the app versions, beta and production, all get built identically.