• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1400
  • Last Modified:

VB and DirectPlay (DirectX)

I have created a program in VB 6 that uses DirectPlay, a component of DirectX, to communicate over a network. This is done by creating an instance of the DirectX7 object.
Since I am using Windows NT I have downloaded the DirectPlay 6.1A exe file and run it.

The problem arises when I try to run my VB program it says that it can't find the DirectX7 object.
HOW DO I MAKE VB AWARE OF THE DIRECTPLAY FILES?
0
pyromyst
Asked:
pyromyst
  • 7
  • 6
  • 2
1 Solution
 
pjknibbsCommented:
Two points:

1) I'm not at all sure that DirectX 7 can be installed on NT.

2) Even if it can, are you sure running DirectPlay 6.1 actually installs DirectX 7? It might just install the DirectPlay components.
0
 
GordonpCommented:
Windows NT only supports DirectX 3 and only if you have Service Pack 3 or higher.

You can download a directX typelibrary for DirectX 3 which does have a version of DirectPlay from http://www.chez.com/scribe/

Gordon
0
 
pyromystAuthor Commented:
I am aware of the fact that Windows NT doesn't support DirectX directly.

However, the files I downloaded (DirectPlay 6.1a) from http://msdn.microsoft.com/directx/ were specifically for developers using Windows NT.
All I need to know is how to get VB 6 to give me a reference to the DirectX object, and thus use DirectPlay.
I have to use the DirectPlay 6.1 component because all previous versions of DirectX could only be used from C++.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
pjknibbsCommented:
Is the DirectPlay library listed in the dialog you get when you select Project|Components from the menu?
0
 
GordonpCommented:
DirectX 7 was the first DirectX with native support for VB.

If you go to the address I gave above they also have a typelib for DirectX 6 which should I assume contain the references for DirectPlay6.1a.

If not you'll have to look at the .h files provided with the Microsoft Download and translate them into Declare statements.

Gordon
0
 
pyromystAuthor Commented:
Firstly let me apologise for taking so long with answering your comments.

I have checked in the components menu and it doesn't appear there. That is what I am trying to find out about. What do I need to do in order to get the DirectX object to appear in the components menu?

Gordonp, what do you mean by "translate them into Declare statements"? And how do I do that?

Thanks for your help.
0
 
GordonpCommented:
> Gordonp, what do you mean by "translate them into Declare statements"? And how do I do that?

Look at the .h files

if a function is declared in there as

void DirectPlayCreate(HWND hWnd, char* param)

then you could translate that to

Declare Sub DirectPlayCreate Lib "<DllNameHere>" (Byval hWnd as Long,ByRef Param as String)

for example.

I'd still recomend downloading the typelibs from http://members.xoom.com/vba51/downloads/directx.zip

the directX 6 typelib is the one to try.

GordonP
0
 
pyromystAuthor Commented:
GordonP,

I tried as you suggested. I downloaded the directX 6 typelib, but much as I expected it didn't work. VB only supports DirectX from version 7. What I need to try then is the directx7 typelib, but I can't find it.
0
 
GordonpCommented:
You can use any version of DirectX from VB.

DirectX 7 was the first to actually provide a native VB interface, for all previous versions you have to use either a typelib like the one I asked to you to download or manually
Declare every directX Dll call you require.

I'm using the DirectX 3 typelib perfectly well on my NT machine.

What went wrong when you tried to use the DirectX 6 typelib. Its possible that this typelib isnt compatabile with the DirectPlay 6.1A you downloaded as this was a special bit on the side for NT thing.

Your other option is to pick out the function calls you require and translate them into Declare statements

If you choose to go this way I can give you some basic help on the translation from C declaration to VB Declare.

Gordon
0
 
GordonpCommented:
If the version of DirectPlay which came with DirectX3 is good enough then use that typelib. I've used it many times although only for directSound not DirectPlay but it works all the same.

As I said any version of DirectX can be used from VB, its just DX7 was the first to provide a built in VB interface.

Gordon
0
 
GordonpCommented:
Hi there, did you ever get DirectPlay to work on your NT machine with VB.

0
 
pyromystAuthor Commented:
Hi Gordonp,

I did as you said with the typelib files and I was able to get VB to detect them.
I still have to learn how to use the typelib files though.

I really appreciate all the effort you put into helping me. I am sorry that I forgot about this for a while with completing my final year project.

PyroMyst
0
 
pyromystAuthor Commented:
Adjusted points from 100 to 200
0
 
pyromystAuthor Commented:
Gordonp was extremely patient with me and I thank him for it.
0
 
GordonpCommented:
If you need any further help with this just post a comment here. I'll keep monitoring for a while just in case.

Gordon
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 7
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now