|
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
NathanW
Joined: 05 Feb 2009 Posts: 51 Country: United Kingdom |
|
Call COM from VB.NET |
|
I am using the COM interface from VB6 and all is great but I cant for the life of me work out how to call it from VB.NET.
Can anyone give me an example of how to do this.
Thanks.
|
|
Mon Mar 23, 2009 6:34 am |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
|
|
Visual Basic.NET includes an upgrade tool to assist in converting VB6 projects to .NET. If you already have working VB code, please try using this tool to move it to VB.NET. If the converted code doesn't work, please post the converted code and we can try together to refine it and make it work in VB.NET.
|
|
Mon Mar 23, 2009 8:52 am |
|
|
NathanW
Joined: 05 Feb 2009 Posts: 51 Country: United Kingdom |
|
|
|
Ok I have tried to use the convert in VB.net and have to say it didnt really help but after some digging around I have found how to call 24x7 from .NET. It is very important that you use w24x7ASP.vbRemote24x7 and not 24x7 Remote Control otherwise you will get a load of method errors. It is interesting to note that calling 24x7 from .NET is much quicker than calling from ASP Classic. Hope the same code below is helpful.
Dim RC As Object
Dim Remote_24x7 As Object
Dim buffer as String
Remote_24x7 = CreateObject("w24x7ASP.vbRemote24x7")
rem 24x7 Remote Control
RC = Remote_24x7.OpenSession("", "12345-1234567-12345", "WinSock", "127.0.0.1", "1096", "", False)
If RC <> 1 Then
Response.Write("Error: " & Remote_24x7.LastError)
Else
RC = Remote_24x7.GetJobList( buffer, True )
Response.Write(buffer)
End If
RC = Remote_24x7.CloseSession()
Remote_24x7 = Nothing
|
|
Tue Mar 24, 2009 12:16 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
|
|
Thanks for sharing the knowledge.
There are several different yet related COM interfaces. the "24x7 Remote Control" one is an old one legacy interface and it has several file dependencies which is probably why you could not easily load it in easily .NET. Some dependencies files may need to be moved to the system folders in order for the NET to be able to load them.
In comparison, w24x7ASP.vbRemote24x7 and 24x7ASP.jsRemote24x7 are light-weight interfaces with fewer file dependencies and they should load much faster.
|
|
Tue Mar 24, 2009 1:28 pm |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|