dcsimg
Results 1 to 14 of 14

Thread: Renaming a Project with inline controls

  1. #1

    Thread Starter
    Junior Member IndicSoftware's Avatar
    Join Date
    Aug 2017
    Location
    India
    Posts
    22

    Renaming a Project with inline controls

    Hello,

    I am trying to modify the superb and feature rich PhotoDemon image editor written by Tanner Helland.

    This project has 52 inline controls.

    As I am planning to add a few features to it, I want to rename the project from PhotoDemon to PhotoDemonNewV.

    As soon as I change the project name in Project Properties dialog most of the inline controls get converted into picture box.

    Is there any reliable way to rename the project while keeping everything intact?

    Regards,
    --
    For,
    Indic Software

    Murphy's law: Logic is a way of coming to the wrong conclusion with confidence !!!

  2. #2
    Frenzied Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    1,570

    Re: Renaming a Project with inline controls

    First of all: make a copy of the original PhotoDemon project, then:
    - open (if close) the Project panel (F4) from View menu
    - open (if close) the Project manager panel (CTRL+R) from View menu
    - on Project manager panel select the name of project (should be the first item) , i.e.: PhotoDemon - PhotoDemon.vbp
    - on Project panel now you see only the project name PhotoDemon, then rename PhotoDemon to PhotoDemonNewV
    All user controls will be updated automatically.
    Save the project.

  3. #3

    Thread Starter
    Junior Member IndicSoftware's Avatar
    Join Date
    Aug 2017
    Location
    India
    Posts
    22

    Re: Renaming a Project with inline controls

    Hello,

    Thanks for the tip. I have already tried that and all possible ways but without success.
    Here is what error I am getting Name:  PhotoDemonRenameError.png
Views: 93
Size:  4.4 KB

    In this dialog if I click on Debug VB hangs and I am not even able to exit from it.

    But if click on End I will be presented another control name with the same or similar error.

    Regards,
    --
    For,
    Indic Software

    Murphy's law: Logic is a way of coming to the wrong conclusion with confidence !!!

  4. #4
    Frenzied Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    1,570

    Re: Renaming a Project with inline controls

    Right.
    This occur because VB6 make a ReadOnly copy of each file while change it.

    Alternatives:
    1) Copy the entire project to a different folder (i.e. PhotoDemoNew) ed use this folder. Of course, rename the VBP file to PhotoDemoNew.vbp
    2) use a text editor to change the project name within the FRM files (not recommended)

  5. #5
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,064

    Re: Renaming a Project with inline controls

    Hello, when I need to do such changes, I do them by text editing all the files.

    I use the freeware program TexRep for mass text replace.

    Of course the project must be closed from the IDE before doing that and make a full project backup first.

    In your case, it would be to replace PhotoDemon with PhotoDemonNewV in all and every project file.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  6. #6

    Thread Starter
    Junior Member IndicSoftware's Avatar
    Join Date
    Aug 2017
    Location
    India
    Posts
    22

    Re: Renaming a Project with inline controls

    @Gibra, @Eduardo,

    Thanks for the tips. I had completely forgotten that we can edit the .frm and .ctl files in a text editor.

    I did that and now am able to open the project and also compile it!

    Thanks again for your invaluable help.

    Regards,
    --
    For,
    Indic Software

    Murphy's law: Logic is a way of coming to the wrong conclusion with confidence !!!

  7. #7
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,579

    Re: Renaming a Project with inline controls

    Yeah, when I'm doing something like this, I just typically rename the project from within the VB6 IDE, and all else happens automatically.

    However, when I do need to do it manually with an editor, I typically use Notepad++ which also has very nice multi-file search-and-replace features. It can easily open multiple files (from Windows Explorer), and then go through them searching-and-replacing whatever you'd like. I know everyone has their favorites, but NP++ is definitely my fall-back code editor. I've even got a fairly nice VB6 template for it. I'll export-and-post it if anyone would like it. It's close enough to the VB6 IDE that I sometimes get confused about why Intellisense isn't working (which clearly it won't when in NP++).

    Y'all Take Care,
    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  8. #8
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,064

    Re: Renaming a Project with inline controls

    Quote Originally Posted by Elroy View Post
    Yeah, when I'm doing something like this, I just typically rename the project from within the VB6 IDE, and all else happens automatically.

    However, when I do need to do it manually with an editor, I typically use Notepad++ which also has very nice multi-file search-and-replace features. It can easily open multiple files (from Windows Explorer), and then go through them searching-and-replacing whatever you'd like. I know everyone has their favorites, but NP++ is definitely my fall-back code editor. I've even got a fairly nice VB6 template for it. I'll export-and-post it if anyone would like it. It's close enough to the VB6 IDE that I sometimes get confused about why Intellisense isn't working (which clearly it won't when in NP++).

    Y'all Take Care,
    Elroy
    Hello, I never used NP++ with multiple files. But TexRep I referred is not an editor, it is a program to perform bulk replace operations (without opening them on the screen).
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  9. #9
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,579

    Re: Renaming a Project with inline controls

    Yeah, you can use NP++ to just do the replacements in the set-of-files you have open:

    Name:  rep1.jpg
Views: 45
Size:  39.3 KB

    Or, you can go directly to disk and do the replacements to a set-of-files on disk, similar to your utility:

    Name:  rep2.png
Views: 47
Size:  17.6 KB

    I've used NP++ for years, and just love it as a text/code editor. When setup correctly, it will also match your parentheses, braces, and other block definitions. It also indents/un-indents blocks of code similar to code windows in the VB6 IDE. It's also got very nice file-comparison functions in it, which I often use.

    But hey, it's just my preferred text editor. I have it set as the Windows default program for BAS, FRM, CLS, CTL, & PAG files. When I double-click these in Windows explorer, I'd rather they load with NP++ rather than a single file in the VB6 IDE. Of course, VBP and VBG files still load with the IDE.

    Take Care,
    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  10. #10
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,064

    Re: Renaming a Project with inline controls

    OK. But may be I wasn't clear. With TexRep the files don't need to be open. There is no identation and such things, it is a simple text replace tool for files that are in a folder.
    You can test it for yourself, it could take just a couple of minutes: TexRep.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  11. #11
    Frenzied Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    1,570

    Re: Renaming a Project with inline controls

    I agree 100% with Elroy.

    NP++ is much powerful than TexRep, because you can see what files will be intersted before to replace.
    In fact, if you use the Find All button, instead of Replace All (no document is opened) , NP++ will list all files into a windows. Great.

    So, by example, you can se that if replacing PhotoDemo. with new name PhotoDemonVnew. will change more file as you expected.

    IMHO

  12. #12

    Thread Starter
    Junior Member IndicSoftware's Avatar
    Join Date
    Aug 2017
    Location
    India
    Posts
    22

    Re: Renaming a Project with inline controls

    My Personal favorite is also NP++. I use it all the times.

    Regards,
    --
    For,
    Indic Software

    Murphy's law: Logic is a way of coming to the wrong conclusion with confidence !!!

  13. #13
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,064

    Re: Renaming a Project with inline controls

    Comparing NP++ with TexRep is like comparing a Ferrari with a lift truck.
    TexRep only does replacing, nothing else, and it does it well and simple.

    I suspect that the people here talking about TexRep never used it and don't know what it does. (it is just a guess)
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  14. #14
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,064

    Re: Renaming a Project with inline controls

    Edit: For some reason the post got duplicated, so deleted...
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width