Solved

Using Rnaapp.exe in Visual C++ 4.0

Posted on 1997-09-07
16
487 Views
Last Modified: 2008-03-06
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
Comment
Question by:obruchez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +3
16 Comments
 
LVL 1

Expert Comment

by:ohell
ID: 1169088
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
 

Author Comment

by:obruchez
ID: 1169089
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
 
LVL 3

Expert Comment

by:msmits
ID: 1169090
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!

 

Author Comment

by:obruchez
ID: 1169091
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
 
LVL 4

Expert Comment

by:md041797
ID: 1169092
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
 

Author Comment

by:obruchez
ID: 1169093
That's exactly what I've done. The command line is "-l". Nothing else. That's why I'm here... ;-)

0
 
LVL 3

Expert Comment

by:msmits
ID: 1169094
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
 
LVL 4

Expert Comment

by:md041797
ID: 1169095
I agree with msmits.
0
 

Author Comment

by:obruchez
ID: 1169096
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
 
LVL 23

Expert Comment

by:chensu
ID: 1169097
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
 
LVL 3

Expert Comment

by:msmits
ID: 1169098
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
 

Accepted Solution

by:
brothers091097 earned 200 total points
ID: 1169099
#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
 
LVL 23

Expert Comment

by:chensu
ID: 1169100
It seems that RasDialDlg is supported only in Windows NT.
0
 

Expert Comment

by:brothers091097
ID: 1169101
huppppssssssss,sorry!!!!!!!!!!!!!
For win95 try:

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



0
 
LVL 3

Expert Comment

by:msmits
ID: 1169102
Shouldn't that be rundll32?
0
 

Author Comment

by:obruchez
ID: 1169103
brothers, it seems to work fine! Thanks!

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

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

756 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