Thilo Engelskircher
2001-Aug-12 20:06 UTC
[R] R (D)COM automation server for windows, type mismatch?
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Erich Neuwirth
2001-Aug-14 07:10 UTC
[R] R (D)COM automation server for windows, type mismatch?
the interface is just undergoing some architectural changes. what you are using is only experimental and will be fully available int the next version. the device of both character and graphics devices at the moment is somewhat experimental and will be documented much better in the next release. Thilo Engelskircher wrote:> > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-- Erich Neuwirth, Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-38624 Fax: +43-1-4277-9386 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._