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
  • 0 Votes
    9 Posts
    1 Views
    F
    Would that code get what's in the rich edit good to know I did find the bug in my code What works in the debug version does not necessarily work in release by doing research the bugs have to do with the heap in my case I had forgotten to initialize CStatic *pointers after adding the '= new' code I resolved the problem thanks
  • 0 Votes
    7 Posts
    0 Views
    L
    ForNow wrote: all these worker threads (ntdll.dll) that seem to have come up okay But that does not mean anything. The only way to solve this sort of problem is by tracking back to the point where the fault is created. This may be a simple bug in your code, cross-thread corruption, or any one of a million other things happening.
  • 0 Votes
    4 Posts
    0 Views
    K
    I added these lines. There is still no effect. Please take a look at the code i postet with a thread i made in questions. I think it has something to do with the way i manage the edit control where directx is supposed to render. It would be really nice if you take a look in my other thread. Thanks a lot.
  • Recursive directory search

    question
    5
    0 Votes
    5 Posts
    0 Views
    D
    When the function is called again, all of the context information is pushed onto the stack and the new function call starts. When the function unwinds, the most recent context information is popped from the stack and the function picks up where it left off. This is all handled automatically by the system. "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
  • Mice with 3 buttons

    question
    3
    0 Votes
    3 Posts
    0 Views
    J
    Many mice have a scroll wheel which is also the middle button. If you have such a mice, just try to press the wheel instead of scrolling it. So only the simplest / cheapest mice have only two buttons. Many even have more than three buttons nowadays.
  • The messages used by mice and joysticks

    game-dev question
    2
    0 Votes
    2 Posts
    0 Views
    L
    See Processing Joystick Messages (Windows)[^] (found first time by Google).
  • Trying to understand my mistake... with pointers

    help performance announcement
    3
    0 Votes
    3 Posts
    1 Views
    L
    You haven't given us the implementation of this prototype function void eeprom_update_byte (uint8_t *__p, uint8_t __value); Implicit declaration error usually means you provided a prototype but no body code ... hence I am worried you haven't given me that functions code. I am assuming the EEPROM is flash and that code will do what we call the toggling test until it writes the byte to the flash. Warning if it is FLASH you usually also have to release protection registers by writing special commands to special addresses before you can write to the flash, did the original code also provide a function to release the protection on a sector per chance? However onto your code as it stands, you are passing in the address to write as a byte which gives you a range of 0-255 in memory see here bool Update_EEPROM_Memory_byte(byte val1, byte val2) { // Val1 is a byte uint8_t eepromAddr = val1; // <== Really a byte as the address you can only write to memory address 0--0xff uint8_t eepromVal = val2; The original function they provided had a pointer to an byte (uint_8) which will be most likely be 32 bit ... see void eeprom_update_byte (uint8_t *__p, uint8_t __value); // First parameter is a pointer see the "*" I suspect you need your address to be a long ..... try bool Update_EEPROM_Memory_byte(unsigned long val1, byte val2){ unsigned long eepromAddr = val1; // <== Now you can write to memory address 0-0xffffffff uint8_t eepromVal = val2; Adjusted last function to take the long bool eeprom_memory_update_byte(unsigned long eeprom_addr, uint8_t eepromValue) { eeprom_update_byte((uint8_t*) eeprom_addr, eepromValue); uint8\_t eepromVal = eeprom\_read\_byte(( uint8\_t \*) eeprom\_addr); if (eepromValue == eepromVal) return 1; else return 0; } The alternative to an unsigned long for the address is to keep it as a pointer (uint8_t*). That all means nothing if you have no code for the function eeprom_update_byte which isn't shown. Other housekeeping Update_EEPROM_Memory_byte should return the result of eeprom_memory_update_byte rather than a static 1 (TRUE) result. In vino veritas
  • please help me with this problem

    help
    2
    0 Votes
    2 Posts
    1 Views
    L
    It's called string formatting and you want leading zeros Here is the full reference printf - C++ Reference[^] Look at the sample with leading zeros ... which will be in your case you want 6 digits printf ("Preceding with zeros: %06d \n", 6); printf("Preceding with zeros: %06d \n", 28); printf("Preceding with zeros: %06d \n", 66); In vino veritas
  • please help me with this problem

    help
    2
    0 Votes
    2 Posts
    0 Views
    Richard DeemingR
    Do not repost. You have already posted this homework question in the thread immediately below. 2) We do not do your homework. It's set to test what you know, not how good you are at getting strangers on the Internet to do your work for you. Try it yourself, and you'll probably find it's not as difficult as you think. After all, it will be based on topics you've recently covered in your course. If you're still stuck, then talk to your teacher. "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • variadic templates problem

    help c++ wpf question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • how to create a file input button in microsoft visual c ++ ?

    tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    L
    Well I would start with a Windows (Win32 or MFC) application with some buttons and views on the UI, and some code behind to read the files. See theForger's Win32 API Tutorial[^] and Win32 Programming - FunctionX[^] for lots of sample code.
  • Help With Exception

    debugging help c++ visual-studio data-structures
    8
    0 Votes
    8 Posts
    0 Views
    F
    it was the SetAt Truthfully I never called the constructer so CString tempstr(&PSW.ia,16); Thanks
  • Choosing between strings

    database data-structures help question
    2
    0 Votes
    2 Posts
    0 Views
    L
    Anthony Appleyard wrote: is there such a standard library function No, you will need to write your own.
  • Newbee Exception handling Guidance

    csharp c++ visual-studio data-structures debugging
    13
    0 Votes
    13 Posts
    0 Views
    J
    Ok, ok you got me there :-D. We've recently run into this, where the propagation delay of HC logic was too slow for the MCU we were using, and yes we threw in some delay. In this instance though, it was old Motorola HC11, and there was a floating input and the input read would be different depending on, apparently, the instructions that were being executed just before the read. "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
  • Get Window Handle to Modless Dialog Box After Create

    4
    0 Votes
    4 Posts
    0 Views
    F
    Ok Thanks rebuild see what happens
  • Generate Unique Ids

    c++ tutorial
    3
    0 Votes
    3 Posts
    1 Views
    L
    What you are making is called a hash table but you have a linking requirement. This will need a linked list due to this part of the requirement => if later anyone calls delete id, all the sub-uids string should get deleted. In its simplest form your substring structure using ID's will be struct uiString { unsigned long uid; // here assumed your ids' are 32 bits struct uiString* next; // Pointer to next substring }; The humour is your uid is the same length as just holding a pointer to the string which is guaranteed unique :-) You bascially keep deleting a each "next" sub string until your reach NULL for your above requirement. Unless the text is in or going into a database I can't see a point to the uid you might as well use the pointer to the text as the uid. So I guess the question I ask is what is the purpose of the hash table .. security? In vino veritas
  • learning steganography

    tutorial question learning
    2
    0 Votes
    2 Posts
    0 Views
    L
    Most likely yes, and Google will find them for you.
  • how to make steganography in C++

    c++ help tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    J
    in the line- shift coding method , using ways of working to manipulate the document by shifting the vertical lines of text based on the bits you want to insert. so what steps should I do if I make a program with the method using c ++ ? thank you :)
  • protected access specifier

    question
    10
    0 Votes
    10 Posts
    0 Views
    L
    Excellent, you have solved your problem.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied