Re: cgets bug?

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi, David,
Thanks for your response.
The issue had been in our internal bug list, so I said that it was a
confirmed product by design issue. Unfortunately from the internal log,
there was no plan for fixing this issue now. That is why I recommend that
you use other method. If ANSI is not neccessary in your requirement, you
may use Unicode character set to build you application.

Anyway, I report it again via http://connect.microsoft.com. Please refer to:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedba
ckID=262098

Also, from my test, I found a workaround to resolve this issue by adding an
additional line of _cgetts_s after the first _cgetts_s function when your
application is build with NON-UNICODE character set. Please refer to:
TCHAR b[128];
b[(sizeof(b)/sizeof(b[0]))-1]=0;
size_t br;
int i=0;
do {
_tprintf(_T("Enter Something>"));
#ifdef _UNICODE
_cgetts_s(b, sizeof(b)/sizeof(b[0]), &br);
#else
TCHAR chrend[1];
_cgetts_s(b, sizeof(b)/sizeof(b[0]), &br);
_cgetts_s(chrend, sizeof(chrend)/sizeof(chrend[0]), &br);
#endif
} while (br==0);

For your question, "I tried flush the buffer via checking for kbhit() but
it doesn't show up ..
must be buffered somewhere else? ", I think that the _cgetts_s input buffer
may be different from standard input buffer and kbhit() or other flushing
buffer functions could not clear it. Unfortunately this is undocumented.

Hope this helps. If you have any other questions or concerns, please feel
free to let me know.
Have a good day!

Charles Wang
Microsoft Online Community Support
=====================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications

If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.


Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================















.



Relevant Pages

  • Re: cgets bug?
    ... I tried flush the buffer via checking for kbhitbut it doesn't show up .. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.ide_general)
  • Re: C2872 IServiceProvider ambiguous symbol - migrating C++/MFC App with /clr to Visual Studio 2
    ... Infinite thanks for yet another excellent response. ... "typedef interface IServiceProvider IServiceProvider;" ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Intermittent work in UI thread
    ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.mfc)
  • Re: Intermittent work in UI thread
    ... then the issue here is that you would have a timer handler something like ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.mfc)
  • Re: Abort a download
    ... response output finished. ... enough for the raw HTTP communication. ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)