[R] R (D)COM automation server for windows, type mismatch?

Thilo Engelskircher Thilo.Engelskircher at gmx.de
Sun Aug 12 22:06:23 CEST 2001


Hello!

I just started experimenting with the (D)COM automation server for R
(server version 0.99, R 1.3.0, Win NT)

All the precompiled sample executables work.

When I write programms myself, in this case Visual Basic for Applications
within Excel, I can attach a graphics device but not a character device.


The controls I added to the form by means of the 'toolbox' both originate
from the client library (see below) and are named 
'Gfx1'    (of type StatConnectorGraphicsDevice) and 
'CharDev' (of type StatConnectorCharacterDevice)

The code fragment working with them is:

	Dim x As StatConnector
	Dim gfxdev As ISGFX

	Set x = New StatConnector
	x.Init ("R")

	Set gfxdev = Gfx1.GetGFX
	x.AddGraphicsDevice "dev1", gfxdev   ' <- this works

	x.SetCharacterOutputDevice CharDev   ' <- this does not

VBA stops with a type mismatch error.
Unfortunately this is consistent with what I can see in the object browser
tree:
The method SetCharacterOutputDevice requires an
IStatConnectorCharacterDevice but I only have an can get a StatConnectorCharacterDevice. (Where as for
AddGraphicsDevice I can get an ISGFX by means of the function GetGFX)


Where is the mistake?
Any hints?

Thanks, Thilo.

---

>From the Object Browser:
---------------------------------------------------------------

Library STATCONNECTORCLNTLib
...\rw1030\bin\StatConnectorClnt.dll

ISGFX:
    ...

StatConnectorCharacterDevice:
    Clear()
    WriteString(bstrLine As String)
    WriteStringLevel(bstrLine As String, lLevel As Long)

StatConnectorGraphicsDevice:
    BackColor As OLE_COLOR
    ...
*   GetGFX() As ISGFX
    
---------------------------------------------------------------

Library STATCONNECTORSRVLib
...\rw1030\bin\StatConnectorSrv.exe

ISGFX:
    ...

IStatConnectorCharacterDevice:
    Clear()
    WriteString(bstrLine As String)
    WriteStringLevel(bstrLine As String, lLevel As Long)

IStatConnectorUIAgent:
    ...

StatConnector:
    Init(bstrConnectorName As String)
*   AddGraphicsDevice(bstrName As String, pDevice As ISGFX)
*   SetCharacterOutputDevice(pCharDevice As IStatConnectorCharacterDevice)
    ...
    Close()
    

-- 
Aufgepasst - jetzt viele 1&1 New WebHosting Pakete ohne
Einrichtungsgebuehr + 1 Monat Grundgebuehrbefreiung!
http://puretec.de/index.html?ac=OM.PU.PU003K00736T0492a

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list