CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: davidk

Search: Search took 0.04 seconds.

  1. Replies
    7
    Views
    3,520

    Re: can't send WM_KEYDOWN correctly?

    Consider keybd_event() function, it emulates keyboard events, but it will work only if your window is focused.

    Use WM_SETTEXT message to add text into that window, it has not to be focused.
  2. Thread: String in c++

    by davidk
    Replies
    6
    Views
    830

    Re: String in c++

    If you are using big text files (or where else do you use such a big string?) then it is better to read them by small parts or start using file mapping.

    You never know how big a file may be, so...
  3. Re: Reading in only first couple lines of input file

    Basically, the same loop as first one, but change the variable 'Total' to 'Total2'.

    Consider using arrays instead of variables like 'Total*' in case you wanna read next 3 days, or even more.
  4. Replies
    12
    Views
    1,421

    Re: Simple Email Sending

    Go through your code line by line with a debugger. Check what you are receiving from the mail server. You may also print the messages you are sending and receving to STDOUT, this may help.

    Tell us...
  5. Re: Reading in only first couple lines of input file

    Use another loop, something like


    for(int k=25; k<=48; k++)


    Also, you have to add to 'total' variable, not overwrite its data.


    Total2 += Data1;
  6. Replies
    5
    Views
    1,458

    Re: UTF8 length calculation

    Use mbrtowc() function, it will help you to check the length of every character.
  7. Replies
    7
    Views
    760

    Re: How do you handle such cases?

    Use MessageBox() or printf() functions to see the place of code where your program fails. It may take some time to resolve but is useful method when no debuggers or other helpful tools are near.
    Use...
  8. Thread: Output to file

    by davidk
    Replies
    2
    Views
    4,407

    Re: Output to file

    I'll add some details on how to open the file to append the data to it:


    FILE *f = fopen("your_file", "a");
  9. Replies
    6
    Views
    912

    Re: Redefination problem

    It is not possible to declare variables of the same name twice.
    You have already declared array 'myArray', if you want to declare a pointer to it, name it differently, e.g.


    char *myArray_ptr =...
  10. Thread: Polymorphism

    by davidk
    Replies
    28
    Views
    2,558

    Re: Polymorphism

    Consider this:


    ...
    class A
    {
    friend class B;
    ...

    Now class B may call protected function from class A.
  11. Replies
    7
    Views
    18,754

    Re: Converting wchar_t* to char*

    To properly convert wchar_t to char you may use wcsrtombs() standard function. You may specify any encoding to use and the function is completely safe.
Results 1 to 11 of 11





Click Here to Expand Forum to Full Width

Featured