Solved

Using Rnaapp.exe in Visual C++ 4.0

Posted on 1997-09-07
16
473 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
  • 5
  • 4
  • 2
  • +3
16 Comments
 
LVL 1

Expert Comment

by:ohell
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:obruchez
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I agree with msmits.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:obruchez
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
#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
Comment Utility
It seems that RasDialDlg is supported only in Windows NT.
0
 

Expert Comment

by:brothers091097
Comment Utility
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
Comment Utility
Shouldn't that be rundll32?
0
 

Author Comment

by:obruchez
Comment Utility
brothers, it seems to work fine! Thanks!

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

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

763 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

11 Experts available now in Live!

Get 1:1 Help Now