Results 1 to 17 of 17

Thread: DirectPlay and those annoying pop-up windows

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Hoopeston, IL
    Posts
    22

    Question DirectPlay and those annoying pop-up windows

    I need to know how to get DirectPlay 7 to search for a session over a TCP/IP connection without getting that pop-up box where the user can just press enter. I am writing full-screen appplications and that pop-up box is unacceptable. I have tried creating a DPAddress using the CreateINetAddress method with an empty address and a universal broadcast (255.255.255.255) address. but they don't work. Any ideas?

  2. #2
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    I searched for that thing for a long time too, and I did find it eventually, allowing my fullscreen game to display a list of sessions manually...

    I'm at work right now, but when I get home I'll search for it...
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  3. #3
    Lively Member ice & fire's Avatar
    Join Date
    Oct 2001
    Location
    Land of ice & fire
    Posts
    110
    Please man, i need that too! Please post, if you find it!

  4. #4
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    *is happy*

    yay! I just found it again! The biggest game I ever made, fullscreen DirectX with DirectPlay and textboxes and listboxes completely in DirectDraw and compressed bitmaps and a lot of more cool stuff which I've been creating in a period of two months, but I never got beyond the menu (selecting/creating sessions and chatting to other session members, completely with line-breaking and scrolling)

    *is still happy*



    *thinks*.... nah, I will not give away the complete source, but let's see if I can find the DirectPlay part....


    I guess I never found out how to enumerate the connections without the dialog, although I did however find what I needed: TCP/IP only connections without the dialog...


    VB Code:
    1. Public Sub InitDPTCPConnection(IP As String)
    2.     On Local Error GoTo Error:
    3.     If ErrSource <> "" Then Exit Sub
    4.    
    5.     ' Initialize DirectPlay TCP/IP connection
    6.     Set mDPAddress = mDPLobby.CreateINetAddress(IP, 0)
    7.     mDP.InitializeConnection mDPAddress
    8.     Exit Sub
    9.    
    10. Error:
    11.     ErrSource = "DX::InitDPTCPConnection"
    12.     ErrDesc = Err.Description
    13.     ErrNum = Err.Number
    14. End Sub


    Hope that helps a bit, if you need more code just let me know...
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  5. #5
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    Ah, I see you already got that far

    Anyways, after some research I found it: the function is called with an empty string to host a session, and is either called with the IP to connect to or an empty string when DirectPlay should search when joining a session...
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  6. #6
    Lively Member ice & fire's Avatar
    Join Date
    Oct 2001
    Location
    Land of ice & fire
    Posts
    110
    Um, äh.... It doesn´t want to take the IP. It want a DirectPlay8Adress Object... Thats bad...

    What can I do?

  7. #7
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    How about the two lines directly under the comment line in the source I posted above? That converts an IP to a DirectPlayAddress (my sample uses DirectX 7, but I think it should work on DX8 too)
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  8. #8
    Lively Member ice & fire's Avatar
    Join Date
    Oct 2001
    Location
    Land of ice & fire
    Posts
    110
    Well, it isn´t really CreateConnection...


    Look:

    VB Code:
    1. If Not (moDPP Is Nothing) Then
    2.             mlEnumAsync = moDPP.EnumHosts(Desc, Nothing, moDPA, INFINITE, 0, INFINITE, DPNENUMHOSTS_OKTOQUERYFORADDRESSING, ByVal 0&, 0)
    3.         ElseIf Not (moDPC Is Nothing) Then
    4.             mlEnumAsync = moDPC.EnumHosts(Desc, Nothing, moDPA, INFINITE, 0, INFINITE, DPNENUMHOSTS_OKTOQUERYFORADDRESSING, ByVal 0&, 0)
    5.         End If

    DPNENUMHOSTS_OKTOQUERYFORADDRESSING creates the Box.
    The NOTHING (after Desc) is the DirectPlay8AdressObject....


    I need to Assign an IP to my DirectPlay8AdressObject


    But how?

  9. #9
    Lively Member ice & fire's Avatar
    Join Date
    Oct 2001
    Location
    Land of ice & fire
    Posts
    110
    Besides, it has no CreateINetAddress() Function. Only a Build from URL, that takes no IP as Parameter, but a directplay string...

  10. #10
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    In that case: I don't have a clue.

    I've never used DX8 (hated it actually), I haven't used DirectPlay that much (twice, only once without the dialog box) and it's been a year since I even started Visual Basic...

    Try http://www.vbexplorer.com/directx4vb/
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  11. #11
    Lively Member ice & fire's Avatar
    Join Date
    Oct 2001
    Location
    Land of ice & fire
    Posts
    110
    GREAT!

    Well, no problem. I WILL find out.
    My Game works, it worked without DirectPlay, now with it and that ugly DialogBox will get grilled.

    BTW: If you make a game, NEVER start with the menu! Or the Graphics! (I did more than 10 times!)

    This time I started the game on paper. How it should work and everything.
    Now I have an engine, that actually is a game. It has no Graphics, but you can play it.And the Engine gives the correct Infos for DirectDraw / D3D.
    I only need to make my Graphics Engine Ready (About 1/2 of it already works) and my game is completed. (Well, THEN i need to make the menus, they are only ugly msgboxes and text-fields at the moment)

    Bye and thanks,
    ALex

  12. #12
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    Well, basically, I already had a game. This was version 2. Version 1 had a settings dialog which was just a normal window, and the game would be fullscreen DirectX
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Hoopeston, IL
    Posts
    22
    Thanks, PsychoMark, but I already have that part. I can connect to a TCP/IP address that the user enters, but I need to be able to search the local subnet for an unknown address like the dialog box does if you just hit enter.

    Also, I, too, hated DX8. Especially the way that Direct3D and DirectDraw became so integrated. Oh well, Microsoft does as it sees fit.

    Thanks again for the help.

  14. #14
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    Well, in my case it would either search the specified IP for sessions, or (if no IP was entered) it would search our LAN.


    Since I don't use VB anymore (thus I won't finish it anyways), I've decided I won't mind it becoming opensource, as I think it's a great learning source for fullscreen user input. If anyone's interested, leave a message and I'll upload it to my webserver...


    [edit]
    If you hate DX8, why do you use it? I still used DX7 after I had installed DX8 on my computer, no problem at all, still supported. I think DX7 is easier, especially with DirectDraw being seperated, so why do it the hard way?
    [/edit]
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  15. #15

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Hoopeston, IL
    Posts
    22
    Actually, I do still use DX7. I tried DX8, but because of the problems outlined above, I went back to DX7. I do have DX8.1 installed, but I don't use it to develop, yet. Once I move into 3D, then I think it will probably be great.

    Thanks for posting the code. I will check it out.

  16. #16
    Lively Member ice & fire's Avatar
    Join Date
    Oct 2001
    Location
    Land of ice & fire
    Posts
    110
    THX!!!!!!!!!!!!!!!!!!!

    BTW: Happy new year!

  17. #17
    Lively Member ice & fire's Avatar
    Join Date
    Oct 2001
    Location
    Land of ice & fire
    Posts
    110
    Dim Desc As DPN_APPLICATION_DESC
    Desc.guidApplication = msGuid
    moDPA.AddComponentString DPN_KEY_HOSTNAME, "IP OR HOSTNAME GOES HERE "
    If Not (moDPP Is Nothing) Then
    mlEnumAsync = moDPP.EnumHosts(Desc, moDPA, moDPA, INFINITE, 0, INFINITE, DPNENUMHOSTS_OKTOQUERYFORADDRESSING, ByVal 0&, 0)
    ElseIf Not (moDPC Is Nothing) Then
    mlEnumAsync = moDPC.EnumHosts(Desc, moDPA, moDPA, INFINITE, 0, INFINITE, DPNENUMHOSTS_OKTOQUERYFORADDRESSING, ByVal 0&, 0)
    End If



    This solves the Problem under DX 8.1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width