Solved

Calling Rasapi32.dll functions?

Posted on 1998-07-15
4
558 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Opening Remote & Local Data Connection 2 51
Updates not working for MS Windows 7 12 152
Excel - Save a copy of work book 13 82
Modifying Conditional Format from VBA code 3 48
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…

943 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

6 Experts available now in Live!

Get 1:1 Help Now