Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java <-> JNI <-> c++ <-> COM <-> PowerPoint

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello ,

I want to automate Powerpoint with Java.

The idea is :
JAVA <-> JNI <-> c++ DLL(Borland c++ Builder 3 ) <-> COM <-> PowerPoint

- first I've imported the tybelib for PowerPoint in C++ builder
- Created a c++ DLL
- Then I've set up the JNI ( to interact with c++)
- Now I can write the Java prog

Now , everything works. When I start my JAVA program , Powerpoint will start and I can automate PowerPoint ( open presentation, hop from one slide to another).

But when I try to stop my Java program , this Java program just won't stop.

So I've stripped my c++ DLL to the following code :

TCOM_Application PptApp;

PptApp = CoApplication::Create();
PptApp->set_Visible( Office_tlb::msoCTrue );
PptApp->Quit();
PptApp=NULL;

This will run PowerPoint and close it. Now , this works , my Java program stops.

But when I use this code :
TCOM_Application PptApp;
Powerpoint_tlb::presentations *pDoc;

PptApp = CoApplication::Create();
PptApp->set_Visible( Office_tlb::msoCTrue );
PptApp->get_Presentations_(&pDoc);
PptApp->Quit();
PptApp=NULL;

My Java program will lock itself , and the only thing I can do to stop is with the task-manager.

Now , I hope you guys can help me.
I don't know what to do anymore !!

p.s I use JDK 1.3 (sun)

Yours

Fransjo Leihitu
thalyric@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top