below code worked for me with "PDF.PdfCtrl.5" or "PDF.PdfCtrl.6" ids.
String pdfId = getKeyValue( "PDF );
site = new OleControlSite(frame, SWT.NONE, result );
auto = new OleAutomation(site);
------------------
// this is really a costly approach as it searches entire registry
public String getKeyValue( String type ) {
String pdfProgId = null;
String [] extensions = new String [1024];
// Use the character encoding for the default locale
TCHAR lpName = new TCHAR (0, 1024);
int [] lpcName = new int [] {lpName.length ()};
FILETIME ft = new FILETIME ();
int dwIndex = 0, count = 0;
while (OS.RegEnumKeyEx (OS.HKEY_CLASSES_ROOT, dwIndex, lpName, lpcName,
null, null, null, ft) !=
OS.ERROR_NO_MORE_ITEMS) {
String extension = lpName.toString (0, lpcName [0]);
lpcName [0] = lpName.length ();
if ( extension.indexOf( type ) != -1 ) {
pdfProgId = extension;
break;
}
dwIndex++;
}