If I'm creating a new char to read in a text file:
pbuffer = new char[length];
what is the maximum size length can be? Would a std::string be better? pbuffer will only be allocated one time in scope no matter what, and length is not known until run time depending on the size of the text file to be read.
If you only want to allocate pbuffer once, then yes, I think a std::string probably would be a good choice. It's essentially a vector of char which gives you access to many of those features and functionalities. Plus, it gives you the option to use stringstreams and other more-convenient operators/methods for manipulation.
There are two main reasons people ever use "char*" in C++: either they haven't learned std::string yet (meaning they are within a few weeks of having started to learn C/C++); or they are writing code that interfaces to a C library or an API written in C. If that is not your case, use std::string, it will surely be more convenient and it is usually compatible with most C-string functions too, but with stringstreams and ifstream all functionalities you might desire are already available.
The saying goes that good C++ programmers actually program in "++C" because they make use of the added features over its predecessor (C), while poor C++ programmers think they are using an improvement over C but they are actually only getting the original value. So, please try and use the best tools for your job, and, unless there are special constraints, the C++ standard libraries usually has the better tools over C libraries.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...