Skip to content

C / C++ / MFC

C, Visual C++ and MFC discussions

This category can be followed from the open social web via the handle c-c-mfc@forum.codeproject.com

111.5k Topics 465.7k Posts
  • Inverted linked list in C

    data-structures help
    3
    0 Votes
    3 Posts
    4 Views
    D
    By "inverted" do you mean you want to print your list in reverse order? E.g. input: 1 2 3 4 5 output: 5 4 3 2 1 "One man's wage rise is another man's price increase." - Harold Wilson "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
  • Can you make a serial port hooking program?

    com question
    5
    0 Votes
    5 Posts
    2 Views
    C
    Meanwhile "member" - describe your background. Still in school? Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.
  • 0 Votes
    9 Posts
    26 Views
    L
    Unfortunately I don't know of such a list and I couldn't find one either. There are lists of CPUID dumps.. not very convenient
  • foreach() ??

    database design tutorial question lounge
    6
    0 Votes
    6 Posts
    10 Views
    J
    Better is subjective. For example if you modify the existing code to the following line then you should continue to use the existing solution qDebug()<< "index=" << i << " local adapter address" << localAdapters.at(index).address().toString();
  • "C++ is static (language)..."

    question c++ help
    4
    0 Votes
    4 Posts
    4 Views
    J
    Member 14968771 wrote: will not. when used as STATIC. Presumably you mean... First you tried something without 'static' in place and it worked. Second you put 'static' somewhere and now it doesn't work. The console output does not show up. Not really a lot of information there. So the following are some possibilities for that behavior. - You recompiled, it failed, and then when you ran something it did not find the binary. So it didn't actually run. - You recompiled, it worked (because someone has some 'clever' code) and it failed with an exception. But you did not see that exception output or ignored it. - You recompiled, it worked (because someone has some 'clever' code) and that other code worked. But you did not see any output because the actual method that was called, which is a different one, does not do console output.
  • CRichedit and CDC

    graphics debugging csharp visual-studio json
    5
    0 Votes
    5 Posts
    13 Views
    F
    Thanks Richard’s it looks really nice wish I could post a .jpg
  • Heap Corruption Durning Streamin

    data-structures
    4
    0 Votes
    4 Posts
    3 Views
    F
    When I overlay storage on z/os I get a s0c4 pic 10,11 etc my recovery gets control and I can pretty much determine what happened I had a record count at of x196e It actually happened at record x1905 had no idea where to look inserted crtmemory check at my new’s and map::insert Finally got it wondering if there is easier way to figure out storage/heap issues thank you
  • Why "so many " - include , forward declaration...

    c++ com design sysadmin debugging
    6
    0 Votes
    6 Posts
    0 Views
    J
    Member 14968771 wrote: even with the comment "things grow in complexity ".... Have you worked with legacy systems? Systems that have been in continued use for 20 years with ongoing changes throughout that time period? And for a product that has started with a small customer base but which has grown to many? Google for example... "span a whopping 2 billion lines of code that stretch across 1 billion files and require 86 terabytes of storage," Don't you suppose there are some less than ideal code in that? Or if you prefer GCC is roughly 15 million lines of code. Member 14968771 wrote: and that should be all ( objective) what is needed That is of course specifically subjective. And you will not find any non-trivial application code base in C++ where the vast majority of files follow that model. Most will have many include files. Sometimes there are even include files that are nothing but a container for other include files (and that can recurse.)
  • Why #if 0 ... #endif

    sysadmin
    4
    0 Votes
    4 Posts
    0 Views
    CPalliniC
    Quote: BUT does #if 0 evaluates to "true " ? 0 evaluates to 'false' see, for instance, the bottom line of this page: If (The C Preprocessor)[^] Quote: I have been using #ifdef BYPASS #endif where BYPASS is not defined to skip the enclosed block The compiler skips the code if BYPASS is not defined (that is, the 'condition' is 'false'). "In testa che avete, Signor di Ceprano?" -- Rigoletto
  • Where does this .exe store its pane layout?

    windows-admin question
    3
    0 Votes
    3 Posts
    0 Views
    B
    OK, found a solution: - install Process Explorer - add Evan.exe process/subprocess monitoring - Filter subsequently for file/registry access - Found HKCU\SOFTWARE\EVAN with size data - delete this key in regedit.
  • 0 Votes
    2 Posts
    0 Views
    CPalliniC
    Well, they claim the device independent one are faster (Bitmap Classifications - Win32 apps | Microsoft Learn[^]. You could arrange a test in order to have experimental evidence. "In testa che avete, Signor di Ceprano?" -- Rigoletto
  • CRichEditCtrl size limit

    question
    3
    0 Votes
    3 Posts
    0 Views
    F
    Thanks
  • what I am doing regarding Heap corruption

    c++ help
    6
    0 Votes
    6 Posts
    2 Views
    F
    I removed all of the storage allocations out of my DLL and it seemed to worked by tonite I should be able put this piece to rest. if not i will consider and/or take your advice thanks
  • Heap Storage Corruption

    data-structures
    11
    0 Votes
    11 Posts
    1 Views
    CPalliniC
    If I got you, the code should return the hexadecimal representation of a bunch of bytes. In order to avoid CRT-conflicts, you have to make the caller responsible of the output buffer allocation/deallocation. Something like this #include #include using namespace std; // in [INPUT] - the binary array we wish to represent with an hex string // size_in [INPUT] - the size (bytes) of the binary array // out [OUTPUT] - the buffer receiving the hexadecimal representation of the binary data // out_size [INPUT] - the size of the buffer. It should be at least (size_in*2+1) in order ot represent all the input data size_t to_hex( unsigned char in[], size_t size_in, char out[], size_t size_out) { size_t n; for (n=0; (n < size_in) && (n < (size_out-1)b/2); ++n) { unsigned char nibble; nibble = (in[n] >> 4); // the MSB nibble out[2*n] = nibble < 10 ? nibble + '0' : nibble - 10 + 'A'; nibble = (in[n] & 15); // the LSB nibble out[2*n+1] = nibble < 10 ? nibble + '0' : nibble - 10 + 'A'; } if ( 2*n < size_out) out[2*n] = '\0'; return n; } // a little test int main() { unsigned char small[] = { 0x25, 0x37, 0x48, 0x42, 0x42 }; char buffer[41]; size_t size = to_hex( small, sizeof(small), buffer, sizeof(buffer)); cout << "converted bytes " << size << ", hex string " << buffer << "\n"; unsigned char large[256]; for (size_t n=0; n<256; ++n) { large[n] = n; } size = to_hex( large, sizeof(large), buffer, sizeof(buffer)); cout << "converted bytes " << size << ", hex string " << buffer << "\n"; } "In testa che avete, Signor di Ceprano?" -- Rigoletto
  • 0 Votes
    19 Posts
    4 Views
    C
    Ok, tank you
  • To be deleted...

    question
    3
    0 Votes
    3 Posts
    0 Views
    D
    If this is truly C# code, mightn't you be better served posting it in the C# forum? "One man's wage rise is another man's price increase." - Harold Wilson "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
  • Trying to Disable string operator=

    tools csharp visual-studio data-structures
    9
    0 Votes
    9 Posts
    0 Views
    F
    Thanks I think the fact that I was inserting a null byte into a string caused the assertion Thank you
  • 0 Votes
    6 Posts
    0 Views
    L
    Charlie, charlieg wrote: I guess it's in a header file but not in the binary. Thank you You are welcome.
  • dll access violation with Excel 32 / 64 bits

    c++ csharp visual-studio help
    2
    0 Votes
    2 Posts
    0 Views
    V
    Why did you declared it as double __stdcall fA(INT64&); not as double __stdcall fA(double&);
  • 0 Votes
    2 Posts
    0 Views
    L
    The question is impossible to answer since we have no idea how the access control software works. You need to contact the manufacturers of the door for help.