Hi,
thanks for reply.
so I have added a reference in the project to Microsoft.mshtml.
And in my OnContextChange handler I have written:
if (e.Type == "ContextNode")
{
string aLoc=e.Context.nodeName;
aLoc=aLoc.Replace("my:", "");
HTMLTaskPaneObject taskPane=(HTMLTaskPaneObject)thisXDocument.View.Window.TaskPanes[0];
mshtml.HTMLWindow2Class window=(mshtml.HTMLWindow2Class)taskPane.HTMLDocument.Script;
window.execScript("waitForContext('" + aLoc + "')", "JScript");
}
@Patrick Halstead: I don`t know, what do You mean by "PIA".
my second problem is, that I can`t use COM - Component on other computer. I have registered the templet with RegForm.exe (registration tool). With digital certificate and settings it´s all ok but it won't work.
I keep getting an error message:
"
System.NullReferenceException
Object reference not set to an instance of an object.
at InfoPathProject1.InfoPathProject1.OnLoad(DocReturnEvent e) in c:\documents and settings\uid11518\desktop\infopathproject1\formcode.cs:line 604
at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)"
this is
OnLoad handler
public void OnLoad(DocReturnEvent e)
{
try
{
cForm = new CodeForm(this); // I create new instance from Form here
addGUI = new GUI4ADDClass(); // I call COM - Component
bOK = addGUI.OpenConnection("","PROD",false);
}
catch(Exception e)
{
this.thisXDocument.UI.Alert(f.ToString());
}
}
in other words on my computer it work and on other computer It won't work.
I would be glad to have your explanation
robmir