Re: [Rcom-l] Counmarshalinterface and datetime once more

2008-11-02 Thread Prokaj Vilmos

Dear Thomas,

Sorry for the previous ''reply'', I pushed the send button by accident.  
Thanks for your  answer.  The  mktime problems are not serious and not 
urgent. As I wrote I started to play with this, because previously I had 
to do the transfer of dates using the value2 property of the cell, and 
it seemed to me that this not needed any more. Of course if finally this 
facility will be available, without the present limitation I will use it.  
Thanks for your work on the rcom/rscproxy package, they are very useful.


Best wishes
   Vilmos



Thomas Baier írta:

Dear Vilmos,

Prokaj Vilmos schrieb:
I downloaded the new version, thanks for incorporating the changes to 
the main stream. I still see a possible error in the bdx_com.c file, 
although it did not cause any problem to me. The other portion of the 
code using counmarshalinterface of windows api is the 
BDXGenericArray2Variant function, where you find


HRESULT lRc = CoUnmarshalInterface(lStream,&IID_IDispatch,
   (void*) 
V_DISPATCH(&lVariantArray[i]));


I'm afraid that the V_DISPATCH macro expands to
(&lVariantArray[i])->pDispVal
which is not what you possibly want, as you need here a pointer to
(lVariantArray[i])->pDispVal


You're absolutely right. Fortunately passing COM objects together with 
data values in a single arrays seems not to be used very often.



My other concern is the passing of datetime value from excel to R. I 
was very happy yesterday when I realised this possibility.

However it only works correctly for dates after
1970.01.01. . This could cause some unexpected error. Imagine that 
you test your application with dates after this epoch, and the user 
try to use it with a timeseries starting at 1902.


The problem is, that mktime() is only defined for dates after 1970-01-01.


I know that the reason is in the mktime function of windows. The 
datetime.c file of src/main/ directory in the source of R contains a 
patch to this function, named as mktime0, unfortunately this is not 
exported. So at the moment the only possible usage of this function 
is to copy all the required staff to your code, (this is not so 
long), but probably it is better to try to achieve that in the next 
release of R this function be exported, like many other convenience 
function.


I'll have a look into this. I'm in favour of re-implementing mktime0() 
in rscproxy (and sciproxy on the other hand).



The other problem is related to DST, if you write 1972.06.01 to the 
excel cell and call cell[["value"]] in R then you get

"1972-05-31 23:00:00 CET"
('cell' here is COMObject refering to the cell range). For a winter 
day you obtain the correct value of course. It is possible that this 
last problem is due to some setting of my machine and not related to 
your code, however I expected that I get the same value as I see in 
the excel

sheet.


This may be due to mktime(), too. Are the two mktime() problems very 
important for your current application (so the fix has to be put on 
CRAN very soon) or do we still have some time to wait for rscproxy to 
settle?


Thomas

___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at




--
Vilmos Prokaj
Eötvös Loránd University,
Department of Probability and Statistics
Pázmány Péter sétány 1/C
Budapest, 1117
Hungary

e-mail:[EMAIL PROTECTED] 


___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


Re: [Rcom-l] Counmarshalinterface and datetime once more

2008-11-02 Thread Prokaj Vilmos

Thomas Baier írta:

Dear Vilmos,

Prokaj Vilmos schrieb:
I downloaded the new version, thanks for incorporating the changes to 
the main stream. I still see a possible error in the bdx_com.c file, 
although it did not cause any problem to me. The other portion of the 
code using counmarshalinterface of windows api is the 
BDXGenericArray2Variant function, where you find


HRESULT lRc = CoUnmarshalInterface(lStream,&IID_IDispatch,
   (void*) 
V_DISPATCH(&lVariantArray[i]));


I'm afraid that the V_DISPATCH macro expands to
(&lVariantArray[i])->pDispVal
which is not what you possibly want, as you need here a pointer to
(lVariantArray[i])->pDispVal


You're absolutely right. Fortunately passing COM objects together with 
data values in a single arrays seems not to be used very often.



My other concern is the passing of datetime value from excel to R. I 
was very happy yesterday when I realised this possibility.

However it only works correctly for dates after
1970.01.01. . This could cause some unexpected error. Imagine that 
you test your application with dates after this epoch, and the user 
try to use it with a timeseries starting at 1902.


The problem is, that mktime() is only defined for dates after 1970-01-01.


I know that the reason is in the mktime function of windows. The 
datetime.c file of src/main/ directory in the source of R contains a 
patch to this function, named as mktime0, unfortunately this is not 
exported. So at the moment the only possible usage of this function 
is to copy all the required staff to your code, (this is not so 
long), but probably it is better to try to achieve that in the next 
release of R this function be exported, like many other convenience 
function.


I'll have a look into this. I'm in favour of re-implementing mktime0() 
in rscproxy (and sciproxy on the other hand).



The other problem is related to DST, if you write 1972.06.01 to the 
excel cell and call cell[["value"]] in R then you get

"1972-05-31 23:00:00 CET"
('cell' here is COMObject refering to the cell range). For a winter 
day you obtain the correct value of course. It is possible that this 
last problem is due to some setting of my machine and not related to 
your code, however I expected that I get the same value as I see in 
the excel

sheet.


This may be due to mktime(), too. Are the two mktime() problems very 
important for your current application (so the fix has to be put on 
CRAN very soon) or do we still have some time to wait for rscproxy to 
settle?


Thomas

___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at




--
Vilmos Prokaj
Eötvös Loránd University,
Department of Probability and Statistics
Pázmány Péter sétány 1/C
Budapest, 1117
Hungary

e-mail:[EMAIL PROTECTED] 


___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


Re: [Rcom-l] Counmarshalinterface and datetime once more

2008-11-02 Thread Thomas Baier

Dear Vilmos,

Prokaj Vilmos schrieb:
I downloaded the new version, thanks for incorporating the changes to 
the main stream. I still see a possible error in the bdx_com.c file, 
although it did not cause any problem to me. The other portion of the 
code using counmarshalinterface of windows api is the 
BDXGenericArray2Variant function, where you find


HRESULT lRc = CoUnmarshalInterface(lStream,&IID_IDispatch,
   (void*) 
V_DISPATCH(&lVariantArray[i]));


I'm afraid that the V_DISPATCH macro expands to
(&lVariantArray[i])->pDispVal
which is not what you possibly want, as you need here a pointer to
(lVariantArray[i])->pDispVal


You're absolutely right. Fortunately passing COM objects together with 
data values in a single arrays seems not to be used very often.



My other concern is the passing of datetime value from excel to R. I was 
very happy yesterday when I realised this possibility.

However it only works correctly for dates after
1970.01.01. . This could cause some unexpected error. Imagine that you 
test your application with dates after this epoch, and the user try to 
use it with a timeseries starting at 1902.


The problem is, that mktime() is only defined for dates after 1970-01-01.


I know that the reason is in the mktime function of windows. The 
datetime.c file of src/main/ directory in the source of R contains a 
patch to this function, named as mktime0, unfortunately this is not 
exported. So at the moment the only possible usage of this function is 
to copy all the required staff to your code, (this is not so long), but 
probably it is better to try to achieve that in the next release of R 
this function be exported, like many other convenience function.


I'll have a look into this. I'm in favour of re-implementing mktime0() 
in rscproxy (and sciproxy on the other hand).



The other problem is related to DST, if you write 1972.06.01 to the 
excel cell and call cell[["value"]] in R then you get

"1972-05-31 23:00:00 CET"
('cell' here is COMObject refering to the cell range). For a winter day 
you obtain the correct value of course. It is possible that this last 
problem is due to some setting of my machine and not related to your 
code, however I expected that I get the same value as I see in the excel

sheet.


This may be due to mktime(), too. Are the two mktime() problems very 
important for your current application (so the fix has to be put on CRAN 
very soon) or do we still have some time to wait for rscproxy to settle?


Thomas

___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at


[Rcom-l] Counmarshalinterface and datetime once more

2008-10-30 Thread Prokaj Vilmos

Dear Thomas,

I downloaded the new version, thanks for incorporating the changes to 
the main stream. I still see a possible error in the bdx_com.c file, 
although it did not cause any problem to me. The other portion of the 
code using counmarshalinterface of windows api is the 
BDXGenericArray2Variant function, where you find


HRESULT lRc = CoUnmarshalInterface(lStream,&IID_IDispatch,
   (void*)  
V_DISPATCH(&lVariantArray[i]));

I'm afraid that the V_DISPATCH macro expands to
(&lVariantArray[i])->pDispVal
which is not what you possibly want, as you need here a pointer to
(lVariantArray[i])->pDispVal

My other concern is the passing of datetime value from excel to R. I was 
very happy yesterday when I realised this possibility.

However it only works correctly for dates after
1970.01.01. . This could cause some unexpected error. Imagine that you 
test your application with dates after this epoch, and the user try to 
use it with a timeseries starting at 1902.


I know that the reason is in the mktime function of windows. The 
datetime.c file of src/main/ directory in the source of R contains a 
patch to this function, named as mktime0, unfortunately this is not 
exported. So at the moment the only possible usage of this function is 
to copy all the required staff to your code, (this is not so long), but 
probably it is better to try to achieve that in the next release of R 
this function be exported, like many other convenience function.


The other problem is related to DST, if you write 1972.06.01 to the 
excel cell and call cell[["value"]] in R then you get

"1972-05-31 23:00:00 CET"
('cell' here is COMObject refering to the cell range). For a winter day 
you obtain the correct value of course. It is possible that this last 
problem is due to some setting of my machine and not related to your 
code, however I expected that I get the same value as I see in the excel

sheet.

Best wishes
 Vilmos

--
Vilmos Prokaj
Eötvös Loránd University,
Department of Probability and Statistics
Pázmány Péter sétány 1/C
Budapest, 1117
Hungary

e-mail:[EMAIL PROTECTED]



___
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at