Click here to Skip to main content
16,004,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CPropertySheet Pin
Ryan Binns19-Aug-03 14:24
Ryan Binns19-Aug-03 14:24 
GeneralSerialization Pin
MemLeak19-Aug-03 3:35
MemLeak19-Aug-03 3:35 
GeneralRe: Serialization Pin
Hans Ruck19-Aug-03 4:54
Hans Ruck19-Aug-03 4:54 
GeneralRe: Serialization Pin
Dominik Reichl19-Aug-03 4:57
Dominik Reichl19-Aug-03 4:57 
GeneralwithSerialize Pin
Anonymous19-Aug-03 3:32
Anonymous19-Aug-03 3:32 
Generalimport directive and FontPtr types trouble Pin
El'Cachubrey19-Aug-03 3:24
El'Cachubrey19-Aug-03 3:24 
GeneralNeed a source safe expert Pin
YaronNir19-Aug-03 3:10
YaronNir19-Aug-03 3:10 
GeneralRe: Need a source safe expert Pin
Alexander Ruscle19-Aug-03 6:42
Alexander Ruscle19-Aug-03 6:42 
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_PATH + 1), MAX_PATH);
      sMsg.ReleaseBuffer ();
      pE->Delete ();
      throw (new CMyAppException (sMsg));
    }
  }
}

Also, have a look at dang!'s VssReporter 1.3. Looks to be pretty useful and right up your alley.
hth!

-ar
GeneralRe: Need a source safe expert Pin
YaronNir20-Aug-03 1:16
YaronNir20-Aug-03 1:16 
GeneralRe: Need a source safe expert Pin
David Crow19-Aug-03 7:48
David Crow19-Aug-03 7:48 
GeneralRe: Need a source safe expert Pin
YaronNir20-Aug-03 1:14
YaronNir20-Aug-03 1:14 
GeneralRe: Need a source safe expert Pin
David Crow20-Aug-03 2:22
David Crow20-Aug-03 2:22 
GeneralPassing Pointers Pin
NewHSKid19-Aug-03 2:44
NewHSKid19-Aug-03 2:44 
GeneralRe: Passing Pointers Pin
Bob Stanneveld19-Aug-03 2:56
Bob Stanneveld19-Aug-03 2:56 
GeneralRe: Passing Pointers Pin
NewHSKid19-Aug-03 3:02
NewHSKid19-Aug-03 3:02 
GeneralRe: Passing Pointers Pin
Bob Stanneveld19-Aug-03 7:45
Bob Stanneveld19-Aug-03 7:45 
GeneralRe: Passing Pointers Pin
Ravi Bhavnani19-Aug-03 2:57
professionalRavi Bhavnani19-Aug-03 2:57 
GeneralRe: Passing Pointers Pin
NewHSKid19-Aug-03 3:11
NewHSKid19-Aug-03 3:11 
GeneralRe: Passing Pointers Pin
PremL19-Aug-03 13:21
PremL19-Aug-03 13:21 
QuestionHow do I add a toolbar to a non-MFC application? Please help. Pin
adelgary19-Aug-03 2:35
adelgary19-Aug-03 2:35 
AnswerRe: How do I add a toolbar to a non-MFC application? Please help. Pin
Iain Clarke, Warrior Programmer19-Aug-03 3:14
Iain Clarke, Warrior Programmer19-Aug-03 3:14 
QuestionRight aligned toolbar button, Howto ? Pin
Thomas Andersen19-Aug-03 2:02
Thomas Andersen19-Aug-03 2:02 
QuestionDisabling alt-tab/taskswitching in full screen mode? Pin
Kayembi19-Aug-03 1:38
Kayembi19-Aug-03 1:38 
AnswerRe: Disabling alt-tab/taskswitching in full screen mode? Pin
ZoogieZork19-Aug-03 11:58
ZoogieZork19-Aug-03 11:58 
Generalprepertysheet in Formview (SDI) Pin
clack23419-Aug-03 0:47
clack23419-Aug-03 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.