|
Thank you guys for all of your help!
I tried doing:
myEditCtrl.ModifyStyle(WS_VISIBLE, NULL); but it does not work.
The ctrl is initially set to visible.
Anything else you can suggest?
|
|
|
|
|
Do what Chris said, it's the easiest and most correct way to do it.
myEditCtrl.ShowWindow(SW_SHOW), myEditCtrl.ShowWindow(SW_HIDE)
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
myEditCtrl.ShowWindow(SW_HIDE) & myEditCtrl.ShowWindow(SW_SHOW) does not work either. Is there a limitation with Visual Studio 6.0?
|
|
|
|
|
Wow - I've been trying to answer this since you posted it. CP is SO slow at times...
I just did a dialog app in VC6, and added an edit and a button, the button does this:
void CDialogTestDlg::OnButton1()
{
m_Edit.ShowWindow((m_bState) ? SW_HIDE : SW_SHOW);
m_bState = !m_bState;
}
Works like a dream. Have you verified that your SW_HIDE/SW_SHOW code is being called ? Is it being called AFTER the control is created ? Is your variable pointing to the right control ?
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Thanks again! How do I verify that SW_HIDE/SW_SHOW is being called?
|
|
|
|
|
Set a breakpoint (F9 and it will stop there when you run in debug mode ), or
AfxMessageBox("Here I am, isn't it peachy ??");
Just below the line.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Christian,
Thanks for all of your help! I made sure the control is created before I make this call. But, still not working.
I am headed out for the evening, but will try your suggestion later tonight.
Thanks again!
|
|
|
|
|
It's bound to be something simple. I'd suggest following my steps, create a dialog app, with an edit and a button, set up a bool and insert the code I posted. Then work backwards to figure out what is different in your code.
Good luck !!
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Is the there a way to change a project which was originally created to dynamically link to statically link to the MFC. TIA
Matt(Padawan Learner)
|
|
|
|
|
|
Thanks. I had been trolling around there but must have missed that option.
|
|
|
|
|
You may also need to select project, settings, c++, code generation (from memory) and make sure that the C runtime is also statically linked.
Cheers,
Rob.
|
|
|
|
|
No need, when you change the MFC link type, it automagically changes the CRT link type as well.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
From DevStudio menu
Project>Settings>General>Microsoft Moundation Classes:
Use MFC in a static library
|
|
|
|
|
Thanks all. I got it changed and running. Sometimes there are too many options and I get wrapped around the axle looking for the right one.
Matt ( Padawan Learner )
|
|
|
|
|
i want to write code in vc that should capture any packet on the network and extract information from it like source ip address, destination ip address, packet length etc. i need some help in writing such code.
|
|
|
|
|
in the win2000/xp section check out my article ! you`ll be astonished !
it`s all about wisock hooking and a fully functional programme !
//if you like rate it ! 10x
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
This isn't a programming question per say, but I didn't really know where else to post it.
I see a lot of people who use the icons from the Visual Studio.net IDE in their projects on here and I'm just wondering if anyone knows where to get them from. Are they included with Visual Studio.net? Are they downloadable?
thanks.
|
|
|
|
|
Hello,
I am trying to paint a simple yellow border around my CRichEditView.. I tried the following and it paints the border but nothing inside.. Can anyone give me some help, I'm a newbie when it comes to Custom painting.
void CMyRichView::OnPaint()
{
CPaintDC dc(this);
CRect border;
GetClientRect(&border);
dc.FillSolidRect(0,0,1,border.bottom, RGB(255,255,128));
dc.FillSolidRect(0, 0, border.right, 1, RGB(255,255,128));
dc.FillSolidRect(border.right-1, 0, 1, border.bottom, RGB(255,255,128));
dc.FillSolidRect(0, border.bottom-1, border.right, 1, RGB(255,255,128));
}
Thanks,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
You fill a rectangle with color, the actual inside of the control is masked by the filling.
OnPaint will paint the client area of the control. I suggest you paint in the OnNcPaint.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Thanks for the post.. I have tried this with no success..
LRESULT CMyViewView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == WM_NCPAINT)
{
CClientDC dc(this);
CRect border;
GetClientRect(&border);
dc.FillSolidRect(0,0,1,border.bottom, RGB(255,255,128));
dc.FillSolidRect(0, 0, border.right, 1, RGB(255,255,128));
dc.FillSolidRect(border.right-1, 0, 1, border.bottom, RGB(255,255,128));
dc.FillSolidRect(0, border.bottom-1, border.right, 1, RGB(255,255,128));
}
return CRichEditView::WindowProc(message, wParam, lParam);
}
If I use CClientDC the border doesn't show but the document shows.. If I try CPaintDC the border shows but nothing inside the border (document doesn't show)..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Adding this to the bottom seemed to fix my problem...
InflateRect(border,-1,-1);
RedrawWindow(border,NULL,RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
Thanks,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hey all I need some "C++ 101" help,
I am working on a function that reads in a string and converts it into a CTime, using atoi( ) . The function declaration is
bool ConvertTimeStr(const CString& TimeStr, CTime& Dest)
any suggestions on how I can convert a string such as "12:00:00" into 12:00:00
|
|
|
|
|
GRAMI04 wrote:
any suggestions on how I can convert a string such as "12:00:00" into 12:00:00
Read this: Date and Time in C++[^]
-Nick Parker
|
|
|
|
|
The quoted article will help I'm sure, but I have found the following 2 approaches to be useful, alone or in combination.
1) The MFC COleDateTime class provides some string parsing capabilities, and you can then check the GetStatus() return code.
2) Alternatively, you could try something like:
bool ConvertTimeStr(const CString& TimeStr, CTime& Dest)
{
int hh, mi, ss;
char ch;
// ch catches junk beyond end of string
if (sscanf(TimeStr, "%d:%d:%d%c", &hh, &mi, &ss, &ch) != 3)
return false
// now check for valid days of month etc.
// The MFC classes can be used to do this.
return whatever!!
}
|
|
|
|
|