From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA00788; Wed, 7 Aug 2002 10:56:00 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA00750 for ; Wed, 7 Aug 2002 10:55:59 +0200 (MET DST) Received: from mel-rto3.wanadoo.fr (smtp-out-3.wanadoo.fr [193.252.19.233]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g778tw523324 for ; Wed, 7 Aug 2002 10:55:58 +0200 (MET DST) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto3.wanadoo.fr (6.5.007) id 3D49FC7D00216FEB; Wed, 7 Aug 2002 10:55:57 +0200 Received: from warp (80.13.116.114) by mel-rta9.wanadoo.fr (6.5.007) id 3D49FFB7001FFD12; Wed, 7 Aug 2002 10:55:57 +0200 Message-ID: <004a01c23df0$36f9ef70$0700a8c0@warp> From: "Nicolas Cannasse" To: "kyra" Cc: "OCaml" References: <000901c237fe$04a92510$0700a8c0@warp> <001901c239b4$be8ccbf0$551aa8c0@kyra> <001101c23a0d$2f184220$0700a8c0@warp> <000d01c23ae3$9dd62700$551aa8c0@kyra> <003b01c23c54$32324570$0700a8c0@warp> <20020805113255.C7554@pauillac.inria.fr> <003901c23c65$9fe95e30$0700a8c0@warp> <002d01c23d42$fc4d1080$551aa8c0@kyra> Subject: Re: [Caml-list] OCam'OLE pre-release Date: Wed, 7 Aug 2002 10:55:43 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > > Because the COM object can still be referenced from C. You probably > > > forgot to do an AddRef somewhere, e.g. when extracting a COM object > > > reference from its Caml wrapper. > > > > > > Reference count management sure is tricky... > > > > True. > > If you're using OCamole to manipulate COM objects and then passing them > back > > to C, your C code need to call AddRef on the retreived COM object since > > OCamole GC'ed process does not respect the COM spec (caller is responsible > > from Release, callee call AddRef ) > > > > Simply use the following function : > > > > IUnknown *get_com_object( value v ) { > > IUnknown *o = IUnknown_val(v); > > o->AddRef(); > > return o; > > } > > > > Nicolas Cannasse > > > I'd want to remind that original subject was 'olegen' application. Being > compiled natively it _does not work_. The error is access violation, caused > by "The object invoked has disconnected from its clients". I believe this is > because of Released COM object is invoked from _another COM object_. In my > first post on this topic I had conjectured this was design flaw - binding > Release with finalize. The main reason was: _one cannot guarantee_ that > there are not other references to COM object from another COM objects. May > be one can suppose, but cannot guarantee. If I'm wrong, we must follow X. > Leroy and try to find the error in ocamole.cpp. If I'm wrong again, why does > olegen not work??? Sorry but I didn't get this in your previous emails. I'm currently investigating the native compilation issues. Please consider that only bytecode compilation is available in the .pre Release. If you're experiencing any problem/bug with OCamole and/or OLEGen, please send me a report in order to fix it. Nicolas Cannasse ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners