Solved

Calling Rasapi32.dll functions?

Posted on 1998-07-15
4
555 Views
Last Modified: 2012-06-21
Hi...
I have problem calling ANY function from Rasapi32.dll
in win95/98...
I'm not shure I do it right...
This can't be a problem for an expert...so
if anyone please could help me out with this one...
I would be very greatfull if I had a
source-example...
The main functions I need are: Ras...
- ...Dialup
- ...Hangup
- ...Connected or not

Please help me....Thank you masters of source!
0
Comment
Question by:bobban
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
khaledc earned 100 total points
ID: 1465893
To use a function from a DLL file, first you have to insert a Module in your project (if you don't have one already), in the module decleration  section you have to delclare your function or sub, for example:
Declare function Hangup Lib "C:\Windows\system\Rasapi32.dll" () as long
(The above delcleration is only an example and it may have more to it)
Usually, there is a text file associated with the DLL that you can open with the "API Text Viewer" program that comes with VB. (If you are not sure, it is in the same folder as Visual Basic Program). When opening this text file with "API Text Viewer", you can copy all the decleration needed for your program into the module, also it will gives you any constants needed for your functions.
For more information, look for "Declare Statement" under VB help, or you can give me a yell.


0
 
LVL 4

Expert Comment

by:yowkee
ID: 1465894
bobban,

   Please refer to MS kb article Q150948. And D/L sample from Microsoft:

http://support.microsoft.com/support/kb/articles/q150/9/48.asp
http://support.microsoft.com/download/support/mslfiles/Vb32ras.exe (This sample should contain the example you need)

   If this sample suit your need, please reject current answer and let me lock the answer.

   Regards.

http://support.microsoft.com/support/kb/articles/q150/9/48.asp
0
 
LVL 1

Expert Comment

by:khaledc
ID: 1465895
yowkee,
It is nice and ethical from your side to offer your help in this manner.
Try to be more sensible in your approach the next time you offer your services.

0
 

Author Comment

by:bobban
ID: 1465896
thanks khaledc, but I did'nt found that txt-file you told about.
But I've found out these three declares but don't know how to use them, what constants to use or how I get those constants...

1) Dial:

Public Declare Function RasDial Lib "RasApi32.DLL" Alias "RasDialA" (lpRasDialExtensions As Any, ByVal lpszPhonebook As String, lprasdialparams As Any, ByVal dwNotifierType As Long, lpvNotifier As Long, lphRasConn As Long) As Long

2) Hangup

Public Declare Function RasHangUp Lib "RasApi32.DLL" Alias "RasHangUpA" (ByVal hRasConn As Long) As Long

3) Status

Public Declare Function RasGetConnectStatus Lib "RasApi32.DLL" Alias "RasGetConnectStatusA" (ByVal hRasConn As Long, lpRASCONNSTATUS As Any) As Long


Please!!!!! khaledc look over these declares and give me
a source-example I could use in my app.

If you'll do that, then "your an source-expert!"
you can sitate me on that one... :)

Thanks / Bobban
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Share codes 68 114
VBA Check for Character 9 70
Validating VB6 Function 19 49
Visual Basic Excel Formatting error 4 67
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 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

18 Experts available now in Live!

Get 1:1 Help Now