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
  • Pf

    c++ game-dev question
    2
    0 Votes
    2 Posts
    0 Views
    CPalliniC
    It depends. If you know in advance what is the word, then the program would simply scan rows and columns of the matrix of letters, searching for the word. On the other hand, if you don't know in adavance the word, then you have to use a dictionary (and possibly invent an algorithm smarter than the brute force).
  • c++ MS Word

    c++ testing tools help question
    4
    0 Votes
    4 Posts
    0 Views
    U
    Thank you! Those were the tutorials I used so far. They recommend to use the macro codes in MS Word to find the desired functions. However, I have trouble converting the macro code in c++. For example: To create a headline, the makro shows this code: Sub Makro() Selection.Style = ActiveDocument.Styles("Überschrift 1") End Sub ("Überschrift 1" means "Headline 1"). Any ideas?
  • 0 Votes
    8 Posts
    0 Views
    N
    Peter and @CPallini, I know it's a long shot, but if you have 10 minutes to read a first draft of my article, I would like to know if it makes sense to you and in this case give me some feedback. The Quest for Maintainable Code and The Path to ECS - Seba's Lab[^] password: readme. I don't want this article to be too abstract, I know that I assume that people know what ECS is (It's not an article about explaining it), but nevertheless I need to know if I face things so abstractly that is hard to see how they are applied in real life. I will gather more significant anecdotes before to publish it.
  • Basic Server/Client TCP/IP Software Examples

    csharp c++ css sysadmin
    9
    0 Votes
    9 Posts
    0 Views
    J
    Bram van Kampen wrote: The My Program Suite is out in the field since 2005... That doesn't have anything to do with your statement about modern programming languages. Bram van Kampen wrote: We do not use standard software because it is too easy to hack! 90% of data loss from companies is due to internal breaches. An employee walks off with the data. Most of the rest is based on employees doing something wrong - like posting their login on a postit on the box. Actual technical "hacking" from outside sources is rare (compared to all business losses). Bram van Kampen wrote: Using C#, what you write gets translated to 'Universal Intermediate Code' to run on the Just in Time c# virtual machine. That intermediate code can easily be decompiled to the original source code, with the loss of function and naming conventions We as an organisation will never entertain it as a way to distribute our code! First I know exactly how C# works. I also know how java, perl, C++, C, assembler and even SQL on various boxes works. I have in fact written several custom compilers and interpreters and have written an IDE as well. Secondly I can see how you feel that that protects your IP, but doesn't have much to do with the statement that I originally responded to.
  • Tools to refactor C++ code - Rad studio

    c++ tools help code-review
    4
    0 Votes
    4 Posts
    0 Views
    S
    A warning typically means that while the code is legitmate with respect to the C++ syntax, the compiler suspects that it might be doing something else than what the programmer intended. Since the computer can't guess what's in the head of the programmer, there's no safe way for it to automatically fix it. If you have so many warnings, it's probably best to watch out for very common types of warnings, pick one of these, and focus on fixing that warning everywhere in the code, ignoring other warnings. Most of the time you'll quickly be able to spot certain patterns, and fixing these errors should therefore be possible almost without thinking after a while. It will still take time, but that way it's probably a lot faster than working on all warnings by order of occurrence. P.S.: if your goal is refactoring the entire code, then eliminating warnings is the last of your concerns! First you need tests, to ensure that the refactored code really produces the same results. Then you need to start with the lowest level functions, and then work your way up. Chances are, that changes in your low level functions require adjustments higher up, and that could very well affect code that currently issues warnings. It would be pointless to fix warnings first and then change that same code again due to low-level refactoring, so you better don't do that so early! GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
  • How to change the background color of checkbox in CListCtrl?

    tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    M
    The complete background is not changing
  • Best Code Refactoring tool for C++ (code gear IDE)

    c++ visual-studio code-review
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    2 Posts
    0 Views
    J
    Immense, but not because of Python, but that you are adding scripting to your app, opening up a lot of vectors for software with bad intent and plain bad software.
  • 0 Votes
    5 Posts
    11 Views
    A
    It's been done. It's called COBOL.
  • SetCheck() for checkbox in MFC GridControl 2.7

    c++ css tutorial
    2
    0 Votes
    2 Posts
    6 Views
    L
    You should post your question in the forum at the end of the article. I know for a fact that the author spends much of his time on CodeProject.
  • Complex multidimensional array in C++

    help question c++ data-structures tutorial
    15
    0 Votes
    15 Posts
    0 Views
    L
    You cannot add initialisers to the struct definition, but only to actual instances of it. So it should rather be something like: struct ILI9341 { // definition of the struct starts here uint8_t index; // tracking index uint8_t Command; // uint8_t c_d; // flag 0 command 1 data uint8_t *Data; // data array // data array format // valid data count // data... // end marker char *Name; // command name char *Function; // brief function description uint32_t delay; // delay in uS after command char *RefPage; // ILI9341 manual reference page char *Notes; // misc notes uint8_t* temp; // this should be a pointer to allow for variable length entries } ILI9341_CommandList[COMMAND_ARRAY] = { // actual instances in the array are initialised here { // first entry in the structure array 0, // tracking index 0, // Command 0, // flag 0 command 1 data buffer, // data array buffer declared elsewhere as BYTE buffer[some number] "command name" // command name "Function", // brief function description 100, // delay in uS after command RefPage, // ILI9341 manual reference page Notes, // misc notes { 0x1, 0x0, 0xFF } // command array - you may need a counter somewhere to indicate // how many entries are in this array }, // end of the first entry { // other entries up to a maximum of COMMAND_ARRAY } }; And you can also fill in any of the fields later in the executable code by addressing struct entries as ILI9341_CommandList[n] where n is in the range [0..COMMAND_ARRAY-1].
  • 0 Votes
    5 Posts
    0 Views
    S
    This forum is for asking questions about problems with code you wrote, not asking for code. Hint: if the problem you have is a very common one, a simple search in your favorite search engine is much more likely to turn up results. But if this is homework, you really should at least try to solve it. Homework is rarely about finding the solution, it is about trying to find the right way towards the solution. Asking for code is the opposite direction - sorry, no points. GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
  • Using hex in an array and "scanning" for it fails.

    database data-structures help
    5
    0 Votes
    5 Posts
    0 Views
    V
    Thanks, I'll check that. I do not want to make excuses , but I think I just copied the test code and missed the "u" , but I did get some - (minus) output when it went crazy.
  • OPC DA3

    c++
    2
    0 Votes
    2 Posts
    0 Views
    L
    OPC sever DA3 - Google Search[^].
  • 0 Votes
    3 Posts
    1 Views
    L
    The LVS_EX_CHECKBOXES style applies to the entire ListView item, not to a specific subitem.
  • How to use

    tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • error: expected identifier before string constant

    help c++ tools
    13
    0 Votes
    13 Posts
    0 Views
    V
    Second argument function is an I2C device address = in this case A/D converter ADS1115.
  • How to recognize a MutliTouch Input Event ?

    question json tutorial
    3
    0 Votes
    3 Posts
    0 Views
    K
    Try this: [Touch Input - Windows applications | Microsoft Docs](https://docs.microsoft.com/en-us/windows/desktop/wintouch/windows-touch-portal)
  • How to recognize a MutliTouch Input Event ?

    question tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    1 Posts
    0 Views
    No one has replied