|
Dear Alexander
How do I reach out to you for a possible solution regarding my dial up connection that i am facing for USB GSM GPRS Modem.. Can u share me your email id ?
Sulax
|
|
|
|
|
Hi,
I'm using windows default driver Usbser.sys for my Embedded device to connect it with my PC. I'm in a need to create LAN connection between my PC and my Embedded device, Programatically. I used Ras dial functions to make the dial-up connection.
But the problem here is before making the dial-up connection I need to create a Modem.
I followed the below steps to create a Modem, Manually. But I want to handle this part in the Code. How to do the below steps programatically.
Control Panel -> Phone and Modem options -> Navigate To Modem Menu -> Click Add button -> Select “Don’t detect my modem;I will select it from a list” -> Select “Communications cable between two computers” and click Next button -> Selected my COM port in which device is connected -> Finish.(Seems the modem driver is getting installed here)
And below is my SetupApi.log when installing the new modem, Manually:
[2012/07/11 21:07:12 4324.27 Driver Install]
#-198 Command line processed: "C:\WINDOWS\system32\rundll32.exe" C:\WINDOWS\system32\shell32.dll,Control_RunDLL "C:\WINDOWS\system32\telephon.cpl",Phone and Modem Options
#I060 Set selected driver.
[2012/07/11 21:07:12 4324.28]
#-198 Command line processed: "C:\WINDOWS\system32\rundll32.exe" C:\WINDOWS\system32\shell32.dll,Control_RunDLL "C:\WINDOWS\system32\telephon.cpl",Phone and Modem Options
#-166 Device install function: DIF_INSTALLDEVICE.
#I123 Doing full install of "ROOT\MODEM\0009".
#-011 Installing section [M2700] from "c:\windows\inf\mdmhayes.inf".
#I121 Device install of "ROOT\MODEM\0009" finished successfully.
How to achieve this part ( creating New Modem ) Programatically? Is there any Windows APIs available or is there a way to do this with writing some inf files? Please Suggest me some idea to proceed.
My Email-Id: sethuuraman@gmail.com
Thanks in advance...
|
|
|
|
|
|
I know this is probably a newbiew question and I apologize in advance.
I'm unable to get the souce to compile without errors?
Anyhelp would be great!.
thank you
|
|
|
|
|
Hello everyone,
the original code wrapped around RasEnumEntries() contained several bugs.
Specifically, it didn't properly distinguish the following:
1) RAS phonebook entry size, i.e. sizeof(struct ...)
2) RasEnumEntries() buffer size, i.e. the malloc() argument
buffer_size = entry_size * number_of_entries
Note that entry_size is passed into RasEnumEntries() via
entry->dwSize, whereas buffer size and number of entries
are passed in via the function prototype (by pointer).
The initial call to RasEnumEntries() will check entry->dwSize
and buffer size. It may report *two different* errors:
the entry size can be wrong, or the buffer can be too small
for all the entries. In either case, it will return the following:
1) the correct buffer size
2) the correct number of entries
via the arguments "passed by pointer" through the prototype.
Can't say if it also modifies the entry->dwSize - for the
second try, I'm setting it to buffer_size / number_of_entries,
just in case.
As a side note, the buffer size was originally initialized to
sizeof(DWORD), rather than sizeof(phonebook_entry)
The following code snippet should be obvious enough.
I've compiled that as a console proggie with gcc/mingw,
but the code should be fairly portable to MSVC.
(CodeProject's editing system seems to eat all empty lines - oh well...)
=========== SAMPLE CODE =============
bool GetPhonebookEntries()
{
RASENTRYNAME* first_ras_entry;
DWORD buf_size, entry_size;
DWORD num_entries = 1;
DWORD retval;
UINT ndx;
char szMessage[256];
entry_size = sizeof(RASENTRYNAME);
buf_size = entry_size * num_entries;
first_ras_entry = (LPRASENTRYNAME) new char[buf_size];
if (NULL == first_ras_entry) return FALSE;
ZeroMemory(first_ras_entry, buf_size);
first_ras_entry->dwSize = entry_size;
retval = RasEnumEntries(NULL, NULL, first_ras_entry, &buf_size, &num_entries);
if (
(ERROR_BUFFER_TOO_SMALL == retval)
|| (ERROR_INVALID_SIZE == retval)
)
{
entry_size = buf_size / num_entries;
delete first_ras_entry;
first_ras_entry = NULL;
first_ras_entry = (LPRASENTRYNAME) new char[buf_size];
if (NULL != first_ras_entry)
{
ZeroMemory(first_ras_entry, buf_size);
first_ras_entry->dwSize = entry_size;
retval = RasEnumEntries(NULL, NULL, first_ras_entry, &buf_size, &num_entries);
}
else
retval = ERROR_NOT_ENOUGH_MEMORY;
}
if (0 != retval)
{
long int tmp_retval;
tmp_retval = RasGetErrorString((UINT)retval, szMessage, 256);
if (0 == tmp_retval)
{
printf("%s\n", szMessage);
}
else
printf("Couldn't get a verbose err. message. RasGetErrorString() = %ld", tmp_retval);
}
if (0 == num_entries)
{
delete first_ras_entry ;
return FALSE;
}
if (0 == retval)
{
for (ndx = 0; ndx < num_entries; ndx++)
{
printf("Found a RAS entry: %s\n", first_ras_entry[ndx].szEntryName);
}
}
delete first_ras_entry;
return TRUE;
}
|
|
|
|
|
Hi Frank,
Thank for your posted code . From now, i can understand how to use the RasEnumEntries on XP .
The life is always beautiful
|
|
|
|
|
Thanks for your feedback You might want to be interested in the following snippet of code:
http://www.fccps.cz/download/adv/frr/gprs/GPRS.zip
It's a C++/WinAPI code sample to programmatically install and launch GPRS connectivity via an RS232-attached GPRS modem (COM port access, Setup API, RAS API). It's based heavily on code from this CodeProject web site - thanks for all the great stuff the others have published. I was too weary to code some "resilience" features - such as ping to some remote site and connection teardown+retry if the ping fails... Again written in MINGW, sorry :-I
|
|
|
|
|
Hi Frank,
At first, thanks for your posted soure code of GPRS , because i'm developing a connection manager software for USB dongle. Your codes are very helpful to me, so that i can understand how to use the RAS library on the Windows XP. But i have not seen any snippet code for sending APN name to modem before opening ras connection. Have you missed it?. And i think we could send it by writting into the modem, right?
Best regards.
The life is always beautiful
|
|
|
|
|
As for the APN name, I've massaged the modem .INF file for that It's enclosed in the ZIP file.
Otherwise it would obviously be possible to set up the APN name explicitly while talking to the modem. You could add that bit of conversation to e.g. init_modem() in my_modem.cpp.
|
|
|
|
|
Hello All
I tried the source and whenever I add connection type its give error cannot find the phone book entry please help me to resolve it
thanks
|
|
|
|
|
Hi,
I work under XP home and when I try to select the available connection I obtain this error:
"Cannot find the phone book entry"
Do You know the reason?
|
|
|
|
|
The download link cann't find anything....
|
|
|
|
|
|
The Xoom links don't work any more. Please send alternate links to submit@codeproject.com, so that the editors can update your article.
Nish
|
|
|
|
|
|
I have a wave file, When I play it, How to change speed (faster or slowly). Any one know this skill show me please!
|
|
|
|
|
when I run the application on win2k, RasEnumEntries() returns ERROR_INVALID_SIZE.
Could you let me know how I can fix this problem?
|
|
|
|
|
We also have a similar problem, If you have found a solution please let us know.
Thanks in advance
|
|
|
|
|
Hi,
My program doesn’t work in windows98.
Could you tall me why not work in windows98?
I call RasDial function in this way:
DWORD dwRet =RasDial(NULL, NULL, &rdParams, 0L, RasDialFunc, &g_hRasConn);
|
|
|
|
|
I get all ras device name with function : RasEnumDevices
then I let user choose a device,
then how can I get this device's ID by name ?
this device ID will be used in function : LineOpen
If somebody can answer this question, please mail to : guostong@hotmail.com
|
|
|
|
|
Your project is good. When I create executable file form its source code, it will be big size. But, your supplied executable file is enough small size.
|
|
|
|
|
Hi there, I tried running you application on 3 different computers haveing windows 2000 installed in it. It worked well under two of them but on third one, the main screen doesnt even show up.
I have checked the version of the TAPI Dlls on that system and its like:
tapi.dll 3.10.0.103
tapi3.dll 5.0.2195.2264
tapi32.dll 5.0.2182.1
tapiperf.dll 5.0.2143.1
tapisrv.dll 5.0.2195.2955
tapiui.dll 5.0.2158.1
So what could be the problem?
I have created another application with some of the TAPI functionality and i had removed the "AlexfPerf" part out of it. And now it did work well on that computer. So in short there is some problem in AlexfPerf.cpp file but unfortunately i couldnt figure it out.
Pls help me out.
Thanx,
Paras Shah
|
|
|
|
|
Performance counting should be completely rewritten for win2k. It is not suppose to work in current version. Personally I just don't have time for this right now.
|
|
|
|
|
The downloaded exe file works fine but the exe compiled from source code behaves difference: the dial-up entries couldn't be added in the connections list. The link for downloading latest source code is not available. Please tell us where can we down load the latest source code??
|
|
|
|
|
Hi!
This project is now at sourceforge: http://sourceforge.net/projects/afd/
Not doing anything myself right now since I don't even have a modem, but if someone interested, you are welcome to join as developers.
|
|
|
|