Remove the address operator:
bResult = ReadFile(hCom, inBuffer.GetBuffer(1), 1, &nBytesRead, NULL);
Also: Don’t forget the matching call to ReleaseBuffer. And for adding that character
allData += inBuffer;
should be sufficient.
More Related Contents:
- How to deal with c-string pointers [closed]
- Lowercase letters that did not appear in the array, in order [closed]
- I keep getting a segfault every time I run this program, but I cannot understand why
- What is the lifetime of the result of std::string::c_str()?
- Proper way to copy C strings
- Can a std::string contain embedded nulls?
- How do you convert CString and std::string std::wstring to each other?
- What is the reason for not being able to deduce array size from initializer-string in member variable?
- Using a C string gives a warning: “Address of stack memory associated with local variable returned”
- C++ Read file line by line then split each line using the delimiter
- Returning ‘c_str’ from a function
- CLion C++ can’t read/open .txt file in project directory
- What is a vector of vector of point? [closed]
- How do I select a range of values in a switch statement?
- how to initialize a constexpr reference
- C++11 inheriting constructors and access modifiers
- How can I find the actual path found by BFS?
- How do I sort the texture positions based on the texture indices given in a Wavefront (.obj) file?
- what is the difference between set and unordered_set in C++?
- Understanding the example on lvalue-to-rvalue conversion
- Unoptimized clang++ code generates unneeded “movl $0, -4(%rbp)” in a trivial main()
- What is the fastest way to change a key of an element inside std::map
- Convert C++ function pointer to c function pointer
- Critique my non-intrusive heap debugger
- How to detect IP address change programmatically in Linux?
- Unbuffered output with cout
- How to increment an iterator by 2?
- Extra leading zeros when printing float using printf?
- How to get CMake to recognize pthread on Ubuntu?
- Forward declaration & circular dependency