Jump to content

Mijzelf

Member
  • Posts

    464
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    country-ZZ

Posts posted by Mijzelf

  1. When it's browser sniffing, maybe you can use the 'F12->Edit site preferences->Network->Browser identification->Mask as Internet Explorer' trick. After a refresh (F5) the site should 'think' you're using IE.

  2. I think so. It runs on W95A, but I had to install 'Windows Installer 2.0' due to a lacking msi.dll. (Beats me where Opera needs it for). Further I had to download the 'Classic installer' version of Opera, which is a bit harder to find, because the default installer wanted me to install IE 3.1 first. (!). And of course Opera is complaining about a missing or too old Msimg32.dll, just like v9.5 did.

    But it runs fine. So far the only problem I have seen is a font problem in the Transfers window. All numbers (download size, -speed) are just greek.

    (Take that, Mozilla, OpenOffice.org and AbiWord!)

  3. What shall I say? You must be mistaken. One of the if-statements have to evaluate differently. A debugger should be handy. You can add some tracing lines:

    #include <stdarg.h>

    void DoTrace( const char *format, ... )
    {
     static char Buffer[ 512 ];
     va_list ap;
     va_start( ap, Format );
     _vsnprintf( Buffer, sizeof( Buffer ), Format, ap );
     OutputDebugString( Buffer );
     va_end( ap );
    }

    #ifdef _DEBUG
    # define TRACE DoTrace
    #else
    # define TRACE //
    #endif

    int replaceText(char *findWhat, char *replaceWith, BOOL bWholeWord, BOOL bMatchCase, BOOL bSearchDown) 
    {
     CHARRANGE cr;
     int foundText = 0;
     SendMessage(g_hRichEdit, EM_EXGETSEL, 0, (LPARAM) &cr);
     
    TRACE( "(%u): cr.cpMin == cr.cpMax => %u\n", __LINE__, cr.cpMin == cr.cpMax );
     if (cr.cpMin == cr.cpMax) foundText = searchText(findWhat, bWholeWord, bMatchCase, bSearchDown);
     else {
      CHARRANGE crText;
      FINDTEXTEX ftex;
      ftex.chrg = cr;
      ftex.chrgText = crText;
      ftex.lpstrText = findWhat;
      SendMessage(g_hRichEdit, EM_FINDTEXTEX, 0, (LPARAM) &ftex);
    TRACE( "(%u): ftex.chrgText.cpMin == cr.cpMin && ftex.chrgText.cpMax == cr.cpMax => %u\n", __LINE__, ftex.chrgText.cpMin == cr.cpMin && ftex.chrgText.cpMax == cr.cpMax );
      if (ftex.chrgText.cpMin == cr.cpMin && ftex.chrgText.cpMax == cr.cpMax) {
      MessageBox(NULL, "About to replace!", "Kladblok", MB_OK);
      SendMessage(g_hRichEdit, EM_REPLACESEL, TRUE, (LPARAM) replaceWith);
      }
      foundText = searchText(findWhat, bWholeWord, bMatchCase, bSearchDown);
     }
     return foundText;
    }

    You can catch the output of OutputDebugString with DebugView, which is a tool from SysInternals. Alas Mark Russinovich is dumping all W9x support from his tools, but happily the old versions are still available at archive.org: http://web.archive.org/web/20050105011752/...debugview.shtml. (BTW, _vsnprintf is an MS function. You'll have to find the Borland equivalent.)

  4. Then it's overwritten or hidden by another variable.
    I forgot the 3rth possibility. It's not yet filled. You read g_szFileName in WM_CREATE, which is called inside CreateWindowEx() in WinMain(). g_szFileName is filled after this.

    FYI, I didn't see this directly, so I did some debugging-without-debugger magic. I exchanged 

    char *g_szFileName[MAX_PATH] = "";

    by

    #define _DEBUG
    #ifdef _DEBUG
    char *fun_szFileName(int line)
    {
     static char _szFileName[MAX_PATH] = "";
     char buf[ 16 ];
     MessageBox( 0, itoa( line, buf, 10 ), "szFileName", MB_OK );
     return szFileName;
    }
    #define g_szFileName fun_szFileName(__LINE__)
    #else
    char *g_szFileName[MAX_PATH] = "";
    #endif

    Now it's easy to see when and from where g_szFileName is accessed. For more complex problems you'd better use a logfile instead of a messagebox.

  5. By the way, since switching to Rich Edit Control 2.0, search is done backwards, with only one result found each time. What the hell is this?!
    There is a difference between v1 and v2: http://msdn.microsoft.com/en-us/library/bb788009(VS.85).aspx. Did that bite you?
    For some reason when my program gets here g_szFileName is empty!
    Then it's overwritten or hidden by another variable. Did you declare some array directly before or after g_szFileName? Check if you don't exceed their bounds. You don't have a debugger, I suppose?
  6. Have a look here:http://en.wikipedia.org/wiki/UTF-8#Description

    UTF-8 uses 1,2,3 or 4 bytes a character depending on the numerical value of the (unicode) character. When saving a file in UTF-8, notepad will add a header 0xEF 0xBB 0xBF. A file starting with this sequence you can consider UTF-8 encoded. Another file *might* be UTF-8 encoded too, but there's no way to be be sure. Read this

    Ansi is a 'strange' standard (actually it isn't a standard), so the best way to convert Ansi to UTF-8 is converting it to unicode with MultibyteToWideChar, and then convert this to UTF-8.

  7. PILY, like pile or wool.

    PILA, a town in Poland.

    SILA, a city in the United Arab Emirates.

    ŠAĽA, a city in Slovakia.

    SABA, an island of the Netherlands Antilles, containing the highest point (877 m) of the Kingdom of the Netherlands

  8. I configure the router so that it uses a WEP key. I type in a 10 digit passphrase, generate, then apply on the netgear web page (from a different computer).
    There are two ways to enter a wep key. Typing a hexadecimal code, or typing an alphanumeric passphrase. This passphrase is converted internally to a hexadecimal code. It's not a good idea to use the passphrase option, since the algorithm which does the conversion is not standardized. So different brand NIC can use different algorithms, generating a different key.
    When I go into the advance property to enter the key, it asks for a 40 bit or 104 key, whereas, for Netgear, it uses a 64 or 128 bit key.
    64 bits wep uses a 40 bit (10 hexadecimal characters) key. The remaining 24 bits are created internally. The same is true for wep 128 and 104 bit (26 hex characters).

    If you have the choice, you should not use wep, but wpa, or even better wpa2. Wep can be cracked in minutes, these days.

×
×
  • Create New...