473,506 Members | 16,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change RAS connection number and modem init string withinapplication?

Hi!

If the user has no LAN connection I have to dialup to the internet
in my application. This works fine, but in some case I'll have to
change the phone number (if the provider changes) and the additional
init string of the modem (for instance if the modem does not detect
the dial tone).

So, how do I do this?

I have not found the appropriate SDK functions (maybe I just use the
wrong search patterns in the help and in Google). Any hints?

Ciao and bye,
(:Clemens:)
Nov 15 '05 #1
3 2990
Clemens,

Instead of doing the dialing yourself, I would use the functions from
the WinInet library to dial up an existing internet connection. Since it
seems that your app requires an internet connection, I think that it is safe
to say that one will be configured already on the machine.

I would use the InternetDial function in the WinInet library to
determine which internet connection to establish.

You could even use the InternetAutoDial function to use the default
connection that is set up.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Clemens Chiba - Greentube I.E.S. AG" <cc@greentube.com> wrote in message
news:3F***************@greentube.com...
Hi!

If the user has no LAN connection I have to dialup to the internet
in my application. This works fine, but in some case I'll have to
change the phone number (if the provider changes) and the additional
init string of the modem (for instance if the modem does not detect
the dial tone).

So, how do I do this?

I have not found the appropriate SDK functions (maybe I just use the
wrong search patterns in the help and in Google). Any hints?

Ciao and bye,
(:Clemens:)

Nov 15 '05 #2
> Instead of doing the dialing yourself,

I do not dial myself but I use the RasDial function to use an
existing entry to establish the internet connection.
I would use the functions from the WinInet library to dial up
an existing internet connection. Since it seems that your app
requires an internet connection, I think that it is safe
to say that one will be configured already on the machine.
So InternetDial from this library does the same as RasDial, except
that I can use a different number in the call but I cannot set
a user and password anymore? But if the provider changes I need
all three values to be changed...

But today I've found out that I just need RasGet/SetEntryProperties
for my purposes (it seems, I was blind yesterday ;-) ), and after
some fights with the size of the RasEntry structure (I got errors
603 and 632) my code works fine. :-)
You could even use the InternetAutoDial function to use the
default connection that is set up.


Maybe I should have mentioned that the application is for a
TabletPC and that the users will work outdoors and sometimes
have to connect to the internet. That's why I have to change
the connection parameters if the provider changes. And the
user on the TabletPC must not be required to edit these
settings himself in the control panel.

Ciao and bye,
(:Clemens:)
Nov 15 '05 #3
> But today I've found out that I just need RasGet/SetEntryProperties
for my purposes (it seems, I was blind yesterday ;-) ), and after
some fights with the size of the RasEntry structure (I got errors
603 and 632) my code works fine. :-)


I was even more blind:

I just found out that the RASDIALPARAMS structure has an entry
to overrule the phone number. I used an example from the internet,
so I've overseen this property between the MarshalAs attributes.
Ok, wasted some time, but learned something. ;-)

So the only thing that is left to do is to change the init string
of the modem. Do I also need some Ras functions to do this?

Ciao and bye,
(:Clemens:)
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
7412
by: Jordanakins | last post by:
Usenet, I am currently working on my website and am needing to detect the connection speed of the client. I would like to do this in PHP and not use any other languages. This makes it a bit more...
11
20751
by: Adam Parkin | last post by:
Hello all, I need to be able to detect if there is an active available Internet connection in my VB6 program. In my program I'm using the Internet Transfer Control to transfer some files by HTTP,...
4
6111
by: Linus Nikander | last post by:
Having recently load-tested the application we are developing I noticed that one of the most expensive (time-wise) calls was my fetch of a db-connection from the defined db-pool. At present I fetch...
0
4728
by: JWM | last post by:
I am trying to implement Oracle connection pooling for the following code, which was written by someone else. Here is my main question -- this java file creates code that is executed every hour,...
2
3540
by: Frank an der Heiden | last post by:
Hi folks, I have a problem with the following example: ###################################################### My Receiver Class ***************** class UdpReceiver {
0
1530
by: yom | last post by:
Hi all. I am having some troubles with an application that has to open a dialup up connection. I am using the Ras API RasDial to call the remote modem an all works properly. I am also able to...
10
3432
by: Lars Netzel | last post by:
Hi! Is it possible to start a dial-up connection that is already created on the computer thru VB.NET, and then after it has dialed up get an idication of that there's a connection ( I guess ping...
0
962
by: sergiometal | last post by:
hi, this is not a strictly asp problem but is vscript problem i'm trying to connect to a divice via modem and dial a number 1 so i have this script to do that Set comOne =...
17
5539
by: John Salerno | last post by:
Let me see if this question even makes sense...I'm reading Core Python Programming and I jumped ahead to the more specific topics like network programming. I plan to follow along with the example...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.