|
b coz, i want the edit box to be dstroyed when it loses the focus.
the user can press F4 key again to create it.
it will b good if edit box disappears, when user hits Enter key.
thanks
|
|
|
|
|
-----edit box creation on pressing F4 key-----
case VK_F4:
{
CMainFrame* pMainWnd = (CMainFrame*) AfxGetMainWnd();
pEdit = new CEdit;
pEdit->Create(ES_AUTOVSCROLL | ES_WANTRETURN | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER,
CRect(0,col+(m_nCurSel*2),75,col+(m_nCurSel*2)+17), this, IDC_ED);
pEdit->SetLimitText(50);
pEdit->SetFocus();
}
------ function that receives keypress---
void CMarketWatchView::OnEditKeyDown(UINT nChar)
{
static const MSG* pMsg = GetCurrentMessage();
if(pMsg->wParam==0x0D) //checkfor enter key
{
AfxMessageBox("Enter key");
- other code here-
}
pEdit->SetFocus();
}
---------lost focus function for the edit box ----
void CMarketWatchView::OnEditKillFocus()
{
char buf[50];
pEdit->GetWindowText(buf,49);
--other code here--
Invalidate(FALSE); //redraw
delete pEdit;
}
|
|
|
|
|
Why are you killing the edit in the OnEditKillFocus?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I'd guess that they want to implement 'in-place' editing of text in a view, and clicking somewhere else is intended to complete/cancel the edit, collapsing the box.
Of course, that's only based on a glimpse of the code fragment, so I could be completely wrong
Steve S
|
|
|
|
|
I meant why not hiding it?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
OIC. That's a good question...
Steve S
|
|
|
|
|
Hi all,
How to resize/place the activeX control in a container window, By default the
activeX control is resized to Full window size in which it is hosting how i can avoid that.
Thanks in Advance,
Abhishake
|
|
|
|
|
Why is iostream.h & fstream.h missing from VC++.NET include folders.
If I copy the same files from VC6.0 then I get errors in those files.
What can I do, where can I get those header files and if not what headers can I use instead of fstream.h
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
try to include instead :
#include <iostream>
#include <fstream>
TOXCCT >>> GEII power
|
|
|
|
|
"iostream.h" and "fstream.h" are not part of C++. Look at "iostream" and "fstream" and then the 'std::' scope.
#include <iostream>
#include <iomanip>
#include <fstream>
void SomeFuncToReadFile ( const char * sFile )
{
std::ifstream in ( s ) ;
if ( !in )
{
std::cerr << "Couldn't open input file : " << s << std::endl ;
return ;
}
in.unsetf(std::ios::skipws) ;
}
Paul
|
|
|
|
|
I currently do:
_stscanf(string, L"%x", &number);
it doesn't seem like any of the atoi/l functions can handle hexa-decimal input,
any suggestions for something cleaner, or is as clean as it gets ?
|
|
|
|
|
do this :
<font style="color:blue;">char</font> str[2]; <font style="color:green;">
<font style="color:blue;">unsigned char</font> ucConvertedNumber,
MSB, <font style="color:green;">
LSB; <font style="color:green;">
LSB = ((str[1] >= <font style="color:purple;">'0'</font>) && (str[1] <= <font style="color:purple;">'9'</font>)) ? str[1] - <font style="color:purple;">'0' </font>:
((str[1] >= <font style="color:purple;">'a'</font>) && (str[1] <= <font style="color:purple;">'f'</font>)) ? str[1] - <font style="color:purple;">'a' </font>+ 10 :
((str[1] >= <font style="color:purple;">'A'</font>) && (str[1] <= <font style="color:purple;">'F'</font>)) ? str[1] - <font style="color:purple;">'A' </font>+ 10 : -1; <font style="color:green;">
<font style="color:green;">
MSB = ((str[0] >= <font style="color:purple;">'0'</font>) && (str[0] <= <font style="color:purple;">'9'</font>)) ? str[0] - <font style="color:purple;">'0' </font>:
((str[0] >= <font style="color:purple;">'a'</font>) && (str[0] <= <font style="color:purple;">'f'</font>)) ? str[0] - <font style="color:purple;">'a' </font>+ 10 :
((str[0] >= <font style="color:purple;">'A'</font>) && (str[0] <= <font style="color:purple;">'F'</font>)) ? str[0] - <font style="color:purple;">'A' </font>+ 10 : -1; <font style="color:green;">
<font style="color:green;">
MSB = MSB << 4;
ucConvertedNumber = MSB | LSB;
you've got it...
you can nox do :
printf(<font style="color:purple;">"Decimal form :%d\n"
"Hexadecimal form :%x\n"</font>,
ucConvertedNumber,
ucConvertedNumber);
TOXCCT >>> GEII power
|
|
|
|
|
long strtol( const char *nptr, char **endptr, int base );
acString
strtol(acString, NULL, 16);
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
this is the function i was looking for
|
|
|
|
|
ok for a function, but understand what it does because it isn't a standard function...
TOXCCT >>> GEII power
|
|
|
|
|
Nice joke.
God is Real, unless declared Integer.
|
|
|
|
|
ok, i was thinking of another.
just verified.
TOXCCT >>> GEII power
|
|
|
|
|
hi ppl,
I am creating a Client server application using Asyncsockets using MFC.
my application is running well on the local server.
but the problem starts when it's client side is used on other computers on lan
Like
for the first time the client connects to the server every thing goes on smoothly but when the connection closes from the client side the server closes all the connection but on the client side the connection goes to the FIN_WAIT2 and reamins there and no message can be sent from there on so the application halts.
I donn know what to do help me?
|
|
|
|
|
ok i think i also faced similar situation when i encounter this problem.
the solution is that you override the function OnClose()
of AsyncSocket of MFC
and In OnClose()
close the socket connectiong socket ok
i think it work
Alok Gupta
visit me at http://alok.stormpages.com
|
|
|
|
|
hi alok,
thanks a lot for ur reply,
but eventually i figured out my problem was not related with opening or closing but what i am using is ASyncSockets which are by default NON blocking sockets as a results the connection closes automatically if there is no buffer recieved so i used CSocket class ie a Blocking Socket class as a result untill unless the Buffer is recieved the connection is alive.
thanks a lot again
|
|
|
|
|
This function can be founded in tools menu in VC 6.0, however, I cann't get any idea in VC.net. Thanks.
|
|
|
|
|
I only have Visual Studio .NET 2002 installed.
The similar one is "Object Browser" (Ctrl - Alt - J) found in Visual Studio .NET 2002.
Maxwell Chen
|
|
|
|
|
yes, I have found it. And how can we use the functions such as Call Graph or Caller Graph in Source Browser. Thanks.
|
|
|
|
|
I dunno. Even the "Browse Information" fails!
Maxwell Chen
|
|
|
|
|
Sir,
I am integrating flash with VC++.
I am using Dialog Based App.
I inserted this Active X Control.
I wanted to show both this Control and Dialog Window in a maximized state.
I called ShowWindow(SW_MAXIMIZED) in OnInitDialog.
When I execute the App I get the main window in maximized but the control in that is not at all maximized.
Pls help.
Regards
Chintu
|
|
|
|