Hi i am a beginner in developing c++ api. So far i understand how to create dialog boxes and attach various function to it. I wonder if it is possible to just execute some function without dialog box and just execute when loaded. How to setup grc file in this case and what to put in src. I mean do i still would have to use free data check env etc
There are a lot of different ways to execute functions without a dialog box. In general you will always need the four functions CheckEnvironment, RegisterInterface, Initialize and FreeData.
Here are two ideas to get started:
The easiest is to make a menu entry which triggers the function. Almost all example projects are setup like this, so take a look at these. I think the "Element_Test" example is a pretty good start. Also this blog post by Graphisoft describes this process in more details. Specifically what to put into the resource files etc.
You can work with the Notifications Manager. Check out the similarly named example project. This is a bit more challenging but also quite powerful. You can react to e.g. an element being changed or changing of the view.