Community
Showing results for 
Search instead for 
Do you mean 
Reply

How to create Act.Framework.ActFramework using CreateObject

Astute Commentator
Posts: 168
Country: United States

How to create Act.Framework.ActFramework using CreateObject

Anyone knows the name of the Act.Framework.ActFramework name to pass to CreateObject?

 

Most instances of the Act! Framework are created using ACTFM = New Act.Framework.ActFramework. However, that makes the code Act! version dependent. I'm trying to create the Act! Framework using ACTFM = CreateObject("act.framework.actframework") , however, the call fails.

 

Hence, what is the name of the Act! Framework to pass to CreateObject?

 

Thanx in advance.

 

T

 

Nickel Contributor
Posts: 175
Country: USA

Re: How to create Act.Framework.ActFramework using CreateObject

[ Edited ]

Is it even possible to do it that way? The CreateObject() call is leftover from the VB6 and prior days. It looks like it requires that the assembly is COM-accessible (https://msdn.microsoft.com/en-us/library/7t9k08y5(v=vs.90).aspx).Are the ACT assemblies COM-accessible?

 

Edit: Fix link

Astute Commentator
Posts: 168
Country: United States

Re: How to create Act.Framework.ActFramework using CreateObject

CreateObject was created, I think, in VB2 which over all these years has made it to VB.Net and is supported by the latest .net framework. It is a great way to create an object that is version independent.

 

When you use the New act.framework.actframework call, you create an Act! version dependent object. So if you compiled your code with a version 17.2 of Act! and the user is running Act! 17.1 (or 16.1 or 18.0), the creation of the object crashes.

 

You can create an Act! framework object using createobject("act.framework.interop.actframework") but the resulting object does not support Act! regular framework operations. So I do not know what kind of object is created.

 

Does anyone know of a non-version dependent mechanism to create a working Act! Framework object whether using createobject or any other call?

 

T

 

Copper Elite Contributor
Posts: 81
Country: Canada

Re: How to create Act.Framework.ActFramework using CreateObject

[ Edited ]

Can't comment on CreateObject and backwards compatibility, but you can make your plugins forward compatible. The way i do it is to determine the lowest version supported by my plugin. For example, Version 16.0 + .Net 4.0. Once you add references to 16.0, expand your references section in your project, and select all Act related references. Then set the property called "Specific Version" to false, and make sure "Copy Local" is also set to false. This will ensure that your plugin will run on machines running v16.0 and up.

Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.
www.keystroke.ca

Astute Commentator
Posts: 168
Country: United States

Re: How to create Act.Framework.ActFramework using CreateObject

Thanx. I do that for all the code. I have seen many instances where the framework will fail. The strange thing is that on some Act! installations it works. My theory is that if the user upgrades from 16 to 16.2, it works. But if the user install 16.2 from a distribution and your initial compile is on a 16.1, it fails. From our installations, setting Specific Version and Copy Local to false does not work with the Act! Framework. On ALL cases, we have 17.2 references and the user upgrades to 18, and the framework instantiation crashes miserably. We need then to use a specific exec linked to V18 references.

 

Any other ideas?

 

Copper Elite Contributor
Posts: 81
Country: Canada

Re: How to create Act.Framework.ActFramework using CreateObject

[ Edited ]

Well, there must be something else wrong with the project because personally, I've created plugins that target Act2007 + .NET 2.0 and they work without issues in all subsequent Act releases all the way up to v18. As long as you target .Net correctly, and don't distribute the Act dlls with your plugin, it should work on future releases.

 

That doesn't mean that I haven't seen some machines not work, but generally it is an issue with the Act installation. Usually, you would see a Act.Framework.dll not found error or something similar. This has to do with the dlls not being properly registered and the easiest way is to uninstall and then reinstall Act on the affected machine.

Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.
www.keystroke.ca

Astute Commentator
Posts: 168
Country: United States

Re: How to create Act.Framework.ActFramework using CreateObject

For example. User was using V17.2 and upgrades to V18 of Act!. The addin exec that uses 17.2 references will crash on the load. If V18 references are added, it works fine. I wish I knew why. The worst part, it does not happen on all systems.

 

Currently, we have to create a specific exec for each Act! version. VERY time consuming.....

Silver Super Contributor
Posts: 2,328
Country: USA

Re: How to create Act.Framework.ActFramework using CreateObject

That might be a .NET version issue.

 

Stan


If you would like to get more out of ACT! you can find an ACT! Certified Consultant near you by going to:www.act.com/acc.
-------------------------------------------------------------------------------------
Stan Smith
ACT! Certified Consultant
ADS Programming Services, Inc.
(205) 222-1661
www.adsprogramming.com
www.actwebhosting.com
Click Here to Purchase Act!
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: How to create Act.Framework.ActFramework using CreateObject

Have you tried the MachineConfigUpdater.exe?

Its at the root of ACT

 

-- Jim 

Astute Commentator
Posts: 168
Country: United States

Re: How to create Act.Framework.ActFramework using CreateObject

Thanx. I've tried just about everything possible.

 

My conclusion, even though it is a real pain to create independent execs for each version of Act!, that is easier than all other options.

 

If only CreateObject would work this would not be an issue. One line of code to change and everything would work fine.

 

T