ext3awf
asked on
RAS Win32 API: Does anyone have experience with RasEnumConnections?
Does anyone have experience with RasEnumConnections? I need to get all the connections and see if one of the existing connections is the connection I am trying to make. The reason I need this is that I get a non-zero (failure) return code when I call RasDial on a specific phonebook entry if the connection for this entry already exists. Does anyone know a workaround for this or do I have to use RasEnumConnections? If so, anyone have any sample implementations of this method?
Thank you
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
msiegenthaler,
When I try this code I get the following errors:
1. I get an Unknown character 0x0a0 for l_RASConnections[10]
2. I get no conversion from int to char* for
if (m_CheckAll || l_RASConnections[i].szEntr yName == m_Line)
3. What are m_CheckAll and m_Line defined as?
4. When I make the call to DWORD rc = RasDIAL(NULL, NULL, &rdParams, NULL, NULL, l_RASConnections[i].hrasco nn); It doesn't like the
last parameter. The complier gives me: struct HRASCONN__ *' to 'struct HRASCONN__ ** '
When I try this code I get the following errors:
1. I get an Unknown character 0x0a0 for l_RASConnections[10]
2. I get no conversion from int to char* for
if (m_CheckAll || l_RASConnections[i].szEntr
3. What are m_CheckAll and m_Line defined as?
4. When I make the call to DWORD rc = RasDIAL(NULL, NULL, &rdParams, NULL, NULL, l_RASConnections[i].hrasco
last parameter. The complier gives me: struct HRASCONN__ *' to 'struct HRASCONN__ ** '
The part inside the FOR doesn't matter. I've copied this code out of one of my programs.'l_RASConnections [i].szEntr yName' is the name of RAS connections and 'l_RASConnections[i].hrasc onn' can be used for dial or hang up a connection.
To the 4. question: I'm not sure what's up, but I'd recommend you to read to help
U understand how the stuff works?
To the 4. question: I'm not sure what's up, but I'd recommend you to read to help
U understand how the stuff works?
RASCONN l_RASConnections[10];
l_RASConnections[0].dwSize
DWORD l_BufferSize=sizeof(l_RASC
DWORD l_ConnectionCount=0;
if (RasEnumConnections(&l_RAS
{
for (DWORD i=0; i<l_ConnectionCount; i++)
{
if (m_CheckAll || l_RASConnections[i].szEntr
RasHangUp(l_RASConnections
}
}