Forum Discussion

lherry's avatar
lherry
Contributor
3 hours ago

Shared user form between projects and event management

Hi all,

I'm using a form that is shared between several projects. 
This form has 2 event handlers and I'm encountering a problem when executing it on the different projects.

Assigning the event handler in the form works on the first project, but fails on the next.
It's logical and due to the GUID attached between the form control and the event handler, which, as its name suggests, is unique to the project.

To “get around” this technical constraint, I'd like to assign this handler dynamically from an initialization method, but I can't find any property that allows me to do so.

Is there a solution to my problem other than duplicating my form file for each project?

Thank you in advance for your help.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    The GUID references are internal use to TestComplete only. They can't be generated manually, well, unless you do a search and replace outside of TC, e.g. using Notepad++.

    If you create a separate project within your project suite and call it Common. Define your name mapping, events etc for your form. You should then be able to call this from other projects; you will have to implement a callback routine so that it triggers when an event is raised.