Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

henk21cm

@henk21cm
About
Posts
8
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • [Solved] Maximum number of opened files?
    H henk21cm

    Randor wrote:

    'm not sure if your old enough to remember this but in the old MS-DOS days this was achieved by editing a file called CONFIG.SYS in which you could add: FILES=255

    Yes, i do remember, i'm that old that i've been working with punched paper tape and punched cards. Devising a diode array to translate EBCDIC into ASCII. When running into this limited amount of files, CONFIG.SYS was the first file to look for. Under XP it is 0 bytes, not too much space to hold any info of particular value.

    Randor wrote:

    If I am not mistaken I believe the default value in Win95 was 60 handles which was set by IO.SYS in the root boot directory unless overridden in CONFIG.SYS.

    Under DOS (3.2) it was usually set to FILES=20. The default of 8. "Those were the days", compiling programs into .COM files of 512 bytes or less. FCBS=4,4 LASTDRIVE=Z David, we are growing old, but not grumpy! Regards, Henk 21 cm: the universal wave length of hydrogen

    System Admin help question

  • [Solved] Maximum number of opened files?
    H henk21cm

    G'day David,

    Randor wrote:

    henk21cm wrote: The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. This is not correct, what gives you this idea?

    1. The link in the previous reply referred to a webpage in which explicitly "VS 2005 and later" was mentioned. 2) When typing _getmaxstdio in the VC 6 help, a messagebox "No topics found" pops up.

    Randor wrote:

    This function is part of the standard C runtime library. Those functions have been around for as long as I can remember.

    And you are absolutely right. I compiled a simple snippet with both (get/set) under VC 6, and it ran flawlesly. Thanks for the additional info. Regards, Henk 21 cm: the universal wave length of hydrogen

    System Admin help question

  • [Solved] Maximum number of opened files?
    H henk21cm

    G'day David, > You can modify the maximum number of file handles opened simultaneously. The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. > I believe the ceiling is 2048 file handles. Correct, when using the number 2049 in VS 2005, it reports an error. Regards, Henk 21 cm: the universal wave length of hydrogen

    System Admin help question

  • [Solved] Maximum number of opened files?
    H henk21cm

    Hi Zoltan, > There is a KB article on this here[^], that may be of value. It reports 500 per process for NT 4. Seems to be the same for XP. > Also there are some obscure registry settings Those report 10000 handles. Weird. When Googling for an answer, [RedHat] Linux reports 1000 simultaneously opened files as maximum. Fortunately 'decently' recoding the previous mess the solved my agony. Thanks, Henk 21 cm: the universal wave length of hydrogen

    System Admin help question

  • [Solved] Maximum number of opened files?
    H henk21cm

    There must be a maximum number of simultaneously opened files. I found out -the hard way- by a rather strange error, that after opening 507 files, a next file could no longer be opened. After fixing the bug in my programm: closing a file after having processed the information, the error dispappeared, so 507 is close to 512, therefore i suppose that 512 files is the maximum. That assumption may be wrong. Is it possible to change the maximum number of simultaneously opened files? If so, how? 21 cm: the universal wave length of hydrogen

    modified on Saturday, April 12, 2008 2:39 PM

    System Admin help question

  • trim heading and trailing space
    H henk21cm

    G'day George, dBaseIII had a popular function for this purpose, alltrim. In the mid nineties i needed that function in C and wrote the following implementation, plain C code. char *alltrim( char *t) { unsigned char *t_, *tc_; int i=0, l; l = strlen(t); tc_ = (unsigned char*) t; /* Remove all spaces before any usefull characters */ while (*(tc_+i) <= ' ' && i < l) i++; if (i==l) /* Everything is white space */ { *t = (char) 0; /* return an empty string */ return t; } else t_ = ( unsigned char* ) (t+i); /* t_ points to the first non-whitespace */ /* Process the rear end of the string */ i=l-1; while (*(tc_+i) <= ' ') i--; i++; /* Index of the 1st whitespace at the rear end of the text */ *(t+i) = ( char ) 0; /* change into ASCIIZ */ l = strlen((char*) t_) + 1; /* Length clean string + ASCIIz */ memmove(t, t_, l); /* Secure even when overlapping */ return t; } Unfortunatedly the preview of the code looks awfull, like it has been handled by alltrim itself. Regards, Henk 21cm: the universal wavelength of neutral hydrogen

    C / C++ / MFC c++ question

  • How to make a dll re-entrant?
    H henk21cm

    Thanks folks, A proposed solution is:

    karle wrote:

    BOOL WINAPI DllMain(

    This is -apart from the name of the argument hinstDLL- exactly the same as the intiation code in this dll. Maybe some more detailed description of what is happening. The dll is called by a web application written in Delphi. The main task of the dll is to read a file and to store the data within this file in both a global struct and a pointer to double. Delphi can access and change this data by means of functions in this dll. When several users simultaneously access each of them their own files, the data is overwritten by each consecutive 'read' call, so user 1 sees the data of user 2. Since this is unwanted behaviour, the work around was to add three functions: Islocked(); Lock(); and Unlock(); Before trying to read or access data, the Delphi application checks whether IsLocked(); is false and then Locks the dll. After processing your data, the Delphi application Unlocks the dll. Not pretty, however it works. I was wondering whether there is a more elegant solution? Regards, Henk 21 cm: the universal wavelength of neutral hydrogen

    C / C++ / MFC tutorial question

  • How to make a dll re-entrant?
    H henk21cm

    G'day, Is there an easy trick to make a dll re-entrant, e.g. each time the dll is called, the caller gets its own data area? The functions in the dll are written in plain C, no classes are involved. Regards, Henk

    C / C++ / MFC tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups