Removing component Microsoft Forms 2.0 object library-VBForums
Results 1 to 12 of 12

Thread: Removing component Microsoft Forms 2.0 object library

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2017
    Posts
    5

    Removing component Microsoft Forms 2.0 object library

    Hi All,

    I have an old application written by someone else. I want to remove all the references of Microsoft Forms 2.0 object library from this application. The reason is when I create the package using P&D wizard and deploy the package to someone else computer, I get FM20.dll error saying "Out of memory". I tried to uncheck Microsoft Forms 2.0 object library from the component controls, but I get an error saying "can't remove control reference, in use". I am not sure, but I think this entire project is not using Microsoft Forms 2.0 object library. How can I find out if the application is using Microsoft Forms 2.0 object library and if it is not how can i remove the reference to this component. below is the screen shot of my references and components. I really want to remove all the references to Microsoft Forms 2.0 object library and then create new controls if necessary or just get rid of the Microsoft Forms 2.0 object library completely.

    Name:  component.gif
Views: 121
Size:  15.4 KB

    Name:  refer.gif
Views: 100
Size:  14.1 KB

    Any help will be greatly appreciated.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,131

    Re: Removing component Microsoft Forms 2.0 object library

    You probably have controls on one or more of your forms that are from the Forms2.0 collection.
    You would need to remove those first.

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    31,012

    Re: Removing component Microsoft Forms 2.0 object library

    If it won't let you remove the reference, you're using some part of it somewhere. You're using at least one control in the library somewhere.
    Howto find it? hmmm... I think you can open the FRM file in note pad and look at the top where the controls are listed, it may be obvious when you look at the classnames... maybe.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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

    Re: Removing component Microsoft Forms 2.0 object library

    On the top of the .FRM file (open with Notepad) with FM20.dll controls contains something like this:
    Code:
    Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
    each controls of FM20.dll library start with "MSForms." example:
    Code:
    Begin MSForms.TextBox TextBox1
    Caution: some controls contains a reference to .FRX file. Example:
    Code:
       Begin MSForms.MultiPage MultiPage1 
          Height          =   1350
          Left            =   90
          OleObjectBlob   =   "Form1.frx":0000
          TabIndex        =   10
          Top             =   3870
          Width           =   2880
       End
    By removing the FM20 control from Form the related entry in .FRX file will be removed also.

  5. #5
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    562

    Re: Removing component Microsoft Forms 2.0 object library

    > "I have an old application written by someone else."

    ... "someone else" who either never visited this forum or who chose to ignore the advice we've [all] been handing out for years (and years!).

    Don't use the Forms 2.0 controls in VB applications.

    They're an integral part of MS Office which you licence from Our Friends in Redmond in exchange for cash money. Distributing fm20.dll with your own applications is technically, illegal.

    So; good move on [finally] getting rid of them.

    > "I tried to uncheck Microsoft Forms 2.0 object library ... I get an error ..."

    So at least one control in that library is [still] being used in your application.
    Seek and Destroy.

    > "I think this entire project is not using Microsoft Forms 2.0 object library ..."
    Something is, or VB would let you remove the reference.

    Possibility: These controls (that you can place onto Forms) also appear in the list of "Project > Components ...". Try removing it from there first.

    Regards, Phill W.

  6. #6
    Addicted Member
    Join Date
    Apr 2017
    Posts
    164

    Re: Removing component Microsoft Forms 2.0 object library

    I tell you what I think; there is at least one control from the Form 2.0 object library still attached to one of your Forms

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

    Re: Removing component Microsoft Forms 2.0 object library

    Yes, I suspect there is too. There are 13 different controls in that FM20.DLL that can be used.

    If a search for MSFORMS is done in all the FRM files, they'll all be found. Those must be deleted and replaced with other alternatives before the reference to FM20.DLL can be removed.

    Good Luck,
    Elroy

  8. #8
    Fanatic Member DrUnicode's Avatar
    Join Date
    Mar 2008
    Location
    Natal, Brazil
    Posts
    582

    Re: Removing component Microsoft Forms 2.0 object library

    Those must be deleted and replaced with other alternatives before the reference to FM20.DLL can be removed.
    Just do a Global replace in all *.frm of "MSForms." with "VB." (without the quotes) and you will be back to Vb intrinsic controls.
    Then you can remove reference to MSForms 2.0.
    You can use freeware Notepad++ using "replace in files" option.

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

    Re: Removing component Microsoft Forms 2.0 object library

    Say DrUnicode. I agree that Notepad++ is an absolutely fabulous multi-file search-and-replace tool. However, are you sure that'll work?

    The MSForms controls have some funky ways of storing properties. For instance, this is the MSForms.Label:

    Code:
    
    VERSION 5.00
    Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
    Begin VB.Form Form1
       Caption         =   "Form1"
       ClientHeight    =   9180
       ClientLeft      =   240
       ClientTop       =   5175
       ClientWidth     =   6585
       LinkTopic       =   "Form1"
       ScaleHeight     =   9180
       ScaleWidth      =   6585
       Begin MSForms.Label Label1
          Height          =   1035
          Left            =   2220
          TabIndex        =   0
          Top             =   2400
          Width           =   1755
          Size            =   "3096;1826"
          FontHeight      =   165
          FontCharSet     =   0
          FontPitchAndFamily=   2
       End
    End
    Attribute VB_Name = "Form1"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Option Explicit
    
    
    
    What's that "Size" property? I think the VB label may throw up if it sees that property. It may take a bit more research to do a straight-up search-and-replace.

    Best Regards,
    Elroy

    EDIT1: For comparison, here's a form with just a VB Label on it in the same spot:

    Code:
    
    VERSION 5.00
    Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
    Begin VB.Form Form1
       Caption         =   "Form1"
       ClientHeight    =   9180
       ClientLeft      =   240
       ClientTop       =   5175
       ClientWidth     =   6585
       LinkTopic       =   "Form1"
       ScaleHeight     =   9180
       ScaleWidth      =   6585
       Begin VB.Label Label2
          Caption         =   "Label2"
          Height          =   1035
          Left            =   2220
          TabIndex        =   1
          Top             =   2400
          Width           =   1755
       End
    End
    Attribute VB_Name = "Form1"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Option Explicit
    
    EDIT2: Hmmm, ok, I tried search-and-replace with the label, and the IDE complained a bit but it did successfully clean it up. However, that's a bit of a roll-of-the-dice to see if it'll work with all the other FM20.DLL controls.
    Last edited by Elroy; Sep 12th, 2017 at 03:27 PM.

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

    Re: Removing component Microsoft Forms 2.0 object library

    Quote Originally Posted by DrUnicode View Post
    Just do a Global replace in all *.frm of "MSForms." with "VB." (without the quotes) and you will be back to Vb intrinsic controls.
    I'm not sure of this.
    FM20.DLL controls has properties that intrinsec controls do not have (see #4)
    So, caution...

  11. #11
    Fanatic Member DrUnicode's Avatar
    Join Date
    Mar 2008
    Location
    Natal, Brazil
    Posts
    582

    Re: Removing component Microsoft Forms 2.0 object library

    Just tried with 7 MSForms 2.0 controls and it generates a log file with those properties it can't resolve.
    I then saved the project anyway and everything ran OK.
    At least this is better than deleting and adding new control since you would lose the old position and width/height.

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

    Re: Removing component Microsoft Forms 2.0 object library

    I just wanted to warn the user.
    If specific properties of the FM20.dll control are set by code, it is clear that editing manually the FRM file will result in errors.

Tags for this Thread

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

Survey posted by VBForums.