Solved

VB and DirectPlay (DirectX)

Posted on 2000-02-25
15
1,359 Views
Last Modified: 2008-02-20
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
Comment
Question by:pyromyst
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 2
15 Comments
 
LVL 12

Expert Comment

by:pjknibbs
ID: 2558153
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
 
LVL 3

Expert Comment

by:Gordonp
ID: 2564104
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
 
LVL 1

Author Comment

by:pyromyst
ID: 2576588
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:pjknibbs
ID: 2576647
Is the DirectPlay library listed in the dialog you get when you select Project|Components from the menu?
0
 
LVL 3

Expert Comment

by:Gordonp
ID: 2579243
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
 
LVL 1

Author Comment

by:pyromyst
ID: 2595571
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
 
LVL 3

Expert Comment

by:Gordonp
ID: 2603651
> 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
 
LVL 1

Author Comment

by:pyromyst
ID: 2623873
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
 
LVL 3

Expert Comment

by:Gordonp
ID: 2624016
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
 
LVL 3

Accepted Solution

by:
Gordonp earned 200 total points
ID: 2624040
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
 
LVL 3

Expert Comment

by:Gordonp
ID: 2788314
Hi there, did you ever get DirectPlay to work on your NT machine with VB.

0
 
LVL 1

Author Comment

by:pyromyst
ID: 2789859
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
 
LVL 1

Author Comment

by:pyromyst
ID: 2789868
Adjusted points from 100 to 200
0
 
LVL 1

Author Comment

by:pyromyst
ID: 2789869
Gordonp was extremely patient with me and I thank him for it.
0
 
LVL 3

Expert Comment

by:Gordonp
ID: 2791443
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question