Article View: borland.public.cppbuilder.nativeapi
Article #9357Re: Ras again
From: Bob Gonder
Date: Sun, 18 Jul 2004 03:13
Date: Sun, 18 Jul 2004 03:13
43 lines
2270 bytes
2270 bytes
Babak wrote:
{Huge Snip}
Please don't post all that stuff.
>void __fastcall TForm1::Button1Click(TObject *Sender)
>{
> Form1->Height=356;
>
> RASENTRYNAME entries[256];
> entries[0].dwSize = sizeof(RASENTRYNAME);
> int rv;
> DWORD size = sizeof(entries);
> DWORD i,res,numEntries = 10;
>
> res = RasEnumEntries(NULL, NULL, entries, &size, &numEntries);
> RASDIALPARAMS params = {sizeof(RASDIALPARAMS), 0};
> for(i=0 ; i<numEntries ; i++){
First, reset the size every time.
(move sizeof... After the for, not before)
Why? no guarantee that Win doesn't change it.
> strncpy(params.szEntryName,
> entries[i].szEntryName,
> RAS_MaxEntryName);
> rv=RasGetEntryDialParams(NULL, ¶ms, 0);
>My Problem is Error 610
>its about An invalid buffer was specified.
>//#define ERROR_BUFFER_INVALID (RASBASE+10)
lpfPassword
Points to a flag that indicates whether the function retrieved the
password associated with the user name for the phone-book entry. The
function sets this flag to TRUE if the user's password was returned in
the szPassword member of the RASDIALPARAMS structure pointed to by
lprasdialparams.
It doesn't say it can be NULL.
BOOL PasswordReturned;
RasGetEntryDialParams(NULL, ¶ms, &PasswordReturned);
Technical Details
Message-ID:
<jvpjf0hm0sva3vuu7eqjjmbprvf0bq73ot@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40f805ab@newsgroups.borland.com> <40f98d96@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: Sat, 17 Jul 2004 20:13:13 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <jvpjf0hm0sva3vuu7eqjjmbprvf0bq73ot@4ax.com> References: <40f805ab@newsgroups.borland.com> <40f98d96@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 1090120388 65.41.125.111 (17 Jul 2004 20:13:08 -0700) Lines: 46 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail