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
A

Alexander Ruscle

@Alexander Ruscle
About
Posts
4
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Virtual Memory Check
    A Alexander Ruscle

    Take a look at GetProcessWorkingSetSize () and see if that's what you need. There's a whole slough of memory management functions in the API, just check out the documentation in MSDN! :) -ar

    C / C++ / MFC json performance help question

  • Virtual Memory Check
    A Alexander Ruscle

    Try

    VOID GlobalMemoryStatus(
    LPMEMORYSTATUS lpBuffer // pointer to the memory status structure
    );

    hth -ar

    C / C++ / MFC json performance help question

  • Need a source safe expert
    A Alexander Ruscle

    SourceSafe provides a COM interface with which you can perform all the functions that you can from the command line, complete with the entire object model. There are several good help files in MSDN about it, particularly one entitled Microsoft Visual SourceSafe OLE Automation. Here's some sample code that will get a file out of SourceSafe if it's not checked out:

    #include "ssapi.h"
    
    /*--------------------------------------------------------------------
    void GetWritableFileFromSourceSafe (CString sSourceSafeFile, CString sOnDiskTargetFile)
      DESCRIPTION:
        Opens SourceSafe, using the default username with no password and
        attempts to get the specified file to a location on the local disk
        for modification.
    
      PARAMETERS:
        CString sSourceSafeFile
          The file in SourceSafe to retrieve.
    
        CString sOnDiskTargetFile
          The filename to write the SourceSafe file to.
    @x.-----------------------------------------------------------------*/
    void CSourceSafeWrapper::GetWritableFileFromSourceSafe (CString sSourceSafeFile, CString sOnDiskTargetFile)
    {
      IVSSDatabase db;
    
      if (db.CreateDispatch ("SourceSafe")) {
    
        CString sSSDatabase, sUsername, sPassword;
        // This is a function that gets the name of the database (like
        // "\\SourceMachine\Sources\srcsafe.ini"), the username and
        // password to use.
        ReadSSLoginSettings (sSSDatabase, sUsername, sPassword);
    
        try {
    			
          db.Open (sSSDatabase, sUsername, sPassword);
    
          // Note that if this fails, there is some memory inside the COM
          // object that leaks, but there's nothing I know to do about it.
          LPDISPATCH pDisp = db.GetVSSItem (sSourceSafeFile, FALSE);
          IVSSItem item (pDisp);
    
          // Make sure the item is not already checked out.
          if (item.GetIsCheckedOut ()) 
            throw (new CMyAppException ("The file in SourceSafe you specified is already checked out by someone. Make sure it is not checked out before proceeding."));
    
          CComBSTR bstrPath (sOnDiskTargetFile);
    		
          item.Get (&bstrPath, VSSFLAG_USERRONO | VSSFLAG_REPREPLACE | VSSFLAG_FORCEDIRNO);
        }
        catch (COleDispatchException * pE)  {
    		
          // Pass this error on to the user.  We transform the exception 
          // into one of our so that we can report it and respond just 
          // like one of our own errors.
          CString sMsg;
          pE->GetErrorMessage (sMsg.GetBuffer (MAX_
    
    C / C++ / MFC tutorial question

  • are those xml parsers worth beans?
    A Alexander Ruscle

    In my experience with using the MS XML parser, the results were fairly close to what you described (added to the code pile) plus giving my users the added benefit of extra time to go get that cup of coffee they need while my code plods through a 3MB XML file. Parsing the file manually speeds things up dramatically. To date I have not found an efficient parser, but that's mainly because all the good parsers have a lot of overhead while they make sure everything is kosher. In our situations we can probably make some assumptions about the particular file we're parsing, which can add to efficiency. -ar

    C / C++ / MFC apache oracle xml help 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