OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

how do i implement eventlistener?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
fsunglim
General User
General User


Joined: 01 Jul 2008
Posts: 38

PostPosted: Wed Jul 02, 2008 6:14 pm    Post subject: how do i implement eventlistener? Reply with quote

Hi,

My aim is to close the odt file after printing in my vb6 application. During debugging breakpoint at CallByName function then step into Close function everything works properly. But if there isn't any break point the code will run into a run time error '1001': com.sun.util.closevetoexception: controller disagree.

Therefore i believe implementing the eventlistener will work rather than sleep(..)

CallByName oDoc, "print", VbMethod, arg()
oDoc.Close (True)

Can any kind soul pls guide me in implementing the event listener so to close the odt file after printing. Saw some posting on event listener but cant fiigure out how to implement it. pls help Thanks=P
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Fri Jul 04, 2008 8:45 am    Post subject: Reply with quote

Don't know if it is possible to create event listeners in VB6
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
carlos.rocha
General User
General User


Joined: 01 Jul 2008
Posts: 12

PostPosted: Fri Jul 04, 2008 7:05 pm    Post subject: Reply with quote

It is possible to create listeners with VB6.
You can find a sample in http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Automation_Objects_with_UNO_Interfaces

Basically, what you need is to create a COM object that maps the listener(s) methods (don't forget the "disposing") and register it with OOo in the usual way. Just create an ActiveX DLL with a class module for every listener you need.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group