C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 07-09-2005, 02:25 AM   #1
Registered User
 
Join Date: Jun 2005
Posts: 18
ras.h errors

I am trying to compile the following code:

Code:
#include <ras.h>


bool IsConnected()
{
   LPRASCONN TRasCon;
   RASCONNSTATUS Tstatus;

   DWORD lg;
   DWORD lpcon;
   bool lReturn;

   TRasCon->dwSize = 412;
   lg = 256 * TRasCon->dwSize;
   lReturn = false;

   if( RasEnumConnections(TRasCon, &lg, &lpcon) == 0 )
   {
       Tstatus.dwSize = 160;
       RasGetConnectStatus(TRasCon->hrasconn, &Tstatus);

       lReturn = ( Tstatus.rasconnstate == 0x2000 );
   }

   return( lReturn );
}
And I get the following errors:

Quote:
c:\program files\microsoft visual studio\vc98\include\ras.h(47) : error C2065: 'HRASCONN' : undeclared identifier
c:\program files\microsoft visual studio\vc98\include\ras.h(47) : error C2501: 'DECLARE_HANDLE' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(56) : error C2146: syntax error : missing ';' before identifier 'dwSize'
c:\program files\microsoft visual studio\vc98\include\ras.h(56) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(56) : error C2501: 'dwSize' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(57) : error C2146: syntax error : missing ';' before identifier 'hrasconn'
c:\program files\microsoft visual studio\vc98\include\ras.h(57) : error C2501: 'HRASCONN' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(57) : error C2501: 'hrasconn' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(58) : error C2146: syntax error : missing ';' before identifier 'szEntryName'
c:\program files\microsoft visual studio\vc98\include\ras.h(58) : error C2501: 'WCHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(58) : error C2501: 'szEntryName' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(73) : error C2146: syntax error : missing ';' before identifier 'dwSize'
c:\program files\microsoft visual studio\vc98\include\ras.h(73) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(73) : error C2501: 'dwSize' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(74) : error C2146: syntax error : missing ';' before identifier 'hrasconn'
c:\program files\microsoft visual studio\vc98\include\ras.h(74) : error C2501: 'HRASCONN' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(74) : error C2501: 'hrasconn' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(75) : error C2146: syntax error : missing ';' before identifier 'szEntryName'
c:\program files\microsoft visual studio\vc98\include\ras.h(75) : error C2501: 'CHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(75) : error C2501: 'szEntryName' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(154) : error C2146: syntax error : missing ';' before identifier 'dwSize'
c:\program files\microsoft visual studio\vc98\include\ras.h(154) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(154) : error C2501: 'dwSize' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(156) : error C2146: syntax error : missing ';' before identifier 'dwError'
c:\program files\microsoft visual studio\vc98\include\ras.h(156) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(156) : error C2501: 'dwError' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(157) : error C2146: syntax error : missing ';' before identifier 'szDeviceType'
c:\program files\microsoft visual studio\vc98\include\ras.h(157) : error C2501: 'WCHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(157) : error C2501: 'szDeviceType' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(158) : error C2146: syntax error : missing ';' before identifier 'szDeviceName'
c:\program files\microsoft visual studio\vc98\include\ras.h(158) : error C2501: 'WCHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(158) : error C2501: 'szDeviceName' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(167) : error C2146: syntax error : missing ';' before identifier 'dwSize'
c:\program files\microsoft visual studio\vc98\include\ras.h(167) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(167) : error C2501: 'dwSize' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(169) : error C2146: syntax error : missing ';' before identifier 'dwError'
c:\program files\microsoft visual studio\vc98\include\ras.h(169) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(169) : error C2501: 'dwError' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(170) : error C2146: syntax error : missing ';' before identifier 'szDeviceType'
c:\program files\microsoft visual studio\vc98\include\ras.h(170) : error C2501: 'CHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(170) : error C2501: 'szDeviceType' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(171) : error C2146: syntax error : missing ';' before identifier 'szDeviceName'
c:\program files\microsoft visual studio\vc98\include\ras.h(171) : error C2501: 'CHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(171) : error C2501: 'szDeviceName' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(193) : error C2146: syntax error : missing ';' before identifier 'dwSize'
c:\program files\microsoft visual studio\vc98\include\ras.h(193) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(193) : error C2501: 'dwSize' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(194) : error C2146: syntax error : missing ';' before identifier 'szEntryName'
c:\program files\microsoft visual studio\vc98\include\ras.h(194) : error C2501: 'WCHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(194) : error C2501: 'szEntryName' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(195) : error C2146: syntax error : missing ';' before identifier 'szPhoneNumber'
c:\program files\microsoft visual studio\vc98\include\ras.h(195) : error C2501: 'WCHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(195) : error C2501: 'szPhoneNumber' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(196) : error C2146: syntax error : missing ';' before identifier 'szCallbackNumber'
c:\program files\microsoft visual studio\vc98\include\ras.h(196) : error C2501: 'WCHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(196) : error C2501: 'szCallbackNumber' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(197) : error C2146: syntax error : missing ';' before identifier 'szUserName'
c:\program files\microsoft visual studio\vc98\include\ras.h(197) : error C2501: 'WCHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(197) : error C2501: 'szUserName' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(198) : error C2146: syntax error : missing ';' before identifier 'szPassword'
c:\program files\microsoft visual studio\vc98\include\ras.h(198) : error C2501: 'WCHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(198) : error C2501: 'szPassword' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(199) : error C2146: syntax error : missing ';' before identifier 'szDomain'
c:\program files\microsoft visual studio\vc98\include\ras.h(199) : error C2501: 'WCHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(199) : error C2501: 'szDomain' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(209) : error C2146: syntax error : missing ';' before identifier 'dwSize'
c:\program files\microsoft visual studio\vc98\include\ras.h(209) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(209) : error C2501: 'dwSize' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(210) : error C2146: syntax error : missing ';' before identifier 'szEntryName'
c:\program files\microsoft visual studio\vc98\include\ras.h(210) : error C2501: 'CHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(210) : error C2501: 'szEntryName' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(211) : error C2146: syntax error : missing ';' before identifier 'szPhoneNumber'
c:\program files\microsoft visual studio\vc98\include\ras.h(211) : error C2501: 'CHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(211) : error C2501: 'szPhoneNumber' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(212) : error C2146: syntax error : missing ';' before identifier 'szCallbackNumber'
c:\program files\microsoft visual studio\vc98\include\ras.h(212) : error C2501: 'CHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(212) : error C2501: 'szCallbackNumber' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(213) : error C2146: syntax error : missing ';' before identifier 'szUserName'
c:\program files\microsoft visual studio\vc98\include\ras.h(213) : error C2501: 'CHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(213) : error C2501: 'szUserName' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(214) : error C2146: syntax error : missing ';' before identifier 'szPassword'
c:\program files\microsoft visual studio\vc98\include\ras.h(214) : error C2501: 'CHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(214) : error C2501: 'szPassword' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(215) : error C2146: syntax error : missing ';' before identifier 'szDomain'
c:\program files\microsoft visual studio\vc98\include\ras.h(215) : error C2501: 'CHAR' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(215) : error C2501: 'szDomain' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(238) : error C2146: syntax error : missing ';' before identifier 'dwSize'
c:\program files\microsoft visual studio\vc98\include\ras.h(238) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(238) : error C2501: 'dwSize' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(239) : error C2146: syntax error : missing ';' before identifier 'dwfOptions'
c:\program files\microsoft visual studio\vc98\include\ras.h(239) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(239) : error C2501: 'dwfOptions' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(240) : error C2146: syntax error : missing ';' before identifier 'hwndParent'
c:\program files\microsoft visual studio\vc98\include\ras.h(240) : error C2501: 'HWND' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(240) : error C2501: 'hwndParent' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(241) : error C2146: syntax error : missing ';' before identifier 'reserved'
c:\program files\microsoft visual studio\vc98\include\ras.h(241) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(241) : error C2501: 'reserved' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(270) : error C2146: syntax error : missing ';' before identifier 'dwSize'
c:\program files\microsoft visual studio\vc98\include\ras.h(270) : error C2501: 'DWORD' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(270) : error C2501: 'dwSize' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\ras.h(270) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.

This make it look like there is a problem with ras.h, I also tried compiling this in LCC W32 and it highlighted things in ras.h, and both MSVC++ and LCC W32 use different ras.h files...
Please help...
Trent_Easton is offline   Reply With Quote
Old 07-09-2005, 02:33 AM   #2
Even death may die...
 
Dante Shamest's Avatar
 
Join Date: Apr 2003
Location: Malaysia
Posts: 970
Hmm...try including windows.h before ras.h?

Code:
#include <windows.h>
#include <ras.h>
Dante Shamest is offline   Reply With Quote
Old 07-13-2005, 08:30 AM   #3
Registered User
 
Join Date: Jun 2005
Posts: 18
Now I'm getting the errors:

Quote:
isconnected.obj : error LNK2001: unresolved external symbol _RasGetConnectStatusA@8
isconnected.obj : error LNK2001: unresolved external symbol _RasEnumConnectionsA@12
Debug/isconnected.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Sorry for bothering you.
Trent_Easton is offline   Reply With Quote
Old 07-13-2005, 08:43 AM   #4
Registered User
 
Join Date: Aug 2001
Location: Newport, South Wales, UK
Posts: 1,094
Tell your linker to link to rasapi32.lib

Project->Settings->Link->Object/library modules
SMurf is offline   Reply With Quote
Old 07-13-2005, 01:51 PM   #5
Dump Truck Internet
 
valis's Avatar
 
Join Date: Jul 2005
Posts: 357
it looks like you are getting cascading errors from as few as one or two errors, make sure you are linking with everything you need to and you don't have a misplaced ; or }

EDIT: sorry, didn't see your first problem was fixed
valis is offline   Reply With Quote
Old 07-15-2005, 09:52 AM   #6
Registered User
 
Join Date: Jun 2005
Posts: 18
Thank you very much guys
Trent_Easton is offline   Reply With Quote
Old 07-15-2005, 04:59 PM   #7
Registered User
 
Join Date: Jul 2005
Posts: 7
I'd reccomend trying http://bloodshed.net/, my school used MSVC, and I hated it.
karlan is offline   Reply With Quote
Old 07-15-2005, 10:45 PM   #8
Registered User
 
Join Date: Jun 2005
Posts: 18
How would I go about writing a prototype for

bool IsConnected()

I've tried

bool IsConnected();

But it gives me errors, I have experiencing making prototypes for bool functions....I've never used boolean functions before...
Trent_Easton is offline   Reply With Quote
Old 07-15-2005, 10:52 PM   #9
Registered User
 
Join Date: Jul 2005
Posts: 7
Code:
bool myfunc();


/*Make sure this function is after the prototype*/
bool myfunc(){
/*code*/
}
you may need a
Code:
typedef int short unsigned bool;
karlan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
global namespace errors stubaan C++ Programming 9 04-02-2008 03:11 PM
Ten Errors AverageSoftware Contests Board 0 07-20-2007 10:50 AM
Winsock compilation errors jmd15 Networking/Device Communication 2 08-03-2005 08:00 AM
Stupid compiler errors ChrisEacrett C++ Programming 9 11-30-2003 05:44 PM
errors in class(urgent) ayesha C++ Programming 2 11-10-2001 06:51 PM


All times are GMT -6. The time now is 02:40 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22