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
  • Reading sectors

    debugging help question workspace
    23
    0 Votes
    23 Posts
    4 Views
    _
    Thanks, solved.
  • asign to return value

    question
    14
    0 Votes
    14 Posts
    0 Views
    _
    Internally it's just continuous memory that is allocated for a 2 dimensional array (For any no. of dimensions for that matter). The compiler uses the specified dimensions to calculate the offset into the memory to fetch. For instance, offset of Chart[2][3] could be calculated as - (sizeof(ChartNode) * MAXROW * 2) + (sizeof(ChartNode) * 3) «_Superman_»  _I love work. It gives me something to do between weekends. _Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
  • Strange chars

    debugging windows-admin linux question
    35
    0 Votes
    35 Posts
    0 Views
    L
    That looks quite likely that some entries in your list are either corrupt, or have not been set to a valid entry.
  • Waarom werkt Gmail niet in Google Chrome?

    com question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Waarom werkt Gmail niet in Google Chrome?

    com question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Passing an array as argument to a function (2)

    data-structures question
    14
    0 Votes
    14 Posts
    0 Views
    C
    ok
  • Property Sheet Display issues

    tools help question
    3
    0 Votes
    3 Posts
    1 Views
    L
    I have run your dialog and tried various changes to see if it affects it but nothing seems to go wrong. It may be worth checking the versions of Windows that the clients are running to see if that is a common factor.
  • Parsing the Command Line

    sysadmin json question
    9
    0 Votes
    9 Posts
    0 Views
    D
    Awesome. I had no idea such a routine existed. :thumbsup: "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
  • 0 Votes
    4 Posts
    0 Views
    D
    I'm sure there are many ways to skin this cat, but how about a loop that reads each line of the file into a string type, then calls string::find() for things like "49-" and "-49"? If one of those is found, then do something similar with the 13. Would that work? "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
  • array of 32bit container

    c++ com docker data-structures tutorial
    10
    0 Votes
    10 Posts
    0 Views
    L
    Well you cannot create it in memory like that. You need to rethink what you are trying to do and understand the hardware and software limitations of the system you are working on.
  • DeviceIoControl return Incorrect function error

    com debugging help tutorial question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • File Explorer Properties Dialog - SOLVED

    c++ question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • OpenGL stencil not working...

    graphics com game-dev help tutorial
    4
    0 Votes
    4 Posts
    2 Views
    V
    Here is my latest code. I'll try to delete my debugging stuff. Hope I 'll not delete something important. The code basically works, it does apply the stencil - to show only data INSIDE the stencil circle. BUT ONLY when I enable viewing of the stencil AND data being written to the color buffer. I have highlighted the code. I was under the impression this is ONLY for viewing the stencil, but apparently not. Obviously I do not have to re-able the color buffer , hence I get BOTH - stencil and the stencilled "fragment". I have no idea how to proceed and where is my error. // glClear( GL\_STENCIL\_BUFFER\_BIT | GL\_DEPTH\_BUFFER\_BIT | GL\_COLOR\_BUFFER\_BIT); glDisable( GL\_STENCIL\_TEST); glEnable(GL\_STENCIL\_TEST); // clear all three buffers glClearStencil(0x0); glClear( GL\_STENCIL\_BUFFER\_BIT | GL\_DEPTH\_BUFFER\_BIT | GL\_COLOR\_BUFFER\_BIT); glStencilMask(GL\_TRUE); // MUST enable writing to stencil buffer (??) **// turn off writing to color buffer glColorMask(GL\_FALSE, GL\_FALSE, GL\_FALSE, GL\_FALSE); // enable only to verify the stencil //glColorMask(GL\_TRUE, GL\_TRUE, GL\_TRUE, GL\_TRUE);** // setup stencil function // function - test always are ref and mask bogus , ignored ? // referrence // mask glStencilFunc(GL\_ALWAYS, 1, 1); // setup stencil operation //glStencilOp(GL\_REPLACE, GL\_REPLACE, GL\_KEEP); // ?? // blank here //glStencilOp(GL\_KEEP, GL\_KEEP, GL\_REPLACE); // get stencil // TODO need parameter here to verify parameter\_stencil = 42; parameter\_stencil = Stencil(parameter\_stencil); // parameter); glFlush(); // blank here // switch keep area if (parameter\_stencil == 0) { printf( "\\nStencil full circle parameter %i @function %s @line %i", parameter\_stencil, \_\_FUNCTION\_\_, \_\_LINE\_\_); glStencilFunc(GL\_EQUAL, 1, 1); } // keep inside circle else { printf( "\\nStencil last circle parameter %i @function %s @line %i", parameter\_stencil, \_\_FUNCTION\_\_, \_\_LINE\_\_); glStencilFunc(GL\_NOTEQUAL, 1, 1); } // keep all outside of stencil { // apply stencil //int OpenGL\_Render\_RealAxis(int parameter = 0) //OpenGL\_Render\_RealAxis(); // int parameter = 0) OpenGL\_Render\_Plus\_IMG\_Axis(); //int parameter = 0) //OpenGL\_Render\_Minus\_IMG\_Axis(5); //passed temporary last circle as parameter = 0) } from here I am not sure how to display only the rendered frag
  • 0 Votes
    7 Posts
    0 Views
    L
    Done it myself occasionally.
  • 'get_osfhandle': identifier not found

    c++ visual-studio com linux help
    4
    0 Votes
    4 Posts
    2 Views
    L
    Yes, I was well aware of that. I have been using WSL for some time, but maybe I should upgrade to WSL2. Thanks for the link.
  • 0 Votes
    10 Posts
    1 Views
    V
    It is now working, however, the mechanics are NOT what you have presented. The initial problem was to pass a parameter to the passed function such as Stencil(parameter); // parameter); Now in my poor English interpretation I have A function OpenGL_Stencil with first argument int (*Stencil)(int) and second argument int parameter The OpenGL_Stencil returns int which is not currently used. The first argument - function takes the second argument as a -parameter- and returns it. The returned value is used to switch the code which follows. That was the original task , however, I could just use the passed second argument to do the switching, without the use of the return value. But that is just the way I like to make sure the code is actually processing the first argument - the function. I believe my original misunderstanding was trying to pass the second argument - parameter _ as a argument to the first argument - the function. Next task - pass multiple arguments or a pointer.... Many thanks for your help, really appreciate it. Cheers.
  • Accessing HDD drive

    csharp com collaboration help question
    11
    0 Votes
    11 Posts
    0 Views
    _
    Yes, the name of the drive is correct, that is for sure. And I have tried: HANDLE hFile = CreateFileW(L"\\\\\\\\.\\\\PhysicalDrive2", GENERIC\_READ, FILE\_SHARE\_READ | FILE\_SHARE\_WRITE, NULL, OPEN\_EXISTING, FILE\_ATTRIBUTE\_NORMAL, NULL ); TRACE("Handle: %X %p", hFile, hFile); CloseHandle(hFile); and the result was: Handle: 434 00000434. So this prove that I have read it successfully ?
  • computational cost of math functions

    question
    13
    0 Votes
    13 Posts
    0 Views
    C
    thanks for positive feedback, there`s plenty to learn
  • Math problem with C code

    database graphics game-dev regex help
    4
    0 Votes
    4 Posts
    2 Views
    V
    I am not so sure how to answer this (honestly). Maybe I should get a different hobby - like basket weaving... For what it is worth I started with IMG and then realized it was wrong struct, but changed only part of the code !
  • 0 Votes
    3 Posts
    1 Views
    V
    Thanks, you may have answered my other problem. ( I'll posting it soon.) At this point I use struct sort-off attached to a class. Not static. I am saying sort-off because the main code is OpenGL and it does not work well in C++ class. I do not foresee any other code to modify it. But for learning experience I'll go with passing the struct via pointer to the function which is also "passed" as parameter to another function. Pretty convoluted , mostly because OpenGL "pipe" architecture. But so far it id working as expected.