[Openroad-users] Word ActiveX (again!) - External Class Events

Bodo Bergmann Bodo.Bergmann at ingres.com
Tue Jul 8 21:04:23 EST 2008


I've seen this before - the names are ok, but the parameters are passed
in the wrong order.
I think there should be a bug fix available.
 

________________________________

From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Pete
Wilkinson
Sent: Tuesday, July 08, 2008 12:53 PM
To: International OpenROAD Users
Subject: Re: [Openroad-users] Word ActiveX (again!) - External Class
Events


trying that produced this error:
 
E_WT0029 Error at line 27 of main_go.
 

E_WR0003 Value passed to parameter of incompatible type.
    A value of type '_document' was passed to the parameter 'cancel' in
the
    frame 'main_go'.  The type '_document' is not compatible with the
type
    of the parameter, 'i4'.
 
E_AF2001_NO_CONVERSION Object can not be converted to i4.
E_WR006C Error assigning a value to parameter 'doc'.
 

E_OM000B A non-object typed value passed to an object.
    A value whose type is not a class was passed to a parameter that is
an
    object.
 
This seemed to suggest incorrect naming of parameters, having swapped
them around, all is ok!?
 
So my code is now:
 
ON EXTCLASSEVENT 'DocumentBeforeClose' (cancel = WinWord!Document
DEFAULT NULL,doc = INTEGER NOT NULL)=
BEGIN
 
    IF cancel IS NOT NULL THEN
 
        CurFrame.Trace ( text = 'closing:' + VARCHAR(cancel.Name) );
 
    ENDIF;
 
END;

I guess there is something wrong in the OR interface to the ActiveX?

	-----Original Message-----
	From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com]On Behalf Of Bodo Bergmann
	Sent: 08 July 2008 11:37
	To: International OpenROAD Users
	Subject: Re: [Openroad-users] Word ActiveX (again!) - External
Class Events
	
	
	The definition of the COM event shows 2 parameters, but you only
specified one of them.
	In addition, the parameter names do not match - it has to be
"doc" rather than "doc_closing".
	 
	Try:
	 
	ON EXTCLASSEVENT 'DocumentBeforeClose' (doc = WinWord!Document
DEFAULT NULL, cancel = INTEGER NOT NULL)=
	... 
	
	
________________________________

	From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Pete
Wilkinson
	Sent: Tuesday, July 08, 2008 12:30 PM
	To: International OpenROAD Users
	Subject: Re: [Openroad-users] Word ActiveX (again!) - External
Class Events
	
	
	thanks to Ian & Bodo for the same idea, whilst it does stop a
new blank document opening, due to doc_closing now being NULL, this
parameter really should have the closing document in it.  I noticed my
trace message was actually reporting the name of the newly opened blank
document and not the one that was closing down ... the closing document
reference is obviously not coming back?
	 
	here is the Microsoft definition:
http://msdn.microsoft.com/en-us/library/aa263708(office.10).aspx
	 
	 

		-----Original Message-----
		From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com]On Behalf Of Bodo Bergmann
		Sent: 08 July 2008 11:20
		To: International OpenROAD Users
		Subject: Re: [Openroad-users] Word ActiveX (again!) -
External Class Events
		
		
		Have you tried declaring the "doc_closing" parameter
with DEFAULT NULL?

________________________________

		From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Pete
Wilkinson
		Sent: Tuesday, July 08, 2008 11:53 AM
		To: openroad-users at peerlessit.com
		Subject: [Openroad-users] Word ActiveX (again!) -
External Class Events
		
		
		I'm working in OR4.1 SP3, as External Class Events in
OR2006 are not working correctly, so whilst I wait for a fix ... 
		
		I want to know what document is closing, so I trap the
external class event as follows: 
		
		ON EXTCLASSEVENT 'DocumentBeforeClose' (doc_closing =
WinWord!Document)= 
		BEGIN 
		
		CurFrame.Trace ( text = 'closing:' +
VARCHAR(doc_closing.Name) ); 
		
		END; 
		
		Now this works in the sense, in that it reports the
document name closing, however it seems the declaration in the parameter
list of 'WinWord!Document' actually initiates a new document to be
opened/created ... not quite what I was expecting 
		
		is this a bug, and is there away around it? I've tried
having the parameter as type ExtClass but that was of no use.

	
**********************************************************************

		SunGard Public Sector Limited, Marshfield, Chippenham,
Wiltshire  SN14 8SR
		Telephone: 08456 041999,  Fax: 08456 052999
		
		Registered Office:  33 St Mary Axe, London EC3A 8AA.
Registered in England No.
		1593831 VAT Reg No. GB 810 9546 34

	
**********************************************************************

		CONFIDENTIALITY: This e-mail (including any attachments)
may contain confidential, proprietary and privileged information, and is
intended solely for the use of the individual or entity to whom they

		are addressed. Any unauthorized disclosure or use is
prohibited. If you received this e-mail in error, please notify the
sender and delete this e-mail from your system.

	
**********************************************************************


		This message has been checked for all known viruses on
behalf of SunGard Public Sector by MessageLabs. 
		
		http://www.messagelabs.com or Email:
mailsweeper.info at vivista.sungard.com
		
		For further information http://www.sungardps.co.uk
		
		This message has been checked for all known viruses on
behalf of SunGard Public Sector by MessageLabs. 
		
		http://www.messagelabs.com or Email:
mailsweeper.info at vivista.sungard.com
		
		For further information http://www.sungardps.co.uk
		


	This message has been checked for all known viruses on behalf of
SunGard Public Sector by MessageLabs. 
	
	http://www.messagelabs.com or Email:
mailsweeper.info at vivista.sungard.com
	
	For further information http://www.sungardps.co.uk
	
	This message has been checked for all known viruses on behalf of
SunGard Public Sector by MessageLabs. 
	
	http://www.messagelabs.com or Email:
mailsweeper.info at vivista.sungard.com
	
	For further information http://www.sungardps.co.uk
	


This message has been checked for all known viruses on behalf of SunGard
Public Sector by MessageLabs. 

http://www.messagelabs.com or Email:
mailsweeper.info at vivista.sungard.com

For further information http://www.sungardps.co.uk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20080708/13ddbb93/attachment.html 


More information about the Openroad-users mailing list