|
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.
|
|
|
|
|
|
Thanks for the link....
But Can You Tell me how to create an XML file
In the tutorial....an XML file is already created..
Thats been loaded
|
|
|
|
|
There is a save method for the IXMLDOMDocument . so can add nodes to the XML file using the appendChild function and when you are done adding all the nodes and sub nodes, you can call the save function, which will flush the content of the IXMLDOMDocument to the specified file in the XML format.
|
|
|
|
|
Now Ive Created an Xml file.....
By Adding new item(.xml) in project settings...
Ive started with a dialog box....
on pressing ok..the file is opened...
The CODE IS:
void CXMLDOMFromVCDlg::OnBnClickedEnter()
{
XmlDocument *docXML = new XmlDocument;
docXML->LoadXml(S"");
}
Ive Also added :
#import <msxml.dll> named_guids
using namespace MSXML;
.................. in stdafx.h
im doing this using MFC AppWizard.....
this is not working......
im getting so many ERROR:
: 'XmlDocument' : undeclared identifier
: 'docXML' : undeclared identifier
: syntax error : identifier 'XmlDocument'
: left of '->LoadXml' must point to class/struct/union
: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option
|
|
|
|
|
anna mathew wrote: XmlDocument *docXML = new XmlDocument;
no no. There is nothing called XmlDocument, it is IXMLDOMDocument. Please read the article I suggested...
anna mathew wrote: By Adding new item(.xml) in project settings...
you add xml to project settings?? why?
|
|
|
|