|
i was confused! the skincombobox is used in winOS and actually is a mfc class ...
|
|
|
|
|
Hello I have no problem declaring a CArray variable inside a class definition but as I have a separate file that I place all my typedefs inside it have tried to define a struct that has a CArray member but compiler says:
Error 1 error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h 272
this was my code inside TypeDefs.H
typedef struct tag_compliance_info
{
LONG lModuleCode;
LONG lModuleVersion;
CString sModuleName;
CArray<POINT> aCompliance; //Oh I forgot this board filters <> signs
} STRUCT_COMPLIANCE_INFO;
How can I solve this?
modified on Friday, October 24, 2008 3:12 AM
|
|
|
|
|
use a Poiner CArray * or another object to substitute the CArray. is it really essential?
Greetings from Germany
|
|
|
|
|
Hi KarstenK ,
You mean there is no way? but why? there should be a reason. what other objects you mean?
Thanks
|
|
|
|
|
You got me wrong.
I think the constructor of the CArray dont like it that way. Do you really need the CArray? What will be in it?
Greetings from Germany
|
|
|
|
|
I'm not sure I still clear but do you mean CArray constructor has written in away that can't be declared in a struct and other objects do not have this problem. I want to store an array of 2 long int so either CArray<LONG,LONG>aMyarray or CArray<POINT>aMyArray Danke
|
|
|
|
|
Some constructors of the CArray aren't public (with good reason).
or try
typedef CArray<long,> CMyArray;
struct
{
CMyArray m_array;
}
Greetings from Germany
|
|
|
|
|
dose not work. I even tried to inherit my struct from CObject but since the problem is accessing private members not protected couldn't solve the problem!
typedef struct tag_compliance_info: CObject
{
LONG lModuleCode;
LONG lModuleVersion;
CString sModuleName;
CArray<POINT> aCompliance;
} STRUCT_COMPLIANCE_INFO;
|
|
|
|
|
why havent you tried it like i posted it you?
And you NEED a Array because the is a lot and different count of points
Greetings from Germany
|
|
|
|
|
KarstenK wrote: why havent you tried it like i posted it you? Unsure
Hello I did but as I said it dose not work.
you typed
ypedef CArray<long,> CMyArray;
struct
{
CMyArray m_array;
}
but I think there are many typos in it so I typed
typedef CArray<POINT> CMyArray;
typedef struct tag_compliance_info
{
LONG lModuleCode;
LONG lModuleVersion;
CString sModuleName;
CMyArray aCompliance;
} STRUCT_COMPLIANCE_INFO;
still I get
Error 1 error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h 272
KarstenK wrote: And you NEED a Array because the is a lot and different count of pointsConfused
Exactly
|
|
|
|
|
in VS2008 i could compile and link:
typedef CArray<point> CMyArray;
typedef struct tag_compliance_info
{
LONG lModuleCode;
LONG lModuleVersion;
CString sModuleName;
CMyArray aCompliance;
} STRUCT_COMPLIANCE_INFO;
or must use a pointer CMyArray* paCompliance;
Greetings from Germany
|
|
|
|
|
Well I use visual studio 2005
danke anyway
|
|
|
|
|
Hey everybody
I have a weird scenario that requires that 2 header file will include each other, and I'm not sure how should I do that.
I'll explain...
I have 2 Form: mainForm (mainForm.h) and subForm (subForm.h).
The mainForm opens a non-modal subForm -> meaning mainForm must include subForm.h in order to show it.
Now, the subForm, which is non-modal, can change things on the mainForm (for example, a button that displays text on the mainForm), meaning that subForm must have access to mainForms public functions -> in other words, I must include mainForm.h in subForm.
How can I perform something like that in C++ without getting into that problem?!
Thanks!
|
|
|
|
|
Green Fuze wrote: The mainForm opens a non-modal subForm -> meaning mainForm must include subForm.h in order to show it.
You can always use a pointer to the dialog class instead of an instance of the dialog class. This way, you only need to put a forward declaration in your header file.
See here[^] for instance.
|
|
|
|
|
pointing from one to the other isnt so clever: if something goes wrong you got an endless loop calling one each other.
Greetings from Germany
|
|
|
|
|
Thanks!
|
|
|
|
|
Make a common data object which is known to both Forms. If an Update is needed use a user defined message. I think this is also known as MVC (Model-View-Controller)
Divide view and data!!!
Greetings from Germany
|
|
|
|
|
Thanks!!!
sounds interesting...!
|
|
|
|
|
what you want to do is include the header files from the source file that will be making use of these functions or classes.
having header files include other header files can introduce circular dependencies and this will result in increasing the compile time.
this is not a hard and fast rule, but one i follow most of the time.
this way you include the source file once, where it is being used!
---
Yours Truly, The One and Only!
web: devmentor.org
Design, Code, Test, Deploy
|
|
|
|
|
Hi...
This may look simple...but our Customer raised a BUG regarding this !!!!!!!
Scenario is I have " Edit+spin control ",which takes integer values.If u Press Up arrow the number in the EDIT box will increase.
BUG :If u press UP ARROW and Hold on....and Press TAB button. then the focus is going to next Tab Control but the Spin control Uparrow is still in "Pressed State"....
I am also looking into this..but if u have any suggestions it will save my time.
Thanks in advance
EVEN SIMPLE OR DIFFICULT...Customer has no other word than BUG.
|
|
|
|
|
I need to Code a Program That Writes
The Employee information of a company
Into an XML file.... and to Read That file.....
Ive to do it in VC++ using APPWizard
|
|
|
|
|
life becomes simple if u use .net classes like:
XmlSerializer, XmlTextReader, TextWriter.
u have to include respective namespaces, System::Xml, System::Xml::Serialization.
|
|
|
|
|
This is a C++ forum, not a managed forum...
|
|
|
|
|
Hitting the right forum will make our lives easier too.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You can use tinyXML[^] library..
I hope it helps.
Regards,
Sandip.
|
|
|
|