accessing variables from another project

I have a Visual C++ solution file that contains 3 projects. i want to access the variables declared in a function in a project from a function in another project. Function declarations are in .h file and expansion in .cpp files. Can i use friend class or any other suitable method.
Can't you just copy the files to the same project?
No. I cant copy it. One project is the encoder part and another one is decoder and the third one is the common files for both encoding and decoding.
I shall provide the link since the program is too lengthy.
I want to access variables from the following link .( line 190 onwards)
http://hevc.hhi.fraunhofer.de/HM-doc/_t_com_prediction_8cpp_source.html

The variables shall be accessible from line 509 of the following link
http://hevc.hhi.fraunhofer.de/HM-doc/_t_dec_cu_8cpp_source.html
I want to modify line 518 based on variables that follows line 190 in first link
expecting a favourable answer

You could build one solution as a library, and use it in your other solution.

You could share data by writing to a file and then letting the other solution read form it during run-time.
I want to access variables from the following link .( line 190 onwards)
http://hevc.hhi.fraunhofer.de/HM-doc/_t_com_prediction_8cpp_source.html

You're talking about TComPrediction::xPredIntraAng(), right?

That's one big method, with a lot of arguments, and a lot of local variables.

I'm a bit unclear about what you're trying to achieve. Can you be a bit more specific?

Are you wanting to create an object of that class, so that you can call that method, to calculate the values that are passed back as output arguments?

Are you wanting to access the results that have been calculated by a previous run of that project?

Are you wanting to use that algorithm to perform those calculations without creating an object of that class?

Are you wanting to use the value that's stored in one of the local variables in that method during the execution of the method?

Are you wanting to do something else that I haven't thought of?
Last edited on
I want to access the variables and pointers like intraPredAngle, absAng, dirMode, Pel* pDst used in the begining of function Void TComPrediction::xPredIntraAng. from TDecCU.cpp (at the reconstruction section from line 509 onwards. Please refer the following link

http://hevc.hhi.fraunhofer.de/HM-doc/_t_com_prediction_8cpp_source.html

The variables shall be accessible from line 509 of the following link
http://hevc.hhi.fraunhofer.de/HM-doc/_t_dec_cu_8cpp_source.html

My objective is to control the addition of
pPred[ uiX ] + pResi[ uiX ] at line 518 based on intraPredAngle and dirmode values. ( addition operation based on some if loops).

Anticipating a favourable reply
Topic archived. No new replies allowed.