| View previous topic :: View next topic |
| Author |
Message |
922 General User


Joined: 02 Mar 2003 Posts: 6
|
Posted: Thu Jul 03, 2003 11:45 am Post subject: loadComponentFromURL problem |
|
|
Hello!
I have russian accounting program 1c which hasits own language like VB.Tring to open new OOCalc document from this program using OLE. But on the loadComponentFromURL method i have ERROR message Types mismatch.I know that last argument-secuence mismatch.
May be somebodyknows howcan i declare that arguments if theown language oftheprogram doesnot have arrays.
thatk you in advance.
by the way my main goal is to get information from my program andput it in OO document. May bei should use another method? |
|
| Back to top |
|
 |
Myron General User

Joined: 03 Jul 2003 Posts: 7 Location: Austria
|
Posted: Fri Jul 04, 2003 12:21 am Post subject: |
|
|
| Code: |
Dim obj, objDesktop, objDocument As Object
Dim objInfo As Object
Dim args()
Set obj = CreateObject("com.sun.star.ServiceManager")
Set objDesktop = obj.createInstance("com.sun.star.frame.Desktop")
Set objDocument = objDesktop.LoadComponentFromURL("file:///D:/Sovag/Test.sxw", "_blank", 0, args)
Set objInfo = Nothing
Set objDocument = Nothing
Set objDesktop = Nothing
Set obj = Nothing
|
_________________ Service with a smi)e |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Sat Jul 05, 2003 11:07 am Post subject: |
|
|
| Quote: |
which hasits own language like VB.Tring to open new OOCalc document from this program using OLE. But on the loadComponentFromURL method i have ERROR message Types mismatch.I know that last argument-secuence mismatch.
May be somebodyknows howcan i declare that arguments if theown language oftheprogram doesnot have arrays.
|
I have had similar problems using OOo from Visual FoxPro.
In my case, VFP does in fact have arrays. But just not empty arrays. So I have to declare an array with 1 element, and then put some harmless property into that one element. For example, the one element argument array might set Name to "ReadOnly" and Value to "false" and pass that one argument array to LoadComponentFromURL.
If your language truly does NOT have arrays, I'm not sure what you could do. Maybe write a "wrapper" library in VB and then call this from your accounting program? |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
openmind OOo Enthusiast


Joined: 28 Jun 2003 Posts: 106 Location: Switzerland
|
Posted: Sun Jul 06, 2003 6:22 am Post subject: |
|
|
Hi DannyB,
i just had a look at your DrawPowerTools (mentioned in your signature) and want to thank you for that document.
As i've seen it contains alot of collected code (or even libraries) which lets me use draw functionality from OOBasic and (even more valubale) shows how to deal with draw docs at all.
Very nice work which could be read as an intro in pragramming draw or as nice helpers to make thing done quicker
many thanks |
|
| Back to top |
|
 |
922 General User


Joined: 02 Mar 2003 Posts: 6
|
Posted: Sun Jul 06, 2003 11:04 am Post subject: Arrays |
|
|
Difficulty of the situation is that program have arrays. I can declare it -
Var noargs[100];
where 100 - number of elements of array. BUT! In that language i have no possibility to send WHOLE array to any function - ONLY one value, for example, noargs[1]. If i wrote noargs the n i received TYPE MISMATCH error message.
May be somebody knows how can i pass that argument in LoadComp... procedure.
My code is from sample (www.openoffice.org):
sUrl="private:factory/scalc";
sArg="_blank";
objServiceManager= CreateObject("com.sun.star.ServiceManager");
objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop");
objDocument= objDesktop.loadComponentFromURL(sUrl,sArg, 0, noargs) |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Mon Jul 07, 2003 10:57 am Post subject: Re: Arrays |
|
|
| 922 wrote: | In that language i have no possibility to send WHOLE array to any function - ONLY one value, for example, noargs[1]. If i wrote noargs the n i received TYPE MISMATCH error message.
|
Unfortunantly, this sounds like a limitation of the language. The type mismatch, of course, makes total sense given that you are passing one value instead of an array.
As I mentioned, I've had similar difficulties with Microsoft Visual FoxPro. At least, VFP has the COMARRAY() function, and the capabilitiy to pass arrays, just not empty ones.
If your language does not allow you to pass arrays, then you may have to write the code in another language, like Visual Basic. Design the Visual Basic routines to have interfaces that only use parameters which CAN be called from your unspecified accounting system language.
It sure would be nice if OOo provided its own object type for a sequence. Then for these feature poor languages, we could at least create an OOo sequence, populate it with values, and pass that in for the array parameter to functions such as LoadComponentFromURL(). _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
|