-
Sep 11th, 2017, 05:21 PM
#1
Thread Starter
New Member
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.
Any help will be greatly appreciated.
-
Sep 11th, 2017, 06:07 PM
#2
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.
-
Sep 11th, 2017, 06:09 PM
#3
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
-
Sep 12th, 2017, 03:18 AM
#4
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.
-
Sep 12th, 2017, 06:02 AM
#5
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.
-
Sep 12th, 2017, 10:09 AM
#6
Fanatic Member
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
-
Sep 12th, 2017, 10:27 AM
#7
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
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. To all, peace and happiness.
-
Sep 12th, 2017, 01:23 PM
#8
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.
-
Sep 12th, 2017, 03:22 PM
#9
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.
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. To all, peace and happiness.
-
Sep 12th, 2017, 03:23 PM
#10
Re: Removing component Microsoft Forms 2.0 object library
Originally Posted by DrUnicode
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...
-
Sep 12th, 2017, 03:50 PM
#11
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.
-
Sep 13th, 2017, 03:26 AM
#12
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|