|
Im using a map to store data.So i want to return the map.
map<int ,usercontrolinfo="">* RSUserControlContainer::GetAnswers()
{
//UserControlInfo is a structure
map<int, answertype=""> mapAnswers = new map<int, answertype="">;
---------------
--------------------------//Other code
-----------------------------------
return mapAnswers ;
}
But It give some errors.So how can i return a map from a function.
bhw
|
|
|
|
|
some syntax i typed here is not visible when i post it.map means map C++ map.
bhw
|
|
|
|
|
use <pre>, <, > symbols from formatting option when you compose the post
|
|
|
|
|
map<int ,UserControlInfo>* RSUserControlContainer::GetAnswers()
{
map<int, AnswerType> mapAnswers = new map<int, AnswerType>;
return mapAnswers ;
} The compiler is probably complaining about returning an AnswerType map when the function's return type specifies a UserControlInfo map.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
map mapAnswers, is not the pointer, Do you forgot it.
|
|
|
|
|
TobetheWinner wrote: But It give some errors.
What errors?
|
|
|
|
|
But you didnt say any thing about errors.
|
|
|
|
|
Hi All
I have a dialog based application, want to add feature that application should go to System Tray when cross(x) button of dialog is clicked,
For This;
I have used NOTIFYICONDATA and Shell_NotifyIcon( ) API, also in the OnCancel() handler used void ShowWindow(SW_HIDE); to fide the dilaog,
now what is my problem that this SA_HIDE hides the application immediately, but I want to make this happening as
dialog is going to system tray as per in GTalk and some other applications....
Please suggest me the answer for this ....
Waiting for your replies...
THANKS
|
|
|
|
|
|
Hi,
I'm dynamically creating a tab control as a child of a dialog. When it is displayed initially the client edge is not visible (but the tabs are shifted according to the place the frame needs). When the dialog is covered and afterwards visible again, the client edge is displayed correct.
To force an update directly after creating an adusting the tab control I sent a nc update messsage like
MyCTabCtrl.PostMessage(WM_NC_PAINT);
But this did not help, either.
Any ideas?
I'm still using VC6, MFC4.2.
Regards
Leo
|
|
|
|
|
Try this:
MyCTabCtrl.SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
I think this should work, assuming I understood your question properly.
Steve
|
|
|
|
|
Herewith I decorate you with the invisble medal for the fastest competent answer with a working solution .
Thx
Leo
|
|
|
|
|
hi i am calling a dialog function from another function as CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; but it is getting crashed in debug state? why this occurs pls help me;
my code is:
f(pCustInst->GetCheck())
{
CDialog::OnOK();
CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall;
CustomDlg->DoModal();
}
|
|
|
|
|
Hi,
I tested the same code without crash.
After 'if', are there anymore statements?
Thammadi
|
|
|
|
|
no i have to close the present dialog(from where i have to call the next dialog) and open the next dialog.
|
|
|
|
|
What happens if you run
CustomDlg->Create();
CustomDlg->ShowWindow(1);
|
|
|
|
|
Is the line where you call CDialog::OnOK() inside a member function of the CDialog?
Regards
Leo
|
|
|
|
|
Let's accallerate this, so that I do not need to wait for your reply.
Also I'm not sure, if my question was clear.
I suppose you are doing something like
DialogA::OnUpdateUI()
{
CDialog::OnOK();
pDialogB = new Dialog B;
...
}
Since OnOK() of the base clase does the same like hitting the OK button I guess that DialogA is destroyed. If this is true than at the next line you try to execute code in a non existent object.
Maybe
DialogA::OnUpdateUI()
{
DialogA.ShowWindow(FALSE);
pDialogB = new Dialog B;
...
CDialog::OnOK();
}
works?
Regards
Leo
|
|
|
|
|
yes its inside the member function
|
|
|
|
|
saisp wrote: ...but it is getting crashed in debug state?
Are we supposed to guess where?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I`m a programmer of C# and I`m starting to develop in C++.
Why is it that sometimes my intellisense will not work or show.
Just like in C#, if you just type first letter, it will show unlike in C++. Nothing happen. Is this the behavior of C++ 2005 express edition?
Can you explain...
Thanks in advance.
******************************
to know
everything
is to know
yourself...
|
|
|
|
|
This option may need to be turned on...
Tools/Options/TextEditor/C++/Formatting/Enable automatic Quick Info tooltips
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Ctrl+Space will bring up the Intellisense list.
|
|
|
|
|
There are very often problems with intellisense. sometimes works. Most of time doesn't work...most of the time it helps when you compile your program without errors...
Best regards
Hansjörg
|
|
|
|
|
Thank you to all of you. good work guys.
but it seems there is a bug on intellisense.
especially in C++. it doesn`t work sometimes
******************************
to know
everything
is to know
yourself...
|
|
|
|