Re: Help needed for building SDK samples in Visual Studio 2010

2012-12-13 Thread jg

Shukla:

I am currently working on a project that generates documents from a 
database (user variables, text marks, tables, and some formatting, i.e. 
standard stuff) using UNO C++ from inside an MFC application. I did not 
find any difficulties and the docs pretty much explain anything you 
need, but there are no prepared Visual Studio solutions. You should get 
the bootstrap example to work, then the rest is pretty much 
self-explanatory. I am using Visual Studio 2012, but I doubt that VS2010 
behaves differently.


If there is sufficient interest, I could write a small Visual Studio 
centric HowTo, but right now I am pretty busy with my own project.


Here are a few pointers:

(1) Some C++ headers declare symbols that clash with internal symbols of 
cl. There are quite a few ways around this problem, without recompiling 
the UNO libs.
(2) Implement the Java examples from the Developer's Guide in C++. There 
is a 1 to 1 mapping from Java (and UNO) to C++ language constructs and 
this is well documented. While learning, I found it very useful to 
benefit from the better documented Java interface (with Javadocs).
(3) Be consistent with character encodings. For external sources I use 
UTF-8 exclusively which is easy to map to the UNO C++ string 
representation using WideCharToMultiByte() and MultiByteToWideChar().
(4) As long as you use the UNO libraries from the distribution package, 
you cannot build native 64bit applications.


MFC specific:
(1) The current bootstrap code is very general and hardly requires any 
configuration, but I don't like the flashing console window. I put more 
or less the equivalent stuff into InitInstance() and ExitInstance() of 
the application object to avoid starting with a separate app.
(2) Any data processing is done inside OnIdle() in my project. A 
separate thread should also be easy to implement.
(3) Some operations (e.g. tables with computed values) require a short 
waiting period, or some values are not initially updated inside the 
resulting OpenOffice document.  I haven't had the time to look at the 
UNO source code to find why you need a waiting period here and there. 
The occasional waiting period is also required for console applications.


I hope this helps a a bit.

jg


Re: Help needed for building SDK samples in Visual Studio 2010

2012-12-14 Thread jg

http://wiki.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide

jg


Re: Need help in getting the design right with Openoffice.org

2012-12-20 Thread jg

Mangesh:

I don't know in what way your application needs differ from mine in 
detail. In my case, the bulk of the work is done by my MFC application. 
Once the data are "inside" of OpenOffice the feedback to the MFC app is 
not very complex and essentially only a couple of database entries need 
to get written to or updated. I can do this quite comfortably with OO 
Basic, which also handles some special menus.


Depending on how your application and OO are coupled, this might not be 
a workable way.


One more thing; if your application is part of your job it could make 
sense to buy the necessary expertise. Either to get started with UNO 
C++, which also would yield a base of working code, or to help with the 
project, too (I'd say, once you are comfortable with the UNO specific 
things, this should hardly be necessary). It's just a matter of what is 
more expensive, because you potentially need to spend more time working 
out the details when you are on your own. I am sure that there are 
enough experts out there, who are able to offer professional help.


jg


Re: OpenOffice plugin for NetBeans 7.2?

2013-01-13 Thread jg
It worked basically for me. I used NetBeans 7.2.1 together with the the 
3.0.0.beta version of the NetBeans plugin to study the UNO API before 
continuing with C++. I did not encounter any problems while running any 
playing with the various Java examples.


jg


Re: Regarding MSVCR80.dll

2013-01-25 Thread jg
Why can't you stay with Visual Studio 2012 and install the associated 
Visual Studio 2012 runtime libraries 
(http://www.microsoft.com/en-us/download/details.aspx?id=30679) on the 
other Windows targets?


If I remember correctly, MSVCR80.dll belongs to VS2005. So in case you 
build different versions of your module using VS2012 and VS2005 you need 
to have both associated runtime libraries installed.


--

jg



Re: Regarding MSVCR80.dll

2013-01-25 Thread jg
Forget about Mac and Linux for a moment, since you already  seem to have 
problems on Windows.


It looks as if your makefile is incorrect about some dependencies. You 
might also check that the manifest of the project has been set up 
properly 
(http://msdn.microsoft.com/en-us/library/ms235542%28v=vs.110%29.aspx), 
although a manifest is not strictly required in your case. When you 
build your project from within VS you don't have to worry about this.


It is probably not a good idea to simply compile and link your project 
using a hand written makefile, because different platforms might need 
other tools as well (like the manifest tool to bind the executable code 
to the proper runtime libs) and you probably end up doing a lot of OS 
dependent dispatching inside the makefile. Consider generating your 
build environment with cmake (www.cmake.org).


jg




Re: UNO API

2013-04-02 Thread jg
A couple of weeks ago I had a UNO project that required using Visual 
Studio/MFC. Despite the fact that there not a lot of information about 
this setup, Visual Studio (2012 in my case) works nicely with the UNO 
API. I did not read the old docs Alexandro Colorado referred to in the 
other reply.


To get started I would suggest the following steps:

(1) Download and install Java/Netbeans/OO Plugin to learn NO using Java.
(2) Then go to C++. There is a simple mapping from the Java to C++ syntax.
(3) Decide whether you want to support the current method of 
bootstrapping (you don't have to).


The old message 
http://markmail.org/message/gzzv3we42b36aavn?q=list:org%2Eapache%2Eincubator%2Eooo-api+from:%22jg%22&page=1 
has some more details on what to look for.


jg

-
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org



Re: uno api problem

2013-04-06 Thread jg

This might also work:

xPropertySet->setPropertyValue(L"CharFontName", makeAny(OUString((const 
sal_Unicode *)L"Corbel")));


Or, if the value is not a constant (MFC):

CStringW value;
...
OUString value((const sal_Unicode *)((LPCWSTR)value));
xPropertySet->setPropertyValue(L"CharFontName", Any(value));



jg

-
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org



Re: UNO API

2013-04-18 Thread jg

Maybe this helps a bit:

(1) Get access to known types (here only currency and date):
...
// Query the number formats supplier of the writer document
Reference < XNumberFormatsSupplier > 
xNumberFormatsSupplier(xTemplateComponent, UNO_QUERY_THROW);
Reference < XNumberFormats > xNumberFormats = 
xNumberFormatsSupplier->getNumberFormats();

// Query the XNumberFormatTypes interface
Reference < XNumberFormatTypes > xNumberFormatTypes(xNumberFormats, 
UNO_QUERY_THROW);
// Get the number format index key of the default currency format, note 
the empty locale for default locale

Locale aLocale;
m_nCurrencyKey = 
xNumberFormatTypes->getStandardFormat(com::sun::star::util::NumberFormat::CURRENCY, 
aLocale);
m_nDateKey = 
xNumberFormatTypes->getStandardFormat(com::sun::star::util::NumberFormat::DATE, 
aLocale);



(2) Later: set the cell properties:
...
switch (dataType) {
case UnoDataType::CurrencyType:
xCellProps->setPropertyValue(L"NumberFormat", 
Any((sal_Int32)m_nCurrencyKey));
xCellCursorProps->setPropertyValue(L"ParaAdjust", 
Any(com::sun::star::style::ParagraphAdjust_RIGHT));

break;
...
}

I am working with a table inside a writer document, but the spreadsheet 
shouldn't differ a lot.


Yes, I do know that this may not be portable, but the rest of the MFC 
sources isn't either :)


jg

-
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org



Re: EXTERNAL: Re: soffice process still running

2013-05-07 Thread jg
You can dispose the component in question 
(http://www.openoffice.org/api/docs/common/ref/com/sun/star/lang/XComponent.html).


jg

-
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org



Re: convert rtl::OUString to char *

2013-09-24 Thread jg
WideCharToMultiByte() indicates that you are working on Windows. At first you need to convert to 
UTF16 (from UTF8), and then from UTF16 to the desired code page.


Have a look at 
http://code.msdn.microsoft.com/C-UTF-8-Conversion-Helpers-22c0a664 .

jg




Re: convert rtl::OUString to char *

2013-09-24 Thread jg

WideCharToMultiByte() indicates that you are working on Windows. At first you 
need to convert to UTF16 (from UTF8), and then from UTF16 to the desired code 
page.

Have a look at 
http://code.msdn.microsoft.com/C-UTF-8-Conversion-Helpers-22c0a664 .

jg



-
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org