File: camlcomp.ml

package info (click to toggle)
camlidl 1.05-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 872 kB
  • ctags: 1,131
  • sloc: ml: 4,894; ansic: 940; cpp: 897; makefile: 294; sh: 182
file content (27 lines) | stat: -rw-r--r-- 840 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(* 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" }