🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8629

Re: RAS Sample Source Needed

#8629
From: Pedram
Date: Thu, 30 Sep 2004 11:55
61 lines
2582 bytes
khorosho ! spasibo !
But My Problem still persist !!
here its my source code , when I test it , there is no Tel# in my TMemo

Start a New Project
Place a Memo and A Button
On Click Code for Button :

   EnumEntries();

Dont forget to change header for EnumEntries() :
private:
    bool EnumEntries();

and The Code is :
//--------------------------------------------------------

bool TForm1::EnumEntries()
{
    RASENTRYNAME *entry = new RASENTRYNAME[30];
    DWORD entries, size, error;
    char buffer[100];
    RASDIALPARAMS params;
    bool password;
    if(!entry)
    {
        ShowMessage("There's no enough memory.");
        return false;
    }
    entry[0].dwSize = sizeof(RASENTRYNAME);
    size = 30 * sizeof(RASENTRYNAME);
    error = RasEnumEntries(NULL, NULL, entry, &size,
        &entries);
    if(error)
    {
        RasGetErrorString(error, buffer, sizeof(buffer));
        ShowMessage(error);
        return false;
    }
    if(!entries)
    {
        ShowMessage("There are no entries.");
        return false;
    }
    for(int x = 0; x < (int)entries; x++){
        Memo1->Lines->Add(entry[x].szEntryName);
        memset(&params, 0, sizeof(RASDIALPARAMS));
        params.dwSize = sizeof(RASDIALPARAMS);
        strcpy(params.szEntryName, entry[x].szEntryName);
        error = RasGetEntryDialParams(NULL, &params,
            (LPBOOL)&password);
            if(error)
            {
                RasGetErrorString(error, buffer, sizeof(buffer));
                ShowMessage(buffer);
                return false;
            }
            Memo1->Lines->Add(params.szPhoneNumber);
    }
    return true;
}
Technical Details
Message-ID: <415bf638@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <415b0fd9@newsgroups.borland.com> <415b1538@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,98b2d4516f3e209b
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Pedram" <Pedram@Internet.Network>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <415b0fd9@newsgroups.borland.com> <415b1538@newsgroups.borland.com>
Subject: Re: RAS Sample Source Needed
Date: Thu, 30 Sep 2004 15:25:31 +0330
Lines: 63
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 195.146.46.162
Message-ID: <415bf638@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1096545848 195.146.46.162 (30 Sep 2004 05:04:08 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail