1. C Structures..

I'm having a some trouble with the the function RasEnumConnections in
rasapi32.dll:

DWORD RasEnumConnections(

    LPRASCONN  lprasconn,       // buffer to receive connections data
    LPDWORD  lpcb,      // size in bytes of buffer
    LPDWORD  lpcConnections // number of connections written to buffer
);

lprasconn is supposed to be a pointer to a buffer that receives an array
of RASCONN structures, on for each connection. And before calling the
function, an application must set the dwSize member of the first RASCONN
structure in the buffer to sizeof(RASCONN) in order to identify the
version of the structure being passed.

(text from win32.hlp)

Uh.. right. How should I handle this?

(And why is the name of the function actually RasEnumConnectionsA?
What's the A doing there?)

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » topic index » view message » categorize

2. Re: C Structures..

Humm lets see:

(Not tested and being done from memory - which is quite fuzzy at times)

Be sure that you have opened the .dll first into a variable called rasapi32
and have declared RasEnumConnections.

RasEnumConnections = define_c_func(rasapi32,
"RasEnumConnectionsA",{C_POINTER,C_POINTER,C_POINTER}, C_LONG)

RasEnumConnectionsA is the ansi version of the .dll call.

Hope this helps,

Greg Harris


-----Original Message-----
From: Tom Eklof <darkspace at HOTMAIL.COM>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Sunday, August 23, 1998 6:34 AM
Subject: C Structures..


>I'm having a some trouble with the the function RasEnumConnections in
>rasapi32.dll:
>
>DWORD RasEnumConnections(
>
>    LPRASCONN  lprasconn,       // buffer to receive connections data
>    LPDWORD  lpcb,      // size in bytes of buffer
>    LPDWORD  lpcConnections // number of connections written to buffer
>);
>
>lprasconn is supposed to be a pointer to a buffer that receives an array
>of RASCONN structures, on for each connection. And before calling the
>function, an application must set the dwSize member of the first RASCONN
>structure in the buffer to sizeof(RASCONN) in order to identify the
>version of the structure being passed.
>
>(text from win32.hlp)
>
>Uh.. right. How should I handle this?
>
>(And why is the name of the function actually RasEnumConnectionsA?
>What's the A doing there?)
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: C Structures..

>Humm lets see:
>
>(Not tested and being done from memory - which is quite fuzzy at times)
>
>Be sure that you have opened the .dll first into a variable called
rasapi32
>and have declared RasEnumConnections.
>
>RasEnumConnections = define_c_func(rasapi32,
>"RasEnumConnectionsA",{C_POINTER,C_POINTER,C_POINTER}, C_LONG)
>
>RasEnumConnectionsA is the ansi version of the .dll call.
>
>Hope this helps,
>
>Greg Harris



Uh, not actually, but thanks anyhow. Actually I'm looking for a way to
handle the RASCONN structure:

>>DWORD RasEnumConnections(

>>    LPRASCONN  lprasconn,       // buffer to receive connections data
>>    LPDWORD  lpcb,      // size in bytes of buffer
>>    LPDWORD  lpcConnections // number of connections written to buffer
>>);

>>lprasconn is supposed to be a pointer to a buffer that receives an
>>array of RASCONN structures, on for each connection. And before
>>calling the function, an application must set the dwSize member of
>>the first RASCONN structure in the buffer to sizeof(RASCONN) in
>>order to identify the version of the structure being passed.

How do I do the buffer which is supposed to accept the array of
RASCONNs?
I'm supposed to handle at least one RASCONN structure (lpcConnections is
set to the amount of RASCONN arrays by RasEnumConnections).


typedef struct _RASCONN {

    DWORD     dwSize;
    HRASCONN  hrasconn;
    TCHAR     szEntryName[RAS_MaxEntryName + 1];

#if (WINVER >= 0x400)
    CHAR      szDeviceType[ RAS_MaxDeviceType + 1 ];
    CHAR      szDeviceName[ RAS_MaxDeviceName + 1 ];
#endif

} RASCONN ;


I've looked at WIN32LIB.EW in hopes of understanding how to handle
structures in euphoria, but I gave up as I have no hope of understanding
mr. Cuny's code with my rather meager understanding of C :)

Someone should write a routine for handling structures. Would make our
(my :) life a lot easier from time to time.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu