Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > e45a26a087d8eb1aa7d8558d140fd8e2 > files > 51

ocaml-camlidl-devel-1.05-17.fc18.i686.rpm

(* A simple component in Caml *)

class mycomponent =
  object
    method fx =
      (*print_string "Camlcomp: fx"; print_newline(); *) ()
    method fxStringIn str =
      print_string "Camlcomp: fxStringIn "; print_string str; print_newline()
    method fxStringOut =
      (*print_string "Camlcomp: fxStringOut "; print_newline();*)
      "This string comes from Caml"
    method fxFakeError =
      (failwith "FxFakeError" : unit)
  end

let factory () =
  (*print_string "Camlcomp: factory is called"; print_newline();*)
  Component.make_iX(new mycomponent)

let _ =
  Com.register_factory
    { Com.create = factory;
      Com.clsid = Com.clsid "6a3d0750-dad9-11d2-8e2c-0060974fbf19";
      Com.friendly_name = "CAMLIDL, test component 2";
      Com.ver_ind_prog_id = "CAMLIDL.Testcomp2";
      Com.prog_id = "CAMLIDL.Testcomp2.1" }