This is a simple example of loading and using a P6R component library.
All components are loaded in a similar fashion so this example should give you a clear understanding of how to load any of our component libraries.
#include "cconsolestream.h"
using namespace P6R;
using namespace P6EXAMPLES;
namespace {
{
if(
P6SUCCEEDED(err = cpRegex->
compile(
"\\s*\\w+,?\\s+(\\d\\d)\\s(\\w+)\\s+(\\d\\d\\d\\d)\\s+(\\d\\d):(\\d\\d):(\\d\\d)\\s+([+\\-]?\\d\\d\\d\\d|\\w+)\\s*",
P6MODIFIER_NULL ))) {
&offset,
&strLength ))) {
if(0 == offset && 31 == strLength) {
}
else pConsole->
writeStdout(
"Error: Offset or length wrong\n",NULL,0,NULL);
}
else pConsole->
writeStdout(
"Error: match failed\n",NULL,0,NULL);
}
else {
pConsole->
writeStdout(
"Error: compile failed [ %1$ ]\n",&args[0],1,NULL);
}
}
else {
pConsole->
writeStdout(
"Error: Initialize failed [ %1$ ]\n",&args[0],1,NULL);
}
}
else {
pConsole->
writeStdout(
"Error: CreateInstance failed [ %1$ ]\n",&args[0],1,NULL);
}
}
}
int main(int argc,char *argv[])
{
testRegex(cpConsole, cpDataStream);
cpConsole = NULL;
}
}
else printf("ERROR: Failed to initialize the loader [ %x ]\n",err);
}
else printf("ERROR: Failed to create CConsoleStream [ %x ]\n",err);
return err;
}