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
  • 코리아카지노˚&˚UPK9。COM˚&˚코리아카지노

    com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • uint32_t result of uint16_t addition

    question
    5
    0 Votes
    5 Posts
    0 Views
    R
    First of all: Casting happens implicitly so you don't need to cast in this scenario. Secondly: These types that you are specifying in non-standard types, so uint32_t could be defined as anything which will give you an incorrect result. Thirdly: How to you check what the result is? Though debugging or though a print statement? The print statement could be wrong. Fouth: Know your platform you writing the code for (its limitations and the standard it is using). Not necessarily that the pic32 uses the specific c standard which you are looking at. "Program testing can be used to show the presence of bugs, but never to show their absence." << please vote!! >>
  • appending to file

    linux help question
    3
    0 Votes
    3 Posts
    0 Views
    D
    Member 12084559 wrote: ?????? We have the same question! What does the code look like? You've told us what you want, and what is actually happening, but without seeing the code, it's anyone's guess. "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
    10 Posts
    0 Views
    J
    Member 12084559 wrote: i Know i have to use if and else statements i just don't know how to integrate them into the file. Priceless! You just made my day, sir! Best, John -- LogWizard - Log Viewing can be a joy!
  • 0 Votes
    4 Posts
    0 Views
    P
    This reeks like homework, have you asked your instructor for help? "I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
  • 0 Votes
    3 Posts
    0 Views
    N
    Thank you sir.
  • Login System

    help tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Podofo Pdf Library GetGlyphID?

    data-structures help question json
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Porting from MFC to QT

    c++ help tutorial
    4
    0 Votes
    4 Posts
    0 Views
    A
    As others have eluded, I don't think there is an "easy way" to port the code over. You'll have to basically start re-writing things and solve problems as they come up. Having written things in both MFC and Qt, you may end up doing a lot of re-design since the frameworks can vary quite a bit with some things. If you're looking for something that may be easier to port so that it works in other platforms (i.e.Linux), WxWidgets may be an easier port.
  • 0 Votes
    3 Posts
    0 Views
    L
    Please don't repost the same question; I have deleted your duplicate. If you have extra information to add, then edit this one.
  • I want to know about something ?

    c++ help question learning
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • get the a 2days time dif fromcurrent time.

    7
    0 Votes
    7 Posts
    0 Views
    D
    The C-2011 standard does not specify the epoch or the resolution of time(). The POSIX standard specifies the epoch as 1970-01-01 00:00:00, and the resolution as seconds. The fact that most runtime libraries follow the POSIX standard should not blind you to the fact that using this function to perform date arithmetic is inherently non-portable. If you wish to perform date/time manipulations, you should use the functions that operate on the 'tm' structure. If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill
  • 0 Votes
    3 Posts
    0 Views
    C
    hi, i read the article on wikipedia and i understand it but the problem is that i don't know how to implement it to my minimax :(( here is my minimax if want to give me an idea .. ;) int miniMax(char wnr, int deep)//Minimax { if (controlloVincita(2))//control win return INT_MAX; if (endgame()) return INT_MIN; int i, j, res, tmp; if (wnr == 1)//se giocatore massimizzante { res = 1; for (i = 0;ires || (tmp == INT\_MAX)) res = tmp; BOARD\[i\]\[j\] = 0; } } } return res; } int get_next_move(unsigned int *i, unsigned int *j) { int max = INT_MIN, mi = 1, mj = 1, t; int alfa = INT_MIN, beta = INT_MAX; for (*i = 0;*imax)// { max = t; mi = *i; mj = *j; } BOARD[*i][*j] = 0; } BOARD\[mi\]\[mj\] = 2;//save the computer move \*i = mi; \*j = mj; return 1; }
  • Windows message for changing color scheme

    question
    5
    0 Votes
    5 Posts
    0 Views
    _
    After few trials, I ended using this code, which seem to work: void CMainFrame::OnSettingChange(UINT uFlags, LPCTSTR lpszSection) { CFrameWnd::OnSettingChange(uFlags, lpszSection); // TODO: Add your message handler code here if(SPI\_SETWORKAREA == uFlags) // do the work } In case that anyone need it ...
  • C: Book recommendations

    question learning
    4
    0 Votes
    4 Posts
    1 Views
    A
    I believe this is a later edition of the book I initially learned C with.... if that is the case, it's a pretty good book that emphasizes proper algorithms, which is great.
  • Set whole Data to a struct with BitFields

    help
    3
    0 Votes
    3 Posts
    0 Views
    L
    You can do it by using a union[^] thus: union MyDef { DWORD W1; struct bits { DWORD B1 : 8; DWORD B2 : 8; DWORD B3 : 8; DWORD B4 : 8; }; }; which maps W1 to the same memory space as the four byte fields. You can now refer to the whole DWORD as W1 of the union structure.
  • how to parse html code in c language

    html tutorial
    2
    0 Votes
    2 Posts
    1 Views
    L
    You already posted this question at How Do I Parse Html Code In C, Thats Give An Excection[^]. Please use one forum only.
  • uploadig adobe reader file in local host in c language

    help php adobe testing
    2
    0 Votes
    2 Posts
    0 Views
    J
    You should not pass the buffer itself as format argument to sprintf. It depends on the implementation (the used standard C library) if it is supported or not. But even if it is supported it is bad style. And in your case it is the reason for the corrupted buffer content here: sprintf(buffer, "%s\r\n", buffer); memcpy(buffer + strlen(buffer),content,lSize); sprintf(buffer, "%s\r\n", buffer); The PDF file is a binary file. While you use memcpy to append the binary data to your buffer, the next sprintf call stops at the first null byte truncating the buffer. A common solution is to use a buffer offset variable which is incremented by the return value of sprintf: int ofs = strlen(buffer); ofs += sprintf(buffer + ofs, "\r\n"); memcpy(buffer + ofs,content,lSize); ofs += lSize; ofs += sprintf(buffer + ofs, "\r\n");
  • CFileDialog OnTypeChange issue

    help question workspace
    4
    0 Votes
    4 Posts
    1 Views
    _
    Yes, there is a solution, but the file dialog has an old style ...
  • A c program to project expected number of rabbits on a farm

    business
    6
    0 Votes
    6 Posts
    0 Views
    D
    Paul Conrad wrote: ...kits are baby rabbits Either designation is correct. "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