DirectPlay problem using DX8 
Author Message
 DirectPlay problem using DX8

Hi,

I'm getting an 'Automation error' on the following line of the code
below:

For GameNum = 0 To DP8LobbyClient.GetCountLocalPrograms(DP8_DP_PROVIDER)

I've tried various GUIDs to no avail and I cannot find any sample code
for 'DirectPlayLobbyClientCreate'.  The GUID above is for the TCP/IP
service provider.

Any help is appreciated.

Thanks,
Tom

------------------------------

' Constants
Const DP8_DP_PROVIDER = "{EBFE7BA0-628D-11D2-AE0F-006097B01411}"

' Variables
Public dx8 As DirectX8
Public DP8LobbyClient As DirectPlay8LobbyClient

Public Sub GetDirectPlay8Games()

    On Error GoTo HandleError

    Dim GameInfo As DPL_APPLICATION_INFO
    Dim GameNum As Integer
    Dim GameName As Integer

    ' Initialize DX8
    Set dx8 = New DirectX8
    Set DP8LobbyClient = dx8.DirectPlayLobbyClientCreate

    ' Get list of games
    For GameNum = 0 To
DP8LobbyClient.GetCountLocalPrograms(DP8_DP_PROVIDER)
        GameInfo = DP8LobbyClient.GetLocalProgram(GameNum)
        GameName = GameInfo.ApplicationName
    Next

    Exit Sub

HandleError:
    Call LogError("Error: occured in module GetDirectPlay8Games().
Error number: " & Err.Number & ",  Error Line: " & CStr(Erl) & ",
Description: " & Err.Description, True)
End Sub



Thu, 07 Jul 2005 04:56:39 GMT  
 DirectPlay problem using DX8


Quote:
> Hi,

> I'm getting an 'Automation error' on the following line of the code
> below:

What's the error code?


Fri, 08 Jul 2005 13:46:18 GMT  
 DirectPlay problem using DX8

Quote:



> > Hi,

> > I'm getting an 'Automation error' on the following line of the code
> > below:

> What's the error code?

Thanks for the reply!  The error code is: -2146073024.  And the error
description is: "Automation error".


Fri, 08 Jul 2005 22:28:45 GMT  
 DirectPlay problem using DX8



Quote:


> > > Hi,

> > > I'm getting an 'Automation error' on the following line of the
code
> > > below:

> > What's the error code?

> Thanks for the reply!  The error code is: -2146073024.  And the error
> description is: "Automation error".

That's DPNERR_UNINITIALIZED (which is, unfortunately, not in the error
lookup tool, so it's necessary to look through the DX C++ headers to
find it).  Your problem is that you have to call RegisterMessageHandler
to register a callback object before making any calls on your
DirectPlay8LobbyClient object.  I don't think that requirement is
actually documented anywhere, but you find out pretty quickly when you
don't do it.  The requirement is there regardless of whether the
function you call will actually result in use of your callback.


Sun, 10 Jul 2005 10:28:27 GMT  
 DirectPlay problem using DX8
Added the code and it works now.  Thanks a lot for your time Craig!
Quote:







> > > > Hi,

> > > > I'm getting an 'Automation error' on the following line of the
>  code
> > > > below:

> > > What's the error code?

> > Thanks for the reply!  The error code is: -2146073024.  And the error
> > description is: "Automation error".

> That's DPNERR_UNINITIALIZED (which is, unfortunately, not in the error
> lookup tool, so it's necessary to look through the DX C++ headers to
> find it).  Your problem is that you have to call RegisterMessageHandler
> to register a callback object before making any calls on your
> DirectPlay8LobbyClient object.  I don't think that requirement is
> actually documented anywhere, but you find out pretty quickly when you
> don't do it.  The requirement is there regardless of whether the
> function you call will actually result in use of your callback.



Mon, 11 Jul 2005 10:11:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. DX8 DirectPlay Problems

2. Some problems DX8.0-DX8.1

3. using both dx7 & dx8 type lib

4. Using TV Tuner cards with VB DX8

5. How to do a game like Starcraft/diablo II using dx8

6. Video on a texture using DX8 and VB

7. DirectX-DirectPlay Problems-

8. DirectPlay Problems (DX7)

9. Problems with DirectPlay Tutorial

10. DirectPlay Problem- Automation Error

11. Problem with DirectPlay

12. DirectPlay - Problem

 

 
Powered by phpBB® Forum Software