|
I have created a mfc application with vs2008 Pro. I have included a dockable pane ( all standard from the wizard). I created a dialog and would now like to write to the dockable pane from the dialog.
When I try to access it I get "cannot access protected member" is it possible to write to these windows from a dialog ? and if so does anyone know how.
I have tried so many things the one I am trying to write to is
"COutputList m_wndOutputBuild" created in the standard OutputWnd.h file created by the wizard.
|
|
|
|
|
georgeo wrote: When I try to access it I get "cannot access protected member" is it possible to write to these windows from a dialog ? and if so does anyone know how.
You can provide an accessor function to get to that object and then call appropriate methods on it to write to output pane. Should be simple enough.
For e.g. a method like
GetOutputPane().Write( "Hello testing output pane" );
Hope I understood your question!
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
When I install vs2005 in vc++ directory setting I found
$(VCInstallDir)PlatformSDK\bin
$(VSInstallDir)Common7\Tools\bin
but in environment variable i could not found value of
$(VCInstallDir) and $(VSInstallDir) .
so where i found them I want to change them
Trioum
|
|
|
|
|
trioum wrote: so where i found them I want to change them
Why would you like to change them ? That's crazy. If you would do so, a lot of stuff wouldn't work anymore. Keep in mind that if you change those environment variables, it doesn't change the physical location of the install directory. So, all your header files and libraries won't be located anymore.
Why would you like to do such a thing ? What is the problem ?
|
|
|
|
|
actually I want to know where these variables store .I didnt find in
environmental variables list. Also I want to set my own. can u guide me , how to achieve this.
Trioum
|
|
|
|
|
Hai,
i am having a doubt..
When to use pointers and references..?
Please tell me the scenarios...
Thanks,
Mani..
Born to win...!
|
|
|
|
|
This[^] should give you some idea.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Please refer here[^].
Regards,
Paresh.
|
|
|
|
|
|
I think both servers the same purpose. But, usually References are preferred over pointers as the reference can not be a NULL as like pointers. In some scenario pointers are the only solutions. Like the function which returns the object or NULL (specifying failure).
But pointer isn't alternate solution for reference. Because you must have to make use of references while overloading an operator or providing an explicit copy constructor.
- Malli...!
|
|
|
|
|
|
Additional to the links from the previous posters....
Rule of thumb: Use references when ever possible, pointers when necessary.
|
|
|
|
|
Hi All,
I am using the function unbuffered(int) in my project in VC 6.0 but when i compiled in .Net it is showing error saying that it is an undeclared identifier. This was inlcuded in the header Streamb.h in VC6.
But I couldn't find the header in VC++.Net. May I know whether this function has been taken out in .Net or is there any equallent function for the same?
thanks and regards,
Rajesh
|
|
|
|
|
Hi all
I have an assignment where I have to implement the abstract data type (ADT) Set which defines a set.
The following applies to sets:
• There must only be one occurrence of each element in the set (no duplicates allowed)
• The elements in the set are not ordered (they are not in a particular order)
• The union of two sets A and B (A U B) results in a new set containing the same elements as in A and also the element that are in B, but no duplicates.
• The difference between two sets A and B (A - B) results in a new set containing the elements that are in A but not on B.
•The intersection of the sets A and B produces a new set which contains all the elements that are equal in sets A and B.
The set is described by:
template <class t="">;
class Set
{
private:
class Node
{
public:
T data;
Node *next;
Node(T data) { this->;data = data; this->;next = NULL;}
~Node(){}
};
Node *first;
int nrOfNodes;
public:
Set();
Set(const Set<t>& set);
virtual ~Set();
void insert(T item);
T remove(T item); // returnerar det element som tas bort
bool isMember(const T& item) const;
int size() const;
Set<t> operator=(const Set<t>& set);
Set<t> operator+(const Set<t>& set) const; // union
Set<t> operator-(const Set<t>& set) const; // differense
Set<t> operator*(const Set<t>& set) const; // snitt
};
The storage structure for the set is a single-linked circular list (the next-pointer of the last element points at the first element).
I have created some empty functions for far for easy compiling,
//search
template <class t="">
bool Set<t>::isMember(const T& item) const
{
// return index if found or -1 if not found
Node* p;
int count = 0;
for (p = front; p != NULL; p = p->link)
{
if (p->data == item)
{
return true;
}
count++;
}
return false;
}
//add
template <class t="">
void Set<t>::insert(T item)
{
}
//remove
template <class t="">
T Set<t>::remove(T item)
{
}
//Display
template <class t="">
void Set<t>::display()
{
Node *q;
for( q = first ; q != NULL ; q = q->next )
cout<<q->data<<", ";
}
void main()
{
Set<int> SetA(10), SetB(10);
Set mySet(SetA);
}
When I compiled I get the following errors
cannot convert parameter 1 from 'int' to 'const Set<T> &'
with
[
T=int
]
Reason: cannot convert from 'int' to 'const Set<T>'
with
[
T=int
]
No constructor could take the source type, or constructor overload resolution was ambiguous
d:\visualprogrammes\linkedlist\linkedlist\linked_list.cpp(73) : error C2514: 'Set' : class has no constructors
d:\visualprogrammes\linkedlist\linkedlist\linked_list.cpp(6) : see declaration of 'Set'
Can someone please help, I can't see why the code in the main can't compile.
Thank you!
|
|
|
|
|
You'll have to define a parameterized constructor (that takes int parameter) for the class Set. And I wonder what you're trying to achieve by passing int parameter to Set class i.e. are you passing the size (10 items) or data (element) for the set. You'll have to code the parameterized constructor according the functionality required.
- Malli...!
|
|
|
|
|
Thanks Malli,
Can you please help to give some examples, if I want to pass dat (element)? I have no idea how to do it. Thanks.
|
|
|
|
|
you can refer STL implementation of set, [STL::Set class^] it is defined in <set> header file.
|
|
|
|
|
Hello friends!
Can anybody suggest me how we r going to design this system.As i have no idea regarding it.......Need initiative ....Actually where should we start
Thanx !
|
|
|
|
|
|
Hi all,
i m Using SDI type application in VC++2005.
in Dialog box i m using a ListCtrl and other controls like EditBox,TextCtrl,ComboBox.
i want if i click on ListCtrl than the relevant information show in other controls.
how can i do this please help me for this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I would add a handler for the click event of the list control, and add control variables for other controls of my interest and do the updating. Where are you stuck?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
can u please tell me with example.
i m using the click event of List control. but i dont know how can show the value at this time in other controls.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
For example, if you would like to update an edit control, add a control variable to it (CEdit type) and name it, say c_edit . In the click event handler of your list control, update the value of your edit control using the control variable c_edit.SetWindowText() .
Here[^] is an example, which demonstrates how to use the CEdit control. You may have to add control variables for other controls and update them as well.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks sir.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
You're welcome sir.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|