LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavier of function parameters (including ActiveX)

Hi,

I´m calling a function where I open Word and load a document (ActiveX). The handler to the application and to the document are returned as parameters. Afterwards I call an other function with the document handler as parameter. Until here, all seems to be ok, but now, if I execute an ActiveX command I get the error message that the handler is invalid, although it is the same value which I got from the first function. Olease can anybody tell me what´s wrong?

Code:
// prototypes
void function (void);
void Word2002_NewAppOpenDoc (int iVisible, char cFile[], CAObjHandle *AppHandle, CAObjHandle *DocHandle);
void Word2002_GoToBookmark (CAObjHandle DocHandle, char cMark[]);


void function (void)
{
CAObjHandle WordHandle;
CAObjHandle DocHandle;

Word2002_NewAppOpenDoc (1, "d:\\pruefstand\\prototyp.doc", &WordHandle, &DocHandle);
//at this position WordHandle and DocHandle have the right values
Word2002_GoToBookmark (DocHandle, "MrkType");
}



void Word2002_NewAppOpenDoc (int iVisible, char cFile[], CAObjHandle *AppHandle, CAObjHandle *DocHandle)
{
.
.
.
*AppHandle = ObjTmp;
.
.
.
*DocHandle = ObjTmp;
}



void Word2002_GoToBookmark (CAObjHandle DocHandle, char cMark[])
{
CAObjHandle AppHandle;
.
.
//the parameter DocHandle still have the right value but...
Word_DocumentGetApplication (DocHandle, NULL, &AppHandle);
//...this command generate an error which says that the handler is invalid
.
.

}


Thanks!
Thomas
0 Kudos
Message 1 of 1
(2,352 Views)