Solved

VB and DirectPlay (DirectX)

Posted on 2000-02-25
15
1,338 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
  • 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now