15,667,983 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Javascript questions
View Python questions
View C++ questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by
0x3c0
(Top 6 by date)
0x3c0
24-Oct-10 10:45am
View
Please edit your additions into the main question - it makes it easier to locate. As for your question - pass the return value to mciGetErrorString.
For what it's worth, mciSendString returns an integer, not a long. Your value is going to be odd. Fix this first.
0x3c0
13-Jul-10 8:43am
View
Please post your responses as on the answer you're replying to. You find out where it's faulting by stepping through it, and finding the part of your code which executed just before the fault occurred.
0x3c0
12-Jun-10 9:06am
View
Thank you for your question; I've put your code in a code block so it's easier for other members to read
0x3c0
12-Jun-10 4:44am
View
You're welcome. I suspect that the error comes from the last concatenation of the line variable. At that point, line is Nothing, so it may simply be that you get a NullReferenceException. There are also a few pieces of redundant code - when you close the StreamReader, the underlying Stream is also closed. Beyond that, the stream is closed when it gets Dispose called, as your Using block will do. It won't cause any massive errors, but it's a little inefficient.
A slightly better loop, and one which is less likely to cause an error is:
line = sr.ReadLine()
Do While line IsNot Nothing
strCreds = strCreds & line ' If you wanted better performance and more efficient memory usage, you could use a StringBuilder's Append method
line = sr.ReadLine()
Loop
0x3c0
11-Jun-10 17:07pm
View
Yes, you're pretty much there. You've got the response stream, now you just need to (I assume you still want to manipulate text) create a System.IO.StreamReader, passing responseStream to the constructor. Then, you can use ReadLine and the associated methods just like you would a normal file
0x3c0
14-May-10 13:29pm
View
If you want to create a sum of a series, all you need is a loop (assuming that the series isn't arithmetic or geometric) with an accumulator. There's no need for an object oriented design there.
Show More