Results 1 to 2 of 2
- 09-10-2009, 02:35 AM #1
Member
- Join Date
- Sep 2009
- Posts
- 5
- Rep Power
- 0
incompatible types...What is "Dispatch" ?
Hi,
I am trying to make an applet retrieving MS Outlook Addresses book using a package I found on google called "Jacob". You can see the last 2 import statements at the top of the applet code below.
I need your help to make the Applet source code to work fine since I am really a newbie coding in Java. Right now I'm getting the following error when compiling with "javac":
with the cursor right below "olo.getObject()"Java Code:ContactImporter_V1.java:20: incompatible types found : java.lang.Object required: com.jacob.com.Dispatch Dispatch olo = olo.getObject();
Do you have any idea of what it could be ? Is there someone to test it with me ?.....
Java Code:import java.awt.*; import java.awt.event.*; import java.applet.Applet; import com.jacob.activeX.*; import com.jacob.com.*; public class ContactImporter_V1 extends java.applet.Applet { public void paint(java.awt.Graphics contexteGraphique){ contexteGraphique.drawString("Chargement de votre carnet d'adresses MS Outlook...Veuillez patienter! :)", 70, 40); final int olFolderContacts = 10; ActiveXComponent ol = new ActiveXComponent("Outlook.Application"); Dispatch dsp = new Dispatch(); Dispatch olo = ol.getObject(); Dispatch myNamespace = Dispatch.call(olo, "GetNamespace","MAPI").toDispatch(); Dispatch myFolder = Dispatch.call(myNamespace, "GetDefaultFolder",new Integer(olFolderContacts)).toDispatch(); Dispatch items = Dispatch.get(myFolder, "Items").toDispatch(); int count = Dispatch.call(items, "Count").toInt(); for (int i = 1; i <= count; i++) { Dispatch item; String fullName = Dispatch.get(item, "Fullname").toString(); String emailAddress = Dispatch.get(item, "Email1Address").toString(); printField("Email:", emailAddress); } } public static void printField(String label, String value) { if (value.length() != 0) { System.out.println(label + " " + value); } } }Last edited by ollyworks; 09-10-2009 at 02:39 AM.
-
Have you contacted the folks who support "Jacob"?
Similar Threads
-
Java, Military Format using "/" and "%" Operator!!
By sk8rsam77 in forum New To JavaReplies: 11Last Post: 02-26-2010, 03:03 AM -
getDisplayLanguage returns "en" not "English"
By DD70 in forum New To JavaReplies: 6Last Post: 08-12-2009, 11:22 PM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM -
"Jumble" or "Scramble" Program
By Shadow22202 in forum Java AppletsReplies: 8Last Post: 04-30-2008, 03:42 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks