Changeset 49525 in vbox for trunk/doc/manual/en_US
- Timestamp:
- Nov 18, 2013 12:25:40 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/SDKRef.xml
r49313 r49525 1722 1722 1723 1723 <note> 1724 <para>This section currently applies to Linux hosts only.</para> 1724 <para>This section currently applies to Linux, Mac OS X and Solaris 1725 hosts only.</para> 1725 1726 </note> 1726 1727 … … 1737 1738 C program.</para> 1738 1739 1739 <para>For Linux, a sample program is provided which demonstrates use 1740 of the C binding to initialize XPCOM, get handles for VirtualBox and 1741 Session objects, make calls to list and start virtual machines, and 1742 uninitialize resources when done. The program uses the VBoxGlue 1743 library to open the C binding layer during runtime.</para> 1740 <para>As part of the SDK, a sample program is provided which 1741 demonstrates using the C binding to initialize XPCOM, get handles for 1742 VirtualBox and Session objects, make calls to list and start virtual 1743 machines, monitor events, and uninitialize resources when done. The 1744 program uses the VBoxGlue library to open the C binding layer during 1745 runtime.</para> 1744 1746 1745 1747 <para>The sample program … … 1758 1760 1759 1761 <para>Just like in C++, XPCOM needs to be initialized before it can 1760 be used. The <computeroutput>VBoxCAPI_v 2_5.h</computeroutput> header1762 be used. The <computeroutput>VBoxCAPI_v4_3.h</computeroutput> header 1761 1763 provides the interface to the C binding. Here's how to initialize 1762 1764 XPCOM:</para> 1763 1765 1764 <screen>#include "VBoxCAPI_v 2_5.h"1766 <screen>#include "VBoxCAPI_v4_3.h" 1765 1767 ... 1766 1768 PCVBOXXPCOM g_pVBoxFuncs = NULL; … … 1784 1786 1785 1787 g_pVBoxFuncs = VBoxGetXPCOMCFunctions(VBOX_XPCOMC_VERSION); 1786 g_pVBoxFuncs->pfnComInitialize(&vbox, &session);</screen> 1788 g_pVBoxFuncs->pfnComInitialize(IVIRTUALBOX_IID_STR, &vbox, 1789 ISESSION_IID_STR, &session);</screen> 1787 1790 1788 1791 <para>If either <computeroutput>vbox</computeroutput> or … … 1790 1793 <computeroutput>NULL</computeroutput>, initialization failed and the 1791 1794 XPCOM API cannot be used.</para> 1795 1796 <para>There is now also a way to use the 1797 <xref linkend="IVirtualBoxClient" xreflabel="IVirtualBoxClient" /> 1798 helper interface, which in comparison to the original (and still 1799 available) initialization method above simplifies creating multiple 1800 sessions, and also allows handling termination and crashes of the API 1801 server (VBoxSVC) in a graceful way. See the sample program how this 1802 is used.</para> 1792 1803 </sect3> 1793 1804 … … 1886 1897 take pointers to that type. Prototypes for the following conversion 1887 1898 functions are declared in 1888 <computeroutput>VBoxCAPI_v 2_5.h</computeroutput>.</para>1899 <computeroutput>VBoxCAPI_v4_3.h</computeroutput>.</para> 1889 1900 1890 1901 <sect4> … … 1946 1957 calling 1947 1958 <computeroutput>g_pVBoxFuncs->pfnComUninitialize()</computeroutput> 1948 later on (usually <emphasis>not</emphasis> from the handler itself 1949 .)</para> 1959 later on, <emphasis>not</emphasis> from the handler itself.</para> 1950 1960 1951 1961 <para>That said, if a client program forgets to call 1952 1962 <computeroutput>g_pVBoxFuncs->pfnComUninitialize()</computeroutput> 1953 1963 before it terminates, there is a mechanism in place which will 1954 eventually release references held by the client. You should not 1955 rely on this, however.</para> 1964 eventually release references held by the client.</para> 1956 1965 </sect3> 1957 1966 … … 1976 1985 1977 1986 # Compile. 1978 program.o: program.c VBoxCAPI_v 2_5.h1987 program.o: program.c VBoxCAPI_v4_3.h 1979 1988 $(CC) $(CFLAGS) $(INCS_XPCOM) $(GLUE_INC) -o $@ -c $< 1980 1989
Note:
See TracChangeset
for help on using the changeset viewer.