/******************************************************************************* Copyright (c) 2003, Robert Cowham and Vaccaperna Systems Ltd. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL VACCAPERNA SYSTEMS LTD. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ /******************************************************************************* * Name: p4interface.cpp * * Author: Robert Cowham <robert@vaccaperna.co.uk> * * Description: * Utility functions * ******************************************************************************/ #include "p4interface.h" #include "TraceUtils.h" #include "hostenv.h" // Format error for printing for user void FormatAndOutputError(LPCSTR m, Error *e) { StrBuf err; StrBuf msg; msg = m; e->Fmt(&err); msg.Append(err.Text()); TraceMsg(msg.Text()); } // FormatAndOutputError // Just outputs a basic message void TraceMsg(LPCTSTR msg) { MessageBox (NULL, msg, _T("p4com-trace"), MB_OK); } // Formats error message and puts it out. void TraceError(HRESULT hresult, LPCTSTR msg) { TCHAR buf[200]; wsprintf(buf, _T("%ld %lx %s"), hresult, hresult, msg); MessageBox (NULL, buf, _T("p4com-error"), MB_OK); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 11314 | Robert Cowham | Initial population of perforce_software version of P4OFC | ||
//guest/robert_cowham/perforce/API/p4com/main/src/p4interface.cpp | |||||
#2 | 5194 | Robert Cowham |
Changes (2005.1.0.0) Added Dropped() to detect dropped connections Added Input property to provide input e.g. for passwords Added FormatDateTime() as a convenience for calling C Runtime function (for VB use) Imported changes from p4ofc which made it more reliable. |
||
#1 | 3525 | Robert Cowham | Initial release |