2 Macro Component in 1 app

Discussions and Tech Support related to using the iMacros Component for .NET in your applications.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
rguez_18
Posts: 102
Joined: Thu Oct 20, 2005 6:04 pm
Contact:

2 Macro Component in 1 app

Post by rguez_18 » Tue Dec 06, 2011 11:29 pm

Hi, I'm doing an app that requires 2 imacro browser in a single form (Seperated by tab pages). My issue is that the component doesn't seem to recognize the difference between two browser component, when ever I try to play a script on browser 1 it plays in on browser 2 or the recently added component, browser 1 was working fine before I added the 2nd browser. Any thoughts on this please? Thanks!
.NET Developer
<---Using IMacro since version 4 - See Date Joined on Forum
***For Quotes and Estimates please feel free to contact me.
YM: Rguez_18 <at> y a hoo <that> com
Skype: Rguez_18
Marcia, Tech Support
Posts: 1094
Joined: Thu Jan 29, 2009 1:10 pm

Re: 2 Macro Component in 1 app

Post by Marcia, Tech Support » Tue Dec 13, 2011 8:11 am

Hello,

Unfortunately, it is not possible at this time to control two iMacrosControl instances in a single application. I am afraid a quick fix now might compromise iMacros stability. There were some design decisions we made where we chose - for performance reasons - to have a few static classes and properties. Two iMacrosControl instances will, of course, share those static objects.
Regards,

Marcia
BGood
Posts: 19
Joined: Thu Mar 31, 2011 2:23 am

Re: 2 Macro Component in 1 app

Post by BGood » Tue May 29, 2012 11:02 pm

From Marcia's answer I conclude that you cannot have 2 instances of the component in a single class, but the title of the OP is confusing. Can you have multiple iMacros components in a single application when the two components are in different classes/forms? What about if they are not simultaneously activated? Thanks.
Marcia, Tech Support
Posts: 1094
Joined: Thu Jan 29, 2009 1:10 pm

Re: 2 Macro Component in 1 app

Post by Marcia, Tech Support » Thu May 31, 2012 11:09 am

Hi,
BGood wrote: Can you have multiple iMacros components in a single application when the two components are in different classes/forms?
No, static fields are shared by all instances in the same application.

However, if you dispose of iMacrosControl, these static fields are reset, and you can create a new iMacrosControl instance, which will not be influenced by the disposed one.
Regards,

Marcia
BGood
Posts: 19
Joined: Thu Mar 31, 2011 2:23 am

Re: 2 Macro Component in 1 app

Post by BGood » Fri Jun 01, 2012 6:38 pm

Marcia,

So then I assume that it would not be a good idea to use the iMacros control browser for online help access, or other functions that might be activated simultaneously with another browser instance?
Marcia, Tech Support
Posts: 1094
Joined: Thu Jan 29, 2009 1:10 pm

Re: 2 Macro Component in 1 app

Post by Marcia, Tech Support » Mon Jun 04, 2012 7:24 am

Hello,

For simple online help access, I suggest you use an instance of .NET WebBrowser Control, since for that you don't need iMacros' engine.

Would that work for you?
Regards,

Marcia
BGood
Posts: 19
Joined: Thu Mar 31, 2011 2:23 am

Re: 2 Macro Component in 1 app

Post by BGood » Tue Jun 05, 2012 6:13 pm

Hi Marcia,

That is the approach I was using before integrating the iMacros Component, but scripting with the component is so much easier than programatically traversing the DOM in .net. Given the restrictions imposed by the single static instance, I will have to go back to the .net webbrowser control for help scripting (which is minimally difficult relative to data extraction). Thanks.
Post Reply