Lets say I have a “.c” file with some methods, and I create a new project where I need to make a process that uses the methods from the previouse project….All under the same solution.
In the current project that I’m working on I create a process with the method “createProcess”,
and then I pass to the “CommandLine” parameter the “.exe” file that belong for the 1st project,the one with the “.c” file (where all my methods are).
How is it possible to access these methods & use them?
Lets say I have a .c file with some methods, and I create a
Share
The common ‘methods’ (in C these are called functions) should extracted to be in their own source-code file without a ‘main’. The function prototypes should be in their own header file. Make sure the functions are not declared as ‘static’.
Now #include the header file in the two main source files. Each project should have two C source files, the one containing ‘main’ and the one containing the common functions – so the common functions source file is in two (or more) projects.
Longer term it would be better to put the common functions into their own DLL – but that’s maybe for another day.