Re: random exception
Stefan Zschocke <[email protected]>
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Organization | infoZoom |
| Message-ID | <[email protected]> |
Hi, I don't know wether it is related with your problem, but before calling CoUnininitialize you must release your COM object. Also, you might want to check the return value of CoInitialize. If it indikates that COM has already been initialize, then dont call uninitialize. Stefan http://www.jacoZoom.de -----Ursprüngliche Nachricht----- Von: Discussion of Java/Win32/COM integration with Jawin [mailto:[email protected]] Im Auftrag von Tate Austin Gesendet: Mittwoch, 22. Dezember 2004 16:16 An: [email protected] Betreff: [JAWIN] random exception I have a segment of jawin code that pitches a COM exception about 33% of the times I invoke it, but other times works fine? It looks like this: try { Ole32.CoInitialize(); DispatchPtr web = new DispatchPtr("Marco2web.web"); Object WebEncrypt = web.invoke("WebEncrypt", UserList); try{ retString = String.valueOf(WebEncrypt); }catch(ClassCastException cce){ System.out.println("Not a String: " + cce.getMessage()); } Ole32.CoUninitialize(); } catch (COMException e) { e.printStackTrace(); } All the documentation for Jawin assures me threading is no problem for dll calls, so what else could be causing these generic and ultimately meaningless COMExceptions whose detail message reads: "Exception occurred.\r\n"?