Solved

Calling Rasapi32.dll functions?

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

777 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