Re: [api-dev] instantiating InstanceLocker from BASIC
Hi Marc, The approved action here is prevent closing. So if TRUE is returned, the closing of the current document model should be prevented. But it looks like locking of the model does not prevent closing of the frame. Please try to register the InstanceLocker on the frame. Regards, Mikhail. Marc Santhoff wrote: Hello Mikhail, Am Montag, den 08.10.2007, 14:53 +0200 schrieb Mikhail Voitenko: Hi Marc, This is a bug, I have just submitted an issue to myself. It is going to be fixed in OOo2.4 currently. Please use the following link to find the issue. http://www.openoffice.org/issues/show_bug.cgi?id=82393 Thanks for information and filing that one. :) I read the issues text as if all three parameters are available it should work. So I tried: BASIC global doc as object global lck as object sub testLocker doc = ThisComponent oCB = CreateUnoListener(my_, com.sun.star.embed.XActionsApproval) args() = Array( CreateUnoValue(any, doc), _ CreateUnoValue(any, 1), _ oCB _ ) psm = GetProcessServiceManager() lck = psm.createInstanceWithArguments(com.sun.star.embed.InstanceLocker, args()) end sub function my_approveAction(nAction as long) as boolean 'msgbox Ping! my_approveAction = FALSE end function sub ReleaseLock if NOT IsNull(lck) then lck.dispose() end sub /BASIC And indeed the Ping! appeared, but after clicking away this message the writer doc was closed. Is there another error or did I fail in handing over the approve listening function? (I did test returning TRUE in the listening callback to be sure, no change) TIA, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] instantiating InstanceLocker from BASIC
Hi Mikhail! Yes, you're right. It was a matter of brain usage ... ;) Am Dienstag, den 09.10.2007, 11:41 +0200 schrieb Mikhail Voitenko: Hi Marc, The approved action here is prevent closing. So if TRUE is returned, the closing of the current document model should be prevented. And it is. That exactly was the cause of a hanging office process after the office was closed by me. I only didn't identify it because I had done some other things leaving a process active sometimes. If don't do this dangerous actions in parallel the process holding the modell stays in memory. So holding a reference to a not closable model *does work*. But it looks like locking of the model does not prevent closing of the frame. Please try to register the InstanceLocker on the frame. Yes, if I do exchange the model for the frame I does work as expected, the frame stays open as it should. So this works, too. :) Many thanks for helping out and waking me up, Marc Regards, Mikhail. Marc Santhoff wrote: Hello Mikhail, Am Montag, den 08.10.2007, 14:53 +0200 schrieb Mikhail Voitenko: Hi Marc, This is a bug, I have just submitted an issue to myself. It is going to be fixed in OOo2.4 currently. Please use the following link to find the issue. http://www.openoffice.org/issues/show_bug.cgi?id=82393 Thanks for information and filing that one. :) I read the issues text as if all three parameters are available it should work. So I tried: BASIC global doc as object global lck as object sub testLocker doc = ThisComponent oCB = CreateUnoListener(my_, com.sun.star.embed.XActionsApproval) args() = Array( CreateUnoValue(any, doc), _ CreateUnoValue(any, 1), _ oCB _ ) psm = GetProcessServiceManager() lck = psm.createInstanceWithArguments(com.sun.star.embed.InstanceLocker, args()) end sub function my_approveAction(nAction as long) as boolean 'msgbox Ping! my_approveAction = FALSE end function sub ReleaseLock if NOT IsNull(lck) then lck.dispose() end sub /BASIC And indeed the Ping! appeared, but after clicking away this message the writer doc was closed. Is there another error or did I fail in handing over the approve listening function? (I did test returning TRUE in the listening callback to be sure, no change) TIA, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] instantiating InstanceLocker from BASIC
Hi again, this time a crash report was generated. As last time there was only one writer doc open in parallel to the IDE. The code is: sub testLocker doc = ThisComponent args() = Array(CreateUnoValue(any, doc), CreateUnoValue(any, 1)) psm = GetProcessServiceManager() lck = psm.createInstanceWithArguments(com.sun.star.embed.InstanceLocker, args()) msgbox your doc is locked while this message is shown lck.dispose() end sub But on the machine used there is no connection to the outside. Whre should I send it to, anyone interested? A few lines: officeinfo:officeinfo xmlns:officeinfo=http://openoffice.org/2002/officeinfo; build=680m5(Build:9221) platform=wntmsci10.pro language= procpath=D:\PROGRAMME\OPENOFFICE.ORG 2.3\PROGRAM\ exceptiontype=0xC005 product=OpenOffice.org 2.3/ systeminfo:systeminfo xmlns:systeminfo=http://openoffice.org/2002/systeminfo; systeminfo:System name=Windows version=4.10 build=67766446 locale=0x0407/ systeminfo:CPU type=x86/ /systeminfo:systeminfo errormail:Stack type=Win32 errormail:StackInfo pos=0 ip=0x66788034 rel=0x8034 ordinal=uno_Environment_enter+0x096E name=CPPU3.DLL path=/ errormail:StackInfo pos=1 ip=0x6678842B rel=0x842B ordinal=uno_type_any_construct+0x001D name=CPPU3.DLL path=/ errormail:StackInfo pos=2 ip=0x59B8113B rel=0x113B ordinal=GetVersionInfo+0x013B name=COMPHELP4MSC.DLL path=/ errormail:StackInfo pos=3 ip=0x59BC7E43 rel=0x00047E43 ordinal=component_getFactory+0x25CA name=COMPHELP4MSC.DLL path=/ errormail:StackInfo pos=4 ip=0x5C9AD050 rel=0x0001D050 ordinal=cppu::createSingleComponentFactory+0x0BBA name=CPPUHELPER3MSC.DLL path=/ errormail:StackInfo pos=5 ip=0x5C9AD185 rel=0x0001D185 ordinal=cppu::createSingleComponentFactory+0x0CEF name=CPPUHELPER3MSC.DLL path=/ errormail:StackInfo pos=6 ip=0x5C9ADEE3 rel=0x0001DEE3 ordinal=cppu::createSingleComponentFactory+0x1A4D name=CPPUHELPER3MSC.DLL path=/ errormail:StackInfo pos=7 ip=0x626063BD rel=0x63BD ordinal=component_getFactory+0x4B06 name=SERVICEMGR.UNO.DLL path=/ errormail:StackInfo pos=8 ip=0x6260304D rel=0x304D ordinal=component_getFactory+0x1796 name=SERVICEMGR.UNO.DLL path=/ errormail:StackInfo pos=9 ip=0x63D61BCA rel=0x1BCA name=MSCI_UNO.DLL path=/ errormail:StackInfo pos=10 ip=0x63D61EE4 rel=0x1EE4 name=MSCI_UNO.DLL path=/ errormail:StackInfo pos=11 ip=0x63D622E2 rel=0x22E2 name=MSCI_UNO.DLL path=/ errormail:StackInfo pos=12 ip=0x635F70FB rel=0x70FB ordinal=component_writeInfo+0x4E40 name=REFLECTION.UNO.DLL path=/ Maybe this will help making a guess how I get the locking to work ... TIA, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] instantiating InstanceLocker from BASIC
Hi Marc, This is a bug, I have just submitted an issue to myself. It is going to be fixed in OOo2.4 currently. Please use the following link to find the issue. http://www.openoffice.org/issues/show_bug.cgi?id=82393 Thanks, Mikhail. Marc Santhoff wrote: Hi again, this time a crash report was generated. As last time there was only one writer doc open in parallel to the IDE. The code is: sub testLocker doc = ThisComponent args() = Array(CreateUnoValue(any, doc), CreateUnoValue(any, 1)) psm = GetProcessServiceManager() lck = psm.createInstanceWithArguments(com.sun.star.embed.InstanceLocker, args()) msgbox your doc is locked while this message is shown lck.dispose() end sub But on the machine used there is no connection to the outside. Whre should I send it to, anyone interested? A few lines: officeinfo:officeinfo xmlns:officeinfo=http://openoffice.org/2002/officeinfo; build=680m5(Build:9221) platform=wntmsci10.pro language= procpath=D:\PROGRAMME\OPENOFFICE.ORG 2.3\PROGRAM\ exceptiontype=0xC005 product=OpenOffice.org 2.3/ systeminfo:systeminfo xmlns:systeminfo=http://openoffice.org/2002/systeminfo; systeminfo:System name=Windows version=4.10 build=67766446 locale=0x0407/ systeminfo:CPU type=x86/ /systeminfo:systeminfo errormail:Stack type=Win32 errormail:StackInfo pos=0 ip=0x66788034 rel=0x8034 ordinal=uno_Environment_enter+0x096E name=CPPU3.DLL path=/ errormail:StackInfo pos=1 ip=0x6678842B rel=0x842B ordinal=uno_type_any_construct+0x001D name=CPPU3.DLL path=/ errormail:StackInfo pos=2 ip=0x59B8113B rel=0x113B ordinal=GetVersionInfo+0x013B name=COMPHELP4MSC.DLL path=/ errormail:StackInfo pos=3 ip=0x59BC7E43 rel=0x00047E43 ordinal=component_getFactory+0x25CA name=COMPHELP4MSC.DLL path=/ errormail:StackInfo pos=4 ip=0x5C9AD050 rel=0x0001D050 ordinal=cppu::createSingleComponentFactory+0x0BBA name=CPPUHELPER3MSC.DLL path=/ errormail:StackInfo pos=5 ip=0x5C9AD185 rel=0x0001D185 ordinal=cppu::createSingleComponentFactory+0x0CEF name=CPPUHELPER3MSC.DLL path=/ errormail:StackInfo pos=6 ip=0x5C9ADEE3 rel=0x0001DEE3 ordinal=cppu::createSingleComponentFactory+0x1A4D name=CPPUHELPER3MSC.DLL path=/ errormail:StackInfo pos=7 ip=0x626063BD rel=0x63BD ordinal=component_getFactory+0x4B06 name=SERVICEMGR.UNO.DLL path=/ errormail:StackInfo pos=8 ip=0x6260304D rel=0x304D ordinal=component_getFactory+0x1796 name=SERVICEMGR.UNO.DLL path=/ errormail:StackInfo pos=9 ip=0x63D61BCA rel=0x1BCA name=MSCI_UNO.DLL path=/ errormail:StackInfo pos=10 ip=0x63D61EE4 rel=0x1EE4 name=MSCI_UNO.DLL path=/ errormail:StackInfo pos=11 ip=0x63D622E2 rel=0x22E2 name=MSCI_UNO.DLL path=/ errormail:StackInfo pos=12 ip=0x635F70FB rel=0x70FB ordinal=component_writeInfo+0x4E40 name=REFLECTION.UNO.DLL path=/ Maybe this will help making a guess how I get the locking to work ... TIA, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] instantiating InstanceLocker from BASIC
Hello Mikhail, Am Montag, den 08.10.2007, 14:53 +0200 schrieb Mikhail Voitenko: Hi Marc, This is a bug, I have just submitted an issue to myself. It is going to be fixed in OOo2.4 currently. Please use the following link to find the issue. http://www.openoffice.org/issues/show_bug.cgi?id=82393 Thanks for information and filing that one. :) I read the issues text as if all three parameters are available it should work. So I tried: BASIC global doc as object global lck as object sub testLocker doc = ThisComponent oCB = CreateUnoListener(my_, com.sun.star.embed.XActionsApproval) args() = Array( CreateUnoValue(any, doc), _ CreateUnoValue(any, 1), _ oCB _ ) psm = GetProcessServiceManager() lck = psm.createInstanceWithArguments(com.sun.star.embed.InstanceLocker, args()) end sub function my_approveAction(nAction as long) as boolean 'msgbox Ping! my_approveAction = FALSE end function sub ReleaseLock if NOT IsNull(lck) then lck.dispose() end sub /BASIC And indeed the Ping! appeared, but after clicking away this message the writer doc was closed. Is there another error or did I fail in handing over the approve listening function? (I did test returning TRUE in the listening callback to be sure, no change) TIA, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] instantiating InstanceLocker from BASIC
Hi Paolo, you're right, stupid error since the argument is sequence of any. I tried here and had the office hang repeatedly on win98, so there in deed must be something wrong. Am Samstag, den 06.10.2007, 23:45 +0200 schrieb Paolo Mantovani: Hello Marc, It seems that the problem is in the way in which you are passing arguments. I've tried in this way: sub LockerCheck doc = ThisComponent psm = GetProcessServiceManager() args() = Array(doc, 3) I changed this to Array(doc, 1) to have the correct value for closing prevention. lck = _ psm.createInstanceWithArguments(com.sun.star.embed.InstanceLocker, args()) end sub No error are raised in this case, and I'm quite sure that arguments are correctly processed .but I've got some crashes :-( It seems that there are further problems, please check. Funny enough, with the original version having an array of PropertyValues the InstanceLocker got created, I could inpect it after the exception ... BTW what are you trying to achieve with this code? (I'm curious :-) I want to make sort of an immutable document window. Noone should be able to close it except my code. Thanks, Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]