Re: CFAM, CometLib and Java


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Willie Klein (64.59.46.175) on November 10, 2004 at 12:38:22:

In Reply to: Re: CFAM, CometLib and Java posted by Brian Levantine on November 10, 2004 at 09:12:25:

In order to interface with CFAM I used JaWin an Open-Source project available at sourceforge.net. So the first step is to get that and follow the instructions to install it :) It comes with a TypeBrowser that you use to examine the DLL. This will generate Java source that is specific to the DLL. You complile that and add it to your package.

the relevent source code:
try{
//create new instance of ICometFiles class. Call it cf
ICometFiles cf = new ICometFiles(CometFiles.CLSID);

// Initialize the connection
cf.Initialize("ClientID", -1, 50, 50);

// Open a file
cf.Open(10, "WWC1A", "WKK");

//JaWin wants a JaWin Varient rather than a string so We create one
Variant val = new Variant();

//tell it the Varient type is a String
val.vt = VarTypes.VT_BSTR;

//give it a String Value
val.bstrVal = "001002";

// Read the record with the key
cf.Inquire(10, val);

// Pass the record to a String
data = cf.GetRecField(10, 0, 80);

//Print it out
System.out.println("Data is: " +data);
cf.Close(10);


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):






[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]