<html>
<head>
<title>Jam Example</title>
<style TYPE="text/css">
<!--
BODY {font: 12px/16px verdana, arial, sans-serif !important;
text-align: left;
margin-left: 2cm;
color:#000000 !important;}
.cell {font: 12px/16px verdana, arial, sans-serif !important;
text-align: left;
color:#000000 !important;}
TD {font: 12px/16px verdana, arial, sans-serif !important;
text-align: left;
color:#000000 !important;}
H1 {font: 18px/18px verdana, arial, sans-serif !important;
text-align: left;
color:#333333 !important;}
H2 {font: 18px/18px verdana, arial, sans-serif !important;
text-align: left;
color:#333333 !important;
font-weight: bold;
margin-bottom: 14px}
H3 {font: 14px/14px verdana, arial, sans-serif !important;
text-align: left;
color:#333333 !important;
font-weight: bold;
margin-bottom: 14px}
pre {
border-right: #646464 1px solid;
padding-right: 0.5em;
border-top: #646464 1px solid;
padding-top: 0.5em;
border-left: #646464 1px solid;
padding-left: 0.5em;
border-bottom: #646464 1px solid;
padding-bottom: 0.5em;
white-space: pre;
background-color: #f6e6e6;
color: black;
margin-left: 1em;
width: 90%;
display: table;
font-size: 100%;
}
-->
</style>
</head>
<body>
<h1><a name="top"></a>P4VB - COM Interface to Perforce C++ API on Windows</h1>
<p>p4vb is contributed by <a href="http://public.perforce.com/guest/robert_cowham/pcp.html"> Robert Cowham</a> of
Vaccaperna Systems Ltd.</p>
<p>See the paper I presented at the Perforce User Conference in 2001:
<a href="http://www.perforce.com/perforce/conf2001/index.html#myth">Adventures
in API Land</a> for an overview of the API and how I use it.</p>
<h2>Compiler</h2>
<p>This COM DLL has been built with MS VC++ 6.0 (SP5). Future versions will be
built with VC++ 7.0.</p>
<p>Use either of the project settings:</p>
<ul>
<li>Debug</li>
<li>Release Min Dependency</li>
</ul>
<font FACE="TimesNewRoman" SIZE="3">
<h2 ALIGN="LEFT">Interface</h2>
<p ALIGN="LEFT">The IDL definition is:</p>
<pre>[
entry("p4run"),
helpstring("runs a p4 command 'cmd' returning values in 2 output arrays"),
]
Long p4run([in] BSTR cmd,
[out] ArrayString infoArray,
[out] ArrayString errorArray,
[out] BSTR * TextFileName,
[out] BSTR * BinaryFileName);
</pre>
<p>As an example of using it:</p>
<pre>Dim p4cmd As String
Dim result As Long
Dim TextArr() As String
Dim InfoArr() As String
Dim ErrorArr() As String
Dim TextFileName As String
Dim BinaryFileName As String
' Need to initialise as otherwise VB kindly passes in a NULL pointer.
TextFileName = "temp"
BinaryFileName = "temp"
p4cmd = "print " & Chr(34) & DocPathname & "#" & ver & Chr(34)
result = p4run(p4cmd, InfoArr, ErrorArr, TextFileName, BinaryFileName)
</pre>
</font>
<p ALIGN="LEFT">This will print the results of the file into the temporary file
in either TextFileName or BinaryFileName from which it can be further processed.</p>
<p ALIGN="LEFT">Other Perforce commands might not result in any file output, but
just strings in InfoArr() or ErrorArr().</p>
<p ALIGN="LEFT">Other examples to follow...</p>
<p>
<a href="#top">Top</a>
</p>
</body>
</html>