Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 503
  • Last Modified:

Using Rnaapp.exe in Visual C++ 4.0

I use Visual C++ 4.0 under Windows 95 and I need to launch an Internet connexion from one of my program. I know that I have to use the RNAAPP.EXE executable, in the SYSTEM directory. I also know that I have to use the "-l" command line. But what I don't know is how I can specifiy the Internet provider (or connexion) I will use. It seems that it's not specified neither in the command line nor in a file on the hard drive. So what does I have to do? Do you know another way to launch an Internet connexion? But I don't want to deal with the functions from the <ras.h> file. I just want to make the standard dialog box appear. What's the simplest solution to do that?
0
obruchez
Asked:
obruchez
  • 5
  • 4
  • 2
  • +3
1 Solution
 
ohellCommented:
MFC provides classes CInternetConnection and CInternetSession which would simplify what you want to achieve.

First you create a CInternetSession object with the values appropriate to your app and then use OpenURL() method to open a URL and when this is successfully done, you can call one of GetGopherConnection(), GetHttpConnection() or GetFTPConnection()
to have an object of type CInternetConnection.

I don't think the dialog box ia available as a common dialog box,  so I guess you can just create a copy of your own and get various options for the CInternetSession from there. This is pretty simple to do. Just read up the documentation on CInternetSession.
0
 
obruchezAuthor Commented:
I'm sorry, but I can't find anything about CInternetSession. I have Visual C++ version 4.0. It's perhaps an old version.

Anyway, I just want to launch a connection with the standard dialog box. I don't need anything else. I think that to use Rnaapp.exe is the best way to do that.

0
 
msmitsCommented:
Upgrade to a newer version or just use the C API for the RAS functionality. The function you want to look at is RasDial and should be in the win32 API help documentation. The file to include is ras.h.

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
obruchezAuthor Commented:
I've already used the RasDial function. I know that I can use it. But I don't want to. I just want to use Rnaapp.exe. That shouldn't be too difficult, I think. The only problem is that I don't know how to specify to this application which connection I want to use.

0
 
md041797Commented:
Use a spoof.

Write a program that prints out the command arguments.  Temporarily rename rnaapp.exe.  Install your new rnaapp.exe and run a program that uses this exe.  When your new rnaapp program executes, you will have your command line.

Pretty sneaky huh...

0
 
obruchezAuthor Commented:
That's exactly what I've done. The command line is "-l". Nothing else. That's why I'm here... ;-)

0
 
msmitsCommented:
The thing is that rnaapp is some kind of internal program that is not intended for the users to call directly. It is called under water by the RAS functions and communication goes probably via some kind of undocumented OLE interface or something. I checked the registry and it is not registered as some kind of server.
You have to use the microsoft published interface RasDial(). When for example MS decides to call the program rna_super.exe in the next release, all your code breaks, while you can assume that the published interface stays some kind of stable.

I cannot see any reason for you to directly communicate with rnaapp and not via RasDial.
0
 
md041797Commented:
I agree with msmits.
0
 
obruchezAuthor Commented:
Actually, Rnaapp.exe calls the RAS functions, not the contrary.

Anyway, it doesn't matter, since you all think that I shouldn't deal with that program.

But let me explain what I would like to do (I should have done that before...). I want my program to be called each time a user wants to begin an Internet connection, just before the standard dialog box appears. So I thought that I could have changed "Rnaapp.exe" to "Rnapp_.exe" (for instance) and called my program "Rnaapp.exe".

Now I think it could be done differently. I know it is possible to create a shortcut from a RAS Connection with the standard Windows 95 explorer. Then it is possible to "lauch" this shortcut from the DOS shell, for instance. So if I could "launch" a shortcut from my program, my problem would be solved. But it can't be done with functions such as CreateProcess or WinExec. How can I do it?

There _must_ be a simple solution to my problem. Or maybe not...

0
 
chensuCommented:
I am interested in this question because I also wanted to invoke Rnaapp.exe. But I have not found any way but using RAS functions. In order to launch a shortcut, use ShellExecute() function.
0
 
msmitsCommented:
I have the reverse problem. I want to get rid of rnaapp.exe when I am finished with DUN.
I have written an installer for DUN, TCP/IP and creation of a DUN entry in the phonebook and see that the rnaapp.exe is still running at the end. When this happens, the self-extractor doesn't detect the end of my own program (or children) and doesn't cleanup the extracted files. I now have a workaround that walks the process list and kills rnaapp.exe.

0
 
brothers091097Commented:
#include "ras.h"

/* include rasapi32.lib in your project*/


void My_Dial_Func()
 {
  struct RASDIALDLG myStruct;
  BOOL result;

  myStruct.dwSize=sizeof(RASDIALDLG); /* very important */
  myStruct.hwndOwner=NULL;
  result=RasDialDlg(NULL,"your_internet_connexion_name",NULL,&myStruct);      
  ....
 }


if you want more information send me a mail brother@worldnet.net

0
 
chensuCommented:
It seems that RasDialDlg is supported only in Windows NT.
0
 
brothers091097Commented:
huppppssssssss,sorry!!!!!!!!!!!!!
For win95 try:

strcpy(cmd,"rundll rnaui.dll,RnaDial ");
strcat(cmd,"your_connection_name");
WinExec(cmd,SW_SHOWNORMAL);



0
 
msmitsCommented:
Shouldn't that be rundll32?
0
 
obruchezAuthor Commented:
brothers, it seems to work fine! Thanks!

Also, I would like to thank msmits, ohell, chensu and md for their help!

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now