Version 2.0!
Features
Tutorials
Files
Glossary
Projects
Contact
Links
Message Board
Extras
LuckyCam
Old News
Sign Guestbook
View Guestbook
VB Horoscope
VB Photo Album
.
ATTENTION READERS! Lucky's VB Gaming Site is no longer active. For updated game programming information and tutorials, please visit The Game Programming Wiki!

Termination

As with all things to do with DirectX, it's always good practice to set your objects to "Nothing" before you end your program. Also, you should try to destroy them in order, from the most recently created to the last. This should remove any chance of errors arising during your termination steps.

    Set objEnumSessions = Nothing
    Set objEnumConnections = Nothing
    Set dp = Nothing

These are the three objects that must persist at the module level (rather than the procedure level) as you'll see when you look at the NetPONG source. The first created was the DirectPlay4 object, so we'll blow it up last. I'm sure you get the picture.

You are now a Master of DirectPlay, just as He-Man was Master of the Universe.. Ok, not quite yet, but if you mess with the source code I'm you'll get the hang of it pretty quickly! "By the power of DirectX, I.. HAVE.. THE POWER!"

(click here to download this tutorial's source code)