I was thinking that you should Add a reference to Microsoft Development Environment 7.0 and then work from there. The problem is that I don't think that file is compatible with VB 6. In code view in VB 6 you will be able to access all the properties & methods, but I just can't seem to get something working. Maybe I should try again.
Or, you could build a basic thing in VB.NEt and import that dll into your VB 6 project
The vbp however is typically not part of the files that would be installed on the end users system so this file would not be available at runtime in most cases. Not sure why one would need to do this type of thing.
One easy way of course would be to simply use dir$() and search app.path for *.vbp files most of the time there will be only one result. In cases where more than one project exist you could read a few lines from each to find the exe name for that project and match it to your app.exename
Last edited by DataMiser; June 25th, 2010 at 08:02 AM.
I am very unlucky because all the applications that I am working have their exe names changed to something. The title is set for all the applications to something different from the .vbp file name. Is there any other way to get the .vbp file name. Thanks to you all guys for your effort.
Like I menioned in the first post Dir$() with * .vbp as a filter will retrieve any .vbp files in the given folder. It you have only one project file per folder then this would work fine if you have more then you would need to parse the vbp files to find the right one for the program in question. Even then it should eb pretty simple.
Okay people, App.exename is the actual name of the exe on disk, change it and so does the return value. App.Title is the actual file name of the *.vbp file as saved on disk, change it, and so does the return value.
Now, what it seem like the OP is after is the information contained within the *.vbp file... which is
Which will allow someone experience at reading these files, find all of the other files associated with the project, and *.vbg files contain links to the *.vbp files. So one could make changes or as I have been doing, allow someone who does not have vb6 to see the vb6 project as one would at design time, code, icons, graphics included, and picture boxes for those controls that are not found/registered/etc. on the machine. Just a note on the graphics, if they have been added to the project at design time and not at runtime...
Actually App.Title is the value assigned to App.Title in the properties window. By default it is the same as the VBP file. If you change the name of the VBP file the title changes as well. If you change the Title in the properties area then the VBP file is no longer a match.
The only [almost] fool proof way that I can think of would be to look for VBP files in the project folder and if more than one exists then read the data from the file until you find the exename or title and compare that to what is returned. Even this could fail if the vbp has been modified since the exe was built.
I am trying to get the properties of an activex control in all the forms of the project. So to access all the forms, I am getting the form names of the project through the .vbp file. Then I pass the name of the forms to Forms.Add and then load them and read all the required activex control properties. This exercise is done to know what are all the properties which are set for the activex control ( comparing them against the default property values for the activex control.)
This has to be done for nearly 50 projects.
Hope I am clear.