|
1 - > (x, y)
2 - > (x, y)
3 - > (x, y)
The 1 to 3 is just a counter.
the x will always hold integer value.
the y will always hold bool value.
|
|
|
|
|
Ok, your explanation wasn't very clear.
And why don't you simply make a structure that will pack these two vales together ? And then you use a vector of these struct.
Something like:
stuct MyStruct
{
int x;
bool y;
};
std::vector<MyStruct> MyArray;
|
|
|
|
|
|
For two values, a std::pair would probably suffice
std::vector<std::pair<int, bool> > MyArray;
...
MyArry.push_back(std::make_pair(int_value, bool_value));
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
|
I build a MDI application, it contains 5 views. What is way to get information for order of view (view 1 is above view 2, view 2 is above view 3, ...).
-----------------
conglt
|
|
|
|
|
Hi,
U can get the view position by following.
this can be get from document class,
CUrDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
POSITION pos = pDoc->GetFirstViewPosition();
while (pos != NULL)
{
CView* pView = pDoc->GetNextView(pos);
}
pos is position which u can type cast to integer.
Parthi.
|
|
|
|
|
thanks
-----------------
conglt
|
|
|
|
|
hai,
iam getting a small problem with dialogs.when ever a dialog is displayed and when ENTER or ESC key is pressed then the dialog is terminating.so plz help me to sort out this problem.
sathish
|
|
|
|
|
You can override 2 function OnOK() (for ENTER) and OnCancel (for ESC). In override function, you don't call base function from class CDialog
Example:
void CMyDialog::OnOK()
{
//CDialog::OnOK();
}
-----------------
conglt
|
|
|
|
|
|
By default the enter key means IDOK and esc key means IDCANCEL commands. So avoid this you have to override the followings functions as...
void OnOK() { /* nothing to do */ }
void OnCancel() { /* nothing to do */ }
Try it...
- NS -
|
|
|
|
|
The Esc key is automatically mapped to the IDCANCEL command. So you can get over that by overriding the handler to create an empty function.
Your Enter key is probably calling the OnOK handler because your OK button has the default focus. Again you could override the IDOK handler and bypass the default action, but you should provide an alternative means of exiting yoru dialog (calling the CDialog::OnOk(), or EndDialog() functions), else your program will have no means of quitting.
I Dream of Absolute Zero
|
|
|
|
|
Yes, I forgot that... You have to map WM_CLOSE and call EndDialog( 0 ) from there (OnClose fn) inorder to process the dialog close.
- NS -
|
|
|
|
|
|
deal with the message "WM_KEYDOWN" in the function "PreTranslateMessage"
like this:
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message == WM_KEYDOWN)
{
int nVitKey = (int)pMsg->wParam;
if(nVitKey == VK_RETURN)
return TRUE;
else if(nVitKey == VK_ESCAPE)
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
than when you press the "enter"and"ESC" the dialog will not terminate.
bambooshan
|
|
|
|
|
Hi bambooshan,
Is this my answer?or mosali satish
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi,
I am trying to write a very simple application that mixes MFC with C++ Managed. I have two questions:
1. Is it possible to build the mixed project with the MFC library statically linked. I get some errors of conflict which I don't get when building with dynamically linked.
2. I want to use .NET functions that ask for System::String^ str. When I supply these functions with CString I get error. I read every where that it suppose to work.
CString str = _T("Works");
CString str2 = _T("Doesn't Work");
String ^ stringEx = gcnew String( str ); // OK
strinEx = str2; // Is not working
Thanks.
eladbo
|
|
|
|
|
|
I work in a LAN, IP address of my computer is 192.168.0.111, default gateway is 192.168.0.1
How do I get real IP address of LAN when connect to Internet? (ex:203.162.1.123)
-----------------
conglt
|
|
|
|
|
Your LAN does not have an IP address. It is just a collection of computers, printers, routers, etc. Perhaps you are wanting the firewall's IP address instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: wanting the firewall's IP address instead.
you mean the proxy?
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
Le Thanh Cong wrote: I work in a LAN, IP address of my computer is 192.168.0.111, default gateway is 192.168.0.1How do I get real IP address of LAN when connect to Internet? (ex:203.162.1.123)
try GetNetworkParams api
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I tried this function but only can get local information
-----------------
conglt
|
|
|
|