Click here to Skip to main content
15,880,469 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Heap Storage Corruption Pin
CPallini10-Jan-23 7:21
mveCPallini10-Jan-23 7:21 
GeneralRe: Heap Storage Corruption Pin
ForNow10-Jan-23 7:26
ForNow10-Jan-23 7:26 
GeneralRe: Heap Storage Corruption Pin
CPallini10-Jan-23 7:40
mveCPallini10-Jan-23 7:40 
AnswerRe: Heap Storage Corruption Pin
CPallini10-Jan-23 8:32
mveCPallini10-Jan-23 8:32 
QuestionTo be deleted... Pin
arnold_w10-Jan-23 1:01
arnold_w10-Jan-23 1:01 
SuggestionRe: Why isn't my semi-editable ComboBox drawing the text in gray when the dropdown list isn't showing? Pin
Richard Deeming10-Jan-23 2:03
mveRichard Deeming10-Jan-23 2:03 
QuestionRe: Why isn't my semi-editable ComboBox drawing the text in gray when the dropdown list isn't showing? Pin
David Crow10-Jan-23 2:07
David Crow10-Jan-23 2:07 
QuestionTrying to Disable string operator= Pin
ForNow8-Jan-23 16:55
ForNow8-Jan-23 16:55 
Hi
I have a number of hex data I am trying to get to printable data I mean ascii

I read them as a byte[] array where byte is typedef for usigned char

I just got this idea it might be easier to manipulate it as string i mean like std::string

so I developed this routine


C++
// converts character array
// to string and returns it
string convertToString(unsigned char* a, int size)
{
    int i;
    string s = "";
    for (i = 0; i < size; i++) {
        s += a[i];
    }
    return s;
}


Here is the piece of code that calls it

C++
returnsource->stmt = convertToString(sourcerecordpointer->statementnumber, 4)


here is the definition

C++
BYTE statementnumber[4];


the data in statement ithe statement number in hex so statement 1 would be

x'00000001'
so my goal the would be to retrun

retrun->stmt as character 0001 or x30303031

Now me thinks that since return->stmt is defined as a string

C++
struct source
{
	string stmt;
	string loc;
	string addr1;
	string  addr2;


that the string operator= is invoked becasue of this


I end up here in Microsoft code in a member utility and get a read exception

this is the path
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.34.31933\include\utility


is there any way I can tell MSVC compiler that all I am trying to do with = operator is accept a return value from my subroutine


C++
template <class _Ty, class _Other = _Ty>
_CONSTEXPR20 _Ty exchange(_Ty& _Val, _Other&& _New_val) noexcept(
    conjunction_v<is_nothrow_move_constructible<_Ty>, is_nothrow_assignable<_Ty&, _Other>>) {
    // assign _New_val to _Val, return previous _Val
    _Ty _Old_val = static_cast<_Ty&&>(_Val);
    _Val         = static_cast<_Other&&>(_New_val);
    return _Old_val;
}

AnswerRe: Trying to Disable string operator= Pin
k50548-Jan-23 17:49
mvek50548-Jan-23 17:49 
GeneralRe: Trying to Disable string operator= Pin
ForNow8-Jan-23 18:02
ForNow8-Jan-23 18:02 
AnswerRe: Trying to Disable string operator= Pin
Victor Nijegorodov8-Jan-23 22:50
Victor Nijegorodov8-Jan-23 22:50 
GeneralRe: Trying to Disable string operator= Pin
ForNow9-Jan-23 3:18
ForNow9-Jan-23 3:18 
GeneralRe: Trying to Disable string operator= Pin
Victor Nijegorodov9-Jan-23 3:56
Victor Nijegorodov9-Jan-23 3:56 
GeneralRe: Trying to Disable string operator= Pin
ForNow9-Jan-23 3:59
ForNow9-Jan-23 3:59 
AnswerRe: Trying to Disable string operator= Pin
CPallini8-Jan-23 23:20
mveCPallini8-Jan-23 23:20 
GeneralRe: Trying to Disable string operator= Pin
ForNow9-Jan-23 1:38
ForNow9-Jan-23 1:38 
QuestionWhere to find connect declaration of this mysql instace Pin
coco2437-Jan-23 13:29
coco2437-Jan-23 13:29 
AnswerRe: Where to find connect declaration of this mysql instace Pin
RedDk7-Jan-23 15:35
RedDk7-Jan-23 15:35 
AnswerRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan7-Jan-23 21:06
mveRichard MacCutchan7-Jan-23 21:06 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco2438-Jan-23 1:27
coco2438-Jan-23 1:27 
GeneralRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan8-Jan-23 1:37
mveRichard MacCutchan8-Jan-23 1:37 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco2438-Jan-23 1:58
coco2438-Jan-23 1:58 
GeneralRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan8-Jan-23 3:04
mveRichard MacCutchan8-Jan-23 3:04 
GeneralRe: Where to find connect declaration of this mysql instace Pin
coco2438-Jan-23 5:53
coco2438-Jan-23 5:53 
GeneralRe: Where to find connect declaration of this mysql instace Pin
Richard MacCutchan8-Jan-23 22:28
mveRichard MacCutchan8-Jan-23 22:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.