Using the CRfcServerApp and Derived Classes 
In the main program of the user’s server application, you can use the following steps to integrate R/3 functionality with the user desktop:
(See the server application sample, "Server.cpp" under the topic
Programming Examples, for details.)