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

loadComponentFromURL problem

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


Joined: 02 Mar 2003
Posts: 6

PostPosted: Thu Jul 03, 2003 11:45 am    Post subject: loadComponentFromURL problem Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Myron
General User
General User


Joined: 03 Jul 2003
Posts: 7
Location: Austria

PostPosted: Fri Jul 04, 2003 12:21 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sat Jul 05, 2003 11:07 am    Post subject: Reply with quote

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
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sat Jul 05, 2003 2:53 pm    Post subject: Reply with quote

just testing my sig....
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
openmind
OOo Enthusiast
OOo Enthusiast


Joined: 28 Jun 2003
Posts: 106
Location: Switzerland

PostPosted: Sun Jul 06, 2003 6:22 am    Post subject: Reply with quote

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
View user's profile Send private message
922
General User
General User


Joined: 02 Mar 2003
Posts: 6

PostPosted: Sun Jul 06, 2003 11:04 am    Post subject: Arrays Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Jul 07, 2003 10:51 am    Post subject: Draw Power Tools Reply with quote

openmind wrote:
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.


I'm glad you like it. I hope others find it useful both as a programming example, and for the tools themselves.

openmind wrote:

Very nice work which could be read as an intro in pragramming draw or as nice helpers to make thing done quicker

Thanks

I have written a tutorial document on my Turtle Graphics module. You can see it here.

http://kosh.datateamsys.com/~danny/OOo/OOoDocumentation

Another example program is here

http://kosh.datateamsys.com/~danny/OOo/Examples

A Maze Generator program for OOo is here (written in Java)

http://kosh.datateamsys.com/~danny/OOo/Java-OOo
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Jul 07, 2003 10:57 am    Post subject: Re: Arrays Reply with quote

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
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