cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Server {Converting Console App to .Net Windows Service)

Former Member
0 Kudos

I have created a console app which is working correclty as a RFC server. I want to convert it to a Windows Service.

I'm getting error: Object Not Set To and Instance of an Object

Dim myargs() As String

Try

ReDim myargs(3)

EventLog1.WriteEntry(UBound(myargs))

myargs(0) = "-aPJ1.rfcserv"

myargs(1) = "-gsap008.myserver.com"

myargs(2) = "-xSAPGW08"

Catch ex As Exception

EventLog1.WriteEntry(ex.Message)

End Try

Const numberOfServers As Integer = 3

Dim host As SAP.Connector.SAPServerHost

host = New SAP.Connector.SAPServerHost

Dim server As SAPProxyDllImpl

For I As Integer = 1 To numberOfServers

Try

'ERROR OCCURRING WITH THIS

server = New SAPProxyDllImpl(myargs, host)

Catch ex As Exception

EventLog1.WriteEntry(ex.Message)

End Try

Next

Any Ideas are appreciated.

Is there any documentation for creating a Windows Service as an RFC Server?

Philip

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks.. I looked at it too long yesterday. Your correction worked.

Philip

Former Member
0 Kudos

Hi,

Array myargs(3) has 4 elements but only the first 3 are initialized with a valid string.

Regards,

Guangwei Li

reiner_hille-doering
Active Contributor
0 Kudos

It would be easier to find the reason of the problem if you write the whole call stack to event log:

EventLog1.WriteEntry(ex.ToString())