Home > Error C2248 > Error C2248 Cobject Cobject Private

Error C2248 Cobject Cobject Private

Contents

asked 1 year ago viewed 1661 times active 1 year ago Get the weekly newsletter! Try this: class CPerson { public: CPerson(); CPerson(int i); void operator=(const CPerson& p) {} private: char* m_strName; }; CPerson::CPerson() {} CPerson::CPerson(int i) { sprintf(m_strName,"%d",i); } void aFunction(CArray &allPersons) { int i=0; asked 7 years ago viewed 5230 times active 1 year ago Get the weekly newsletter! Please let me know. http://megavoid.net/error-c2248/error-c2248-cobject-operator-private.html

Generating Random Numbers - The C++ Way Hello World: Your first C and C++ Programs Network programming under UNIX Implementation Inheritance Change Theme in Code::Blocks A New Webcam Api Tutorial in If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. The need for the Gram–Schmidt process What would be a good approach to make sure advisor goes through all the report? CopyArray(sourceArray, DestArray&) { for each element in SourceArray add the element to DestArray. } share|improve this answer edited May 14 '09 at 19:59 answered May 14 '09 at 18:55 aJ. 20.8k1564105 Bonuses

Error C2248 Cobject Cobject Private

Pls see the edited version. –aJ. Join them; it only takes a minute: Sign up error using CArray up vote 2 down vote favorite 1 so, i am trying to use CArray like this : CArray allPersons; Your function aFunction() tries to call copy constructor of CArray and it is defined private in CObject. Hello, I have automated several tasks into a function shown below: Code: void CreateTileMenu(CStringArray strArray, CStatic Tile, CWnd *pWnd); I get the following error upon compilation: HTML Code: afxcoll.h(593) : error

Your Email This email is in use. In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers see an example newsletter By subscribing, you agree to the privacy policy and terms share|improve this answer answered Aug 6 '09 at 7:34 pavan kumar add a comment| Did you find this question interesting? Error C2248 Cannot Access Private Member Declared In Class Répondre avec citation 0 0 29/06/2010,17h11 #5 TinTouneT Candidat au Club Inscrit enavril 2010Messages5Détails du profilInformations personnelles :Localisation : FranceInformations forums :Inscription : avril 2010Messages : 5Points : 4Points4 En

Please tell me what's wrong here. Cannot Access Private Member Declared In Class Cobject Carray Et encore si vous saviez tous le reste … Quand au warnings j'ai un Warning 97 warning C4552: '|' : operator has no effect; expected operator with side-effect et un Warning May 14 '09 at 18:19 i tried your suggestion but the same error occurs again. –Attilah May 14 '09 at 18:25 this is my aFunction : can http://stackoverflow.com/questions/28858590/error-c2248-cobjectcobject-cannot-access-private-member-declared-in-class Send to Email Address Your Name Your Email Address Cancel Post was not sent - check your email addresses!

May 14 '09 at 19:56 | show 8 more comments up vote 2 down vote Are you using any of the Copy constructor or assignment operator of CObject ? ( CArray If you don't declare "public:" before constructor, you'll get same error whenever you try to create an object of that class. Share this:EmailPrint Related Tagged: c-plus-plus, cobject, mfc § One Response to Resolving error C2248 with CObject rat1960 says: 31 March, 2013 at 10:05 am Another useful technique is to insert #pragma Then all you have to do is switch out your array class.

Cannot Access Private Member Declared In Class Cobject Carray

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed more hot questions question feed lang-cpp about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Error C2248 Cobject Cobject Private That is the problem. Error C2248 Cannot Access Protected Member Declared In Class I don't know how leaving out the contained type would lead to the reported error, but...

but how do I circumvent the problem ? –Attilah May 14 '09 at 18:54 Like I asked, what does the rest of the program look like? http://megavoid.net/error-c2248/error-c2248-cobject-operator.html How to automatically run a command after exiting ssh Why are there so many different amounts received when receiving a payment? In my case vc6 and express visual c++ 2010 (with sdk7 something) compiled my code but visual studio 2012 pro, shrink wrapped is not happy. Try our newsletter Sign up for our newsletter and get our top new questions delivered to your inbox (see an example). Error C2248 Visual C++

Draw an asterisk triangle Is there a way to prevent developers from using std::min, std::max? Are backpack nets an effective deterrent when going to rougher parts of the world? In other words: You cannot pass CObject-derived objects by value. http://megavoid.net/error-c2248/error-c2248-cobject-cobject.html Terms of Service Layout: fixed | fluid CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100 Sign in Gallery MSDN Library Forums Get started for free Ask

share|improve this answer answered Mar 4 '15 at 15:51 sithereal 1,192612 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign http://social.msdn.microsoft.com/for...4-8adaae69ffe7 Répondre avec citation 0 0 30/06/2010,17h38 #7 subzero01 Membre régulier Inscrit endécembre 2007Messages281Détails du profilInformations personnelles :Âge : 33Informations forums :Inscription : décembre 2007Messages : 281Points : 121Points121 je How to automatically run a command after exiting ssh What is the difference between SAN and SNI SSL certificates?

Linked 2 "error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' 5 Return a CStringArray gives errors 2 VS2013 compiler: 'CObject::CObject' : cannot access private member declared in

CPtrArray m_StaticArray; Then you will have to add a new and a call to Create() before adding your CStaticEx(s). Your use of SetAtGrow() seems correct to me otherwise. Privacy statement Dev Centers Windows Office More... J'imagine donc qu'il doit s'agir d'un objet d'une autre classe qui hérite de CObject (donc potentiellement presque n'importe quelle classe …) Comment savoir ou se situe l'erreur ??

Join them; it only takes a minute: Sign up "error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' [duplicate] up vote 2 down vote favorite Possible Duplicate: error What line does your error message refer to?     Tuesday, March 18, 2008 6:19 AM Reply | Quote 0 Sign in to vote It seems the getIdlFile(CFile IdlFile) function has If this is your first visit, be sure to check out the FAQ by clicking the link above. his comment is here If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.Would you like to participate?

A Riddle of Feelings Install Setup not working What is the difference between SAN and SNI SSL certificates? Like I said, I dont have the source code to the CStaticEx class but you shouldnt have to change much to get it running. Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts View Site Leaders What's New? Also, make the array a member variable, you will not need CStaticEx member variables (m_pStatiEx1).

Browse other questions tagged c++ mfc or ask your own question. How to circumvent this ? –Attilah May 14 '09 at 19:16 I just compiled what you had, and it works (with syntax fixes) –crashmstr May 14 '09 at 19:20 share|improve this answer answered Jul 1 '10 at 19:29 Gixxernaut 17116 1 This was exactly what I had done and chased the problem around until I searched here. Not the answer you're looking for?

Please click the link in the confirmation email to activate your subscription. HELP ! Can you post CPerson definition. students who have girlfriends/are married/don't come in weekends...?

How to cope with too slow Wi-Fi at hotel? share|improve this answer answered May 14 '09 at 18:17 Mark Ransom 180k22194398 Mark, I think you're mistaken(maybe), but i think it should be CArray(CPerson,CPerson&> allPersons. error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' It can be a frustrating error to try and diagnose. Move To Video Answer error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' Tags: visual-c++ mfc By : karthik Source: Stackoverflow.com Question!

Mayur S7789 28-Oct-13 6:16am What do you mean by "switch out your array class" JJMatthews 28-Oct-13 6:37am Read up on CPtrArray and CPtrList in MSDN. May 14 '09 at 19:10 //person.h class CPerson { public: CPerson(); CPerson(int i); private: char* m_strName; } //person.cpp CPerson::CPerson() { } CPerson::CPerson(int i) { sprintf(m_strName,"%d",i); } –Attilah May 14