Click here to Skip to main content
15,901,283 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionBitmaps, device dependent vs device independent, which is faster (or better)? Pin
Member 1507871611-Jan-23 10:57
Member 1507871611-Jan-23 10:57 
AnswerRe: Bitmaps, device dependent vs device independent, which is faster (or better)? Pin
CPallini11-Jan-23 20:43
mveCPallini11-Jan-23 20:43 
Questionwhat I am doing regarding Heap corruption Pin
ForNow10-Jan-23 15:33
ForNow10-Jan-23 15:33 
AnswerRe: what I am doing regarding Heap corruption Pin
CPallini10-Jan-23 20:08
mveCPallini10-Jan-23 20:08 
GeneralRe: what I am doing regarding Heap corruption Pin
ForNow11-Jan-23 1:33
ForNow11-Jan-23 1:33 
GeneralRe: what I am doing regarding Heap corruption Pin
CPallini11-Jan-23 1:40
mveCPallini11-Jan-23 1:40 
GeneralRe: what I am doing regarding Heap corruption Pin
Mircea Neacsu11-Jan-23 7:04
Mircea Neacsu11-Jan-23 7:04 
GeneralRe: what I am doing regarding Heap corruption Pin
ForNow11-Jan-23 7:25
ForNow11-Jan-23 7:25 
QuestionHeap Storage Corruption Pin
ForNow10-Jan-23 3:44
ForNow10-Jan-23 3:44 
AnswerRe: Heap Storage Corruption Pin
Victor Nijegorodov10-Jan-23 5:08
Victor Nijegorodov10-Jan-23 5:08 
GeneralRe: Heap Storage Corruption Pin
ForNow10-Jan-23 5:25
ForNow10-Jan-23 5:25 
GeneralRe: Heap Storage Corruption Pin
k505410-Jan-23 6:17
mvek505410-Jan-23 6:17 
AnswerRe: Heap Storage Corruption Pin
Graham Breach10-Jan-23 6:22
Graham Breach10-Jan-23 6:22 
GeneralRe: Heap Storage Corruption Pin
ForNow10-Jan-23 6:44
ForNow10-Jan-23 6:44 
GeneralRe: Heap Storage Corruption Pin
Graham Breach10-Jan-23 6:51
Graham Breach10-Jan-23 6:51 
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 

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.