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

pure function virtual cal

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


Joined: 01 Nov 2008
Posts: 20

PostPosted: Thu Nov 20, 2008 8:40 pm    Post subject: pure function virtual cal Reply with quote

At closing OpenOffice appear error "pure function virtual cal".
How dispose of from alike error, use Openoffice 2.4, Windows XP, Visual Studio 2005.
Document OpenOffice forming programm on language C#.
Code:

tServiceManager = Type.GetTypeFromProgID("com.sun.star.ServiceManager");
                    Object hidden;
                    oServiceManager = System.Activator.CreateInstance(tServiceManager);

                    // arguments for IDispatch-call
                    Object[] parameters = new Object[1];
                    parameters[0] = "com.sun.star.frame.Desktop";

                    // Preparing arguments for hidden-mode
                    Object[] PropertyValue = { "com.sun.star.beans.PropertyValue" };
                    Object[] name = { "AsTemplate" };
                    Object[] val = { true };

                    hidden = (Object)tServiceManager.InvokeMember("Bridge_GetStruct",
                       BindingFlags.InvokeMethod, null,
                       oServiceManager, PropertyValue);
                    hidden.GetType().InvokeMember("Name", BindingFlags.SetProperty, null, hidden, name);
                    hidden.GetType().InvokeMember("Value", BindingFlags.SetProperty, null, hidden, val);
                    //=====================================================================================
                    Object hidden1;
                    Object[] PropertyValue1 = { "com.sun.star.beans.PropertyValue" };
                    Object[] name1 = { "Hidden" };
                    Object[] val1 = { true };
                    hidden1 = (Object)tServiceManager.InvokeMember("Bridge_GetStruct",
                       BindingFlags.InvokeMethod, null,
                       oServiceManager, PropertyValue);
                    hidden1.GetType().InvokeMember("Name", BindingFlags.SetProperty, null, hidden1, name1);
                    hidden1.GetType().InvokeMember("Value", BindingFlags.SetProperty, null, hidden1, val1);

                    // arguments for your file
                    oDesktop = (Object)tServiceManager.InvokeMember("createInstance",
                          BindingFlags.InvokeMethod, null,
                          oServiceManager, parameters);
                    //=============================================================================================================================
                    //Invoke(oServiceManager, "createinstance", BindingFlags.InvokeMethod, "com.sun.star.frame.Desktop");

                        Object[] args = new Object[4];
                        arg[0] = "private:factory/swriter";
                        arg[1] = "_blank";
                        arg[2] = 0;
                        arg[3] = new Object[] { hidden1 };
                        // arg = new Object[0];
                        oComponent = oDesktop.GetType().InvokeMember  ("loadComponentFromUrl",
                          BindingFlags.InvokeMethod, null,
                          oDesktop, arg);
                        oText = Invoke(oComponent, "getText", BindingFlags.InvokeMethod, null);

if you can't help me, than help make event on close OpenOffice wih help Openoffice,
Back to top
View user's profile Send private message
lexus56
General User
General User


Joined: 01 Nov 2008
Posts: 20

PostPosted: Sun Nov 23, 2008 9:14 pm    Post subject: Reply with quote

Signaly, what error get from close openoffice for help dagger, for use menu File-> Close openoffice less error .
By means of resulted below the text, I carry out a text conclusion in word
Code:

AIS.wrd c = new AIS.wrd(null);
Object found =null;
  c.write(ref found,"jjkjfkjg");
  public void write(ref object found, string txt)
            {
                     if (found == null)
                        {
                            arg = new Object[0];
                            found = Invoke(oText, "CreateTextCursor", BindingFlags.InvokeMethod, arg);
                        }
                        arg = new Object[0];
                        arg = new Object[1];
                        arg[0] = 2;
                        Invoke(found, "ParaAdjust", BindingFlags.SetProperty, arg);
                        arg = new Object[1];
                        arg[0] = 100;
                        Invoke(found, "CharWeight", BindingFlags.SetProperty, arg);
                        arg = new Object[1];
                        arg[0] = 12;
                        Invoke(found, "CharHeight", BindingFlags.SetProperty, arg);
                        arg = new Object[1];
                        arg[0] = "Times New Roman";
                        Invoke(found, "CharFontName", BindingFlags.SetProperty, arg);
                        arg = new Object[1];
                        arg[0] = txt;
                        Invoke(found, "setString", BindingFlags.InvokeMethod, arg);
                        arg = new Object[2];
                        arg[0] = txt.Length;
                        arg[1] = true;
                        Invoke(found, "goRight", BindingFlags.InvokeMethod, arg);
           }
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