I would like to use the API to do simple progaming things like an executable that start a machine for exemple. I would like to do that in C++. The problem is that I don't know how to set it up.
Download the SDK from the downloads area. What you downloaded from SVN was the application source code, which is probably not what you want (that's like downloading the source code of the gcc compiler because you want to learn how to write C++).
Ok now, how I use that ? I see in the samples folder tstVBoxAPIWin.cpp. I would like to compile it to test it. But before I suppose that I have to install the SKD right ? In the installer folder I see python script. Do I just have to run the python script ?
Sorry, I don't use the SDK. You asked if the source codes you downloaded were what you needed, and I'm afraid my answer to that question pretty much exhausted my knowledge of the subject.
Under the folder <SKD_ROOT>\bindings\xpcom\include, you'll normally find every include you need. The main headers you're interested into are the VBoxCAPI_vX_X.h files.
You should also read in its entierty the SDKRef.pdf file located in the docs dir of the SDK
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Ok I found the problem, I was trying to use XPCom instead of MSCom. Now compilation seems to be better if I try to compile the sample file tstVBoxAPIWin.cpp. But I still have errors :
So It seems that the problem is comming from the Win32 API in functions like SafeArrayAccessData(), SysFreeString(), SafeArrayUnaccessData() etc. But I don't know what to do to solve it ?
SafeArrayXXXXX etc are not strictly part of the Win32 API. Trying linking in OleAut32.lib. Google for any remaining missing functions, note which library is required.
Some of those look like VirtualBox SDK specifics, (VirtualBox GUIDs) so you'll need to consult the SDK docs on that. I expect they'll be declared in a header file.
If you are trying to build on windows, by far the easiest way to get started is to download the free Visual Studio Express/Desktop:
* Download/install VSE Desktop 2012
* Create a new empty C++ project (remove any auto-generated files)
* Copy the following into your project
sdk\bindings\mscom\samples\tstVBoxAPIWin.cpp
sdk\bindings\mscom\lib\VirtualBox_i.c
sdk\bindings\mscom\include\VirtualBox.h
* Compile & Run
This should work for you out of the box (just make sure that the SDK version is the same as the VirtualBox version you have installed e.g. don't mix 4.2 SDK with 4.3 VirtualBox).