Article View: borland.public.cppbuilder.nativeapi
Article #9343Re: Ras again
From: Bob Gonder
Date: Sat, 17 Jul 2004 06:05
Date: Sat, 17 Jul 2004 06:05
44 lines
2498 bytes
2498 bytes
Babak wrote:
> RASENTRYNAME entries[256];
> entries[0].dwSize = sizeof(RASENTRYNAME);
> DWORD numEntries = 10;
> DWORD size = sizeof(entries);
>// My problem is error 623 , its about it cant find the PhoneBook address
>:-\
>// it realy phone book? how can I get it if possible?
> DWORD res = RasEnumEntries(NULL, NULL, entries, &size, &numEntries);
> RASDIALPARAMS params = {sizeof(RASDIALPARAMS), 0};
> BOOL bPassword = TRUE;//FALSE;?
>// strcpy(params.szEntryName,"");
>Still Persist , what should I do?
>Dear Friend ! How should I correct (change) to code?
At least 2 things:
> DWORD errco=RasGetEntryDialParams("", ¶ms, &bPassword);
pszPhonebook
Windows NT: Pointer to a null-terminated string that specifies the
full path and filename of a phone-book (.PBK) file. If this parameter
is NULL, the function uses the current default phone-book file.
1) Bad phonebook name. "" Is not NULL. NULL is NULL.
errco=RasGetEntryDialParams(NULL, ¶ms, &bPassword);
lprasdialparams
Points to a RASDIALPARAMS structure that receives the connection
parameters,{...} and the szEntryName member must specify a valid
phone-book entry.
> params.szEntryName[0] = '\0'; //<--- as you said I initialized
2) Not as he meant. See the quote above.
It must ba a "Valid phone-book entry".
'\0' probably isn't a valid name.
Read about what RasEnumEntries() does.
It returns valid phone book entries.
Choose one of those entries.
Copy that entry into params.
Technical Details
Message-ID:
<slfhf057ep1ivjm66r3tpbro2f1597diif@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40f805ab@newsgroups.borland.com> <40f81aba$1@newsgroups.borland.com> <40f8b684@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6d4b466cdd4c8652 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Ras again Date: Fri, 16 Jul 2004 23:05:52 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <slfhf057ep1ivjm66r3tpbro2f1597diif@4ax.com> References: <40f805ab@newsgroups.borland.com> <40f81aba$1@newsgroups.borland.com> <40f8b684@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 65.41.125.111 X-Trace: newsgroups.borland.com 1090044348 65.41.125.111 (16 Jul 2004 23:05:48 -0700) Lines: 48 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail