|
How can I make an Editbox control visible or invisible
throw the code.
I know : object.visible=1
but what is the object???
can some one can give an example
( let's say that the edit controll ID is ID_EDIT2
|
|
|
|
|
CWnd* pCtrl = GetDlgCtrlID(ID_EDIT2);
if ( pCtrl )
if ( pCtrl->IsVisible() )
pCtrl->ShowWindow(SW_HIDE);
else
pCtrl->ShowWindow(SW_NORMAL);
Is this what you are looking for?
Chris
|
|
|
|
|
Shouldn't that be
<br />
CWnd* pCtrl = GetDlgItem(ID_EDIT2);<br />
Michael
|
|
|
|
|
Thanks, Michael.
You are correct. In my haste to post, I forgot to try and compile
Chris
|
|
|
|
|
When using very large coordinates for GDI calls there's seems to be severe performance hits. (Let's say I have a client area (0, 0, 100, 100) and call make these calls: dc -> MoveTo(-30000, -30000); dc -> LineTo(30000, 30000);)
I store my objects as floats, do my own scaling, and since allow a very generous scale these large values will show up even for normal objects after conversion to device coordinates.
Adding a clipping region doesn't seem to help so I want to know if I have to do the clipping myself?
I'm using Windows 2000 and I don't think 16-bit GDI is the cause of the problem.
|
|
|
|
|
Hello,
Our projects currently use ifsteam to read in a custom configuration text file (just comma delimited). We just realized (actually QA did) that these files are not locked when opened and can cause some major problems when both projects are run at the same time. Without re-writing a huge portion of code, is there an easy way to lock a file when it is opened? I couldn't find any ios:: flags that would do this for ifstream. We are using VC++ 6.0 and the standard STL library that it ships with.
Thanks in advance!
|
|
|
|
|
There's a 3rd parameter to open which defaults to filebuf::openprot. Search for that definition in the ifstream header or your docs. It's defined as the share/prot mode.
Todd Smith
|
|
|
|
|
I think I realized that there's more to this on our side as well. The file is already closed when the other program opens it up, so I need to do some file locking to prevent this.
Thanks for the reply. The help files for STL that ships with VC++ is horrendous and needs a face lift. Just displaying a cryptic class doesn't count as help in my book!
Derek
|
|
|
|
|
Hi,
perharps it's me just not searching deep enough, but I can't seem to find basic instructions to make and use a DLL. Where should I start?
Thanks!
|
|
|
|
|
I had exactly the same problem when starting out.
Check out : http://www.codeguru.com/dll/index.shtml
There are different types, the main issues are whether you require to build upon MFC objects, or are dealing with C++, as opposed to simply calling a C function.
The other question is whether you want to link at runtime.
The simplest way to get started is probably to create a function declared
as follow, in a WIN32 DLL App Wizzard Project:
extern "C" __declspec(dllexport) long test(char *szTestParam)
Then to use the DLL in another project, you must adjust the project settings to link to the lib file for the project (in the library text box).
And declare
extern "C" __declspec(import) long test(char *szTestParam;
Your then free to use the function.
Simple as that, (Well! Once you get stuck into it, it's straight forward!)
Have Fun Hope I've Helped
Rich
|
|
|
|
|
//function
BOOL& EvaluatingEditChecks()
{
CRreFrameWnd* pRreFrameWnd = ::RreGetMainWnd();
ASSERT (pRreFrameWnd);
return pRreFrameWnd->m_bEvaluatingEditChecks;
}
//calling code
::EvaluatingEditChecks() = TRUE;
int nEvalState = pEditCheck->m_pExprRoot->Evaluate(pRreDlgEntry);
::EvaluatingEditChecks() = FALSE;
Can you explain what assigning true and then false to a fuction means?
thanks
|
|
|
|
|
It is equivalent of the following
//calling code
// ::EvaluatingEditChecks() = TRUE;
CRreFrameWnd* pRreFrameWnd = ::RreGetMainWnd();
ASSERT (pRreFrameWnd);
pRreFrameWnd->m_bEvaluatingEditChecks = TRUE;
int nEvalState = pEditCheck->m_pExprRoot->Evaluate(pRreDlgEntry);
//::EvaluatingEditChecks() = FALSE;
CRreFrameWnd* pRreFrameWnd = ::RreGetMainWnd();
ASSERT (pRreFrameWnd);
pRreFrameWnd->m_bEvaluatingEditChecks = FALSE;
|
|
|
|
|
The function returns a reference to a variable. So setting the function to true is actually setting the variable it returns to true.
They do it that way becasue it makes generating code from wizards etc. easier. I wouldn't make a practice of that code technique in normal code.
Todd Smith
|
|
|
|
|
hi all,
i have an MSChart control in my application. the values are calculated dynamically after some user input, i have one row (group of data) and several columns. i use a barchart type.
i want to change the color of a specific column if its value exceeds a limit. how do i manipulate the color drawing of a column ? the answer should lie somewhere in the CVc..classes but i m lost there.. any help ?
my error(?) code :
CVcPlot aplot = m_pChart->GetPlot();
CVcSeriesCollection aSerCol = aplot.GetSeriesCollection();
CVcSeries aSeries = aSerCol.GetItem(1); // i have 1 series only
CVcStatLine aStatLine = aSeries.GetStatLine();
CVcColor aColor = aStatLine.GetVtColor();
aColor.Set(120, 120, 120);
and saw no change in the color of the bar..
tia, giorgos
|
|
|
|
|
I´m trying to store a buffer received from a server in a CString.
The buffer contains data of users connected to server.
Everything works fine until i connect 4 users and refresh.
Then an assertion occurs in this line:
csRcv.GetBufferSetLenght(nRecvlenght);
Any Idea???
I´m very on this.....
HELP PLZ!
|
|
|
|
|
Thats a very dangerous function to use. Are you sure, you need to use it. Are you calling ReleaseBuffer anywhere before this line? Have you called GetBuffer? and what about the value of nRecvlength?
Nish
|
|
|
|
|
Hi,
About 8 years ago I used to develop in C++. That was back in the DOS days when Borland Turbo C++ was king. I mention this so you won't laugh when I tell you that for the past number of years I’ve been writing code in VB.
Recently, though, I installed the VC++ and have started to use it for a few DLLs. But now I’m wondering where to begin with developing a GUI in VC++? I went thought the scribble example in MSDN, so I know about Documents, Frames, and Views. But how do you use real controls in a window. Everything I see about controls seems to talk about placing controls in a dialog box. I’m not interested in creating a dialog-based app. I want an MDI app with child windows but I don’t know how to add controls to a child window. Could someone give me a few pointers? Maybe a web page that explains this.
Thanks!
Carl
|
|
|
|
|
Derive your view from CFormView
Or manually create your controls using CreateWindow,CreateWindowEx
Nish
|
|
|
|
|
MFC has a special view type called CFormView, this is basically a dialog inside a view. Search http:\\msdn.microsoft.com for more info.
Michael
|
|
|
|
|
Thanks guys,
CFormView was the key.
Carl
|
|
|
|
|
Don't you hate it when you work hard on your project, only to find your client isn't so impressed just because of what it looks like on the outside?
If you need help with graphics and user interface layout, Z Web Graphics can help. We specialize in working with developer's to give your project the image it deserves. We know how hard you work behind the scenes, and we will help you reflect that on the surface.
All you have to do is email us at info@zwebgraphics.com, or fill out our customer profile form located on our website at www.zwebgraphics.com. It all can be done via email, by you telling us a little bit about you and your project, then we can begin designing mock up layouts, and sending you graphics via email. It is all very easy, and very inexpensive.
Contact us at info@zwebgraphics.com or visit our website at www.zwebgraphics.com for more information.
Z Web Graphics
a programmer's best friend
|
|
|
|
|
You know, I'll bet Chris would be pleased to sell you some space, here on CodeProject, for your add...
Just keep it out of the forums!
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I would join in Anders in urging everyone not to consider doing business with people who have no idea of Netiquette and think they can get a free ad out of the forums instead of placing an ad on the site where it belongs.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
|
I have created a simple dialog and want to capture when a user presses a key, I have tried handeling the WM_KEYDOWN and WM_KEYUP events but they don't seem to get called! any ideas??
andy solman
|
|
|
|