Hi Rajendra, This is an elemental C++ question regarding C++ scope rules. If my answer is not sufficient, you may want to do some research on classes and scope.
It sounds like you have an API you wish to create that is based on the RawChannel class. In order for the RawChannel object to be available to all the API functions, they must be in the same scope. The easiest and probably best way to do this is to put your entire API into a class of its own. SendReceive(void) would then be a member function of your own class. - Chris On Thu, Apr 14, 2011 at 10:22:05PM +0530, Rajendra prasad wrote: > HI. > > Thanks for your responses for all my previous posts. > Now my device is communicating with blackberry fine. > On top of barry libraries we are developing APIs for application > development. > > The Connect API as follows, > > int Connect(void) > { > ----- > ----- > Barry::Mode::RawChannel rawChannel(Con); > raawChannel.open(" ",CHANNELNAME); > } > > And i am writing another API for receiving and sending data to BB in > SendReceive() function as follows. > > int SendReceive(void) > { > ------- > ------ > rawChannel.Send(data); > > ----- > rawChannel.Receive(data) > > } > > So please suggest me, how can i pass the above rawChannel instance from > Connect function to SendReceive() function. > > _ _ _ _ _ > > Best Regards > R.Rajendra > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > Barry-devel mailing list > Barry-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/barry-devel ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Barry-devel mailing list Barry-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/barry-devel