Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi! I'm rather new to .Net, but not new to programming. I'm working on developing a web service that references a 3rd party DLL. The 3rd party has supplied both a win32 DLL and a .Net Binding (which includes a DLL written in C#). I added the C# DLL (.Net Binding) to the References of the web service. It shows up under the References folder, and I can browse all the functions, methods and members of the DLL. The problem comes in when I call a DLL function which takes a parameter of "type" defined by the DLL itself, and shown in a sample provided with the component. This seems strange. You would assume that if you are using a value specified by the binding in a call to a function defined by the binding, you shouldn't have any problem, but instead, I get the following error:

 

C:\iis\gcp\Service1.asmx.vb(80): Value of type 'Short' cannot be converted to 'GameStat.GameType'.

 

The value of parameter (GameStat.GameType.UnrealTournament2004) is an integer, but the DLL declares this of the type "type". I thought that maybe I'm missing some extra step that I need to do to get the web service to recognize this as it's defined type, but I don't know where to look. Here's a sample of my code:

 

Imports System.Web.Services
Imports GameStat

<System.Web.Services.WebService(Namespace:="http://localhost/gcp/gcp")> _
Public Class Primes
   Inherits System.Web.Services.WebService

'
' generic .Net code replaced for brevity...
'
   <WebMethod()> _
   Public Function GetServerInfo(ByVal Host As String) As String

       'Dim gs As GameStat
       Dim gsInfo As GameStat.ServerInfo

       gsInfo = GameStat.ServerInfo.Query(GameType.UnrealTournament2004, Host)

       GetServerInfo = gsInfo.Map

   End Function

End Class

 

The DLL and .Net Bindings can be found at http://www.int64.org/gamestat.html

 

Any ideas? Thanks!

  • 2 weeks later...
  • Leaders
Posted

The function takes these parameters?

 

GameStat.ServerInfo.Query(System.Type, String)

 

Or

 

GameStat.ServerInfo.Query(GameStat.GameType, String)

[sIGPIC]e[/sIGPIC]
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...