|
osanchez@prodys.net wrote: You can do it using CPropertySheet
but he asks for CPropertyPage. Also there is no OK buttons in the CPropertySheet ...right?
nave
|
|
|
|
|
Naveen R wrote: but he asks for CPropertyPage
Yes, i read it very fast
I don't imagine a propertysheet with different ok buttons in each page.
Cheers.
|
|
|
|
|
create a member variable for the OK button and when ever u want call the EnableWindow( FALSE ) to make it disabled.
nave
|
|
|
|
|
|
Hello
I want to create a CheckBox in Dialog in PPC using VC++.
Just like
CButton m_button;
m_button.Create(...);
But I can't declare CCheckBox member in Dialog
How could I create a checkbox in dialog??
Any suggestion is useful!! Thanks!!
|
|
|
|
|
sdhtyjnniutnbjnhbghb wrote: But I can't declare CCheckBox member in Dialog
there is no class called CCheckBox in MFC
u can create a check box by giving the BS_CHECKBOX style in the CButton::Create()
nave
|
|
|
|
|
checkbox has BS_CHECKBOX constant in create for example Create("Button",WS_CHILD|BS_CHECKBOX,...);
whitesky
|
|
|
|
|
Creating a check nox is the same way as a button only the dwStyle changes:-
myButton.Create(_T("Check button"), WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX, <br />
CRect(10,100,100,130), NULL, 1100);
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Hi,
I'm trying to activate a global function for several times (template function).
The only way I can figure how to do it is through a global variable, e.g.:
int dummy = SomeGlobalFunc();
I've wrapped this global variable definition with a preprocessed macro because I want to call the global function several times and for that I need to define a different global variable each time.
The problem is how to define a global variable with a different name each time (I can't use the predefined __COUNTER__ of VS beacause I need this code to be portable).
thanks,
Alon.
|
|
|
|
|
Maybe you can define your macro without the unneeded variable:
#define GLOBAL_CALL SomeGlobalFunc();
Even if the return value is not saved, the global function will be called.
You can also try this:
#define GLOBAL_CALL { int dummy = SomeGlobalFunc(); }
I hope this helps.
|
|
|
|
|
It's not that I need the return value of the global function, but because C++ doesn't support calling global functions I'm doing a little bypass by defining a global variable and initializing it by calling to the required function.
About the second idea, I thought it was a good idea too to define the global variable in a seperated scope and that way to prevent the need of defining different name for each global variable, but... the compiler decieded to yell that it's not possible defining seperated scope under the global scope.
|
|
|
|
|
In case of file level calling, I think you can try this:
#define MERGE1(a, b) a##b
#define MERGE(a, b) MERGE1(a, b)
#define GLOBAL_CALL static MERGE(dummy, __LINE__) = SomeGlobalFunc();
The __LINE__ macro, in contrast with __COUNTER__ , seems to be portable.
I hope it helps.
|
|
|
|
|
Yep, I've already tried this, but then I've realized that I might have several global variables defined in different files but at the same line.
So my next move was trying to concatenate also the __FILE__ macro in all kinds of ways but it didn't work.
What is the right syntax to concatenate dummy , __FILE__ , __LINE__ all in the same variable name ?
|
|
|
|
|
I think the suggested static modifier should prevent name collisions.
|
|
|
|
|
Hi,
I am adding somedetails of a page like page no.page title..etc..
and then im getting value from the same CptrList.
My problem is when adding to list the correct value is entered.But i get the value from list,at that time it shows wrong value.Pls help me..i ll show the code
For adding value to list..
POSITION hPos = GrPageList.GetHeadPosition();
while(hPos)
{
SGraphicsDet *pData = (SGraphicsDet *)GrPageList.GetNext(hPos);
}
pDet->iPageNo = iSelPg;//checked here..its correct
GrPageList.AddTail(pDet);
To get the value:
SGraphicsDet *pGrPgConf;
POSITION pos = GrPageList.GetHeadPosition();
while(pos)
{
pGrPgConf = (SGraphicsDet*)GrPageList.GetNext(pos);
if(pGrPgConf->iPageNo == (giSchPNo + 1))
SetSoftKeys(pGrPgConf,giSchPNo);
}
here pGrPgConf->iPageNo shows the wrong value.
For example in adding the PageNo is 1,but in getting this value it shows 0.
|
|
|
|
|
Anyway I dint go through the entire code. I suggest you to use CPtrArray instead because it is indexed. But the insertion will be much slower than List.
See the difference between the different template classes.
List
The list class provides an ordered, nonindexed list of elements, implemented as a doubly linked list. A list has a "head" and a "tail," and adding or removing elements from the head or tail, or inserting or deleting elements in the middle, is very fast.
Array
The array class provides a dynamically sized, ordered, and integer-indexed array of objects.
Map (also known as a dictionary)
A map is a collection that associates a key object with a value object.
See MSDN for more information.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
Hi,
I created a dialog using createdialog() in win32 program .And in that in created a edit box using createwindow.
I have handled WM_CTLCOLOREDIT like this
case WM_CTLCOLOREDIT:
hdc = (HDC)wParam;
SetTextColor(hdc, RGB(0,0,255));
hdc3 = GetDC(c_hwnd);//c_hwnd is handle to button
crBkgnd = GetBkColor(hdc3);
SetBkColor(hdc,crBkgnd);
GetSysColorBrush(COLOR_3DHILIGHT);
break;
here only i can see the change of color in text but background color is not changing to button default color (color is specified in code using crBkgnd)..
whenever text appears background color will be white...
Thanking you
Manjunath S
GESL
Bangalore
|
|
|
|
|
u should return abrush by which u want to draw the background...
case WM_CTLCOLOREDIT:<br />
<br />
<br />
hdc = (HDC)wParam;<br />
SetTextColor(hdc, RGB(0,0,255));<br />
<br />
hdc3 = GetDC(c_hwnd);
<br />
crBkgnd = GetBkColor(hdc3);<br />
SetBkColor(hdc,crBkgnd);<br />
return (LRESULT)GetSysColorBrush(COLOR_3DHILIGHT);
nave
|
|
|
|
|
I have created an edit control like the following ,But when i try to changes to readonly by adding ES_READONLY to edit control .but both text color and background color is changing to default(i.e text to black and background in not changing)when i add ES_READONLY.
c_hwnd = CreateWindowEx(0, "Edit", NULL,WS_CHILD,320, 220,318, 238,
d_hnd, NULL, hInst, NULL);
if(c_hwnd == NULL) {
MessageBox(NULL, "could not create window", "Error", MB_ICONERROR);
return 0;
}
Manjunath S
GESL
Bangalore
|
|
|
|
|
ok..When u add the ES_READONLY style, instead of WM_CTLCOLOREDIT, handle WM_CTLCOLORSTATIC
nave
|
|
|
|
|
See MSDN,
From the MSDN
Read-only or disabled edit controls do not send the WM_CTLCOLOREDIT message; instead, they send the WM_CTLCOLORSTATIC message.
whitesky
|
|
|
|
|
for this work you need to return brush else system use from defalt brush
whitesky
|
|
|
|
|
How I can create a win32 DLL Project in Visual Studio 2003?
Regards
Abhi Lahare
|
|
|
|
|
New Project --> C++ folder --> Win32 Console Application
Then a wizard window will pop up, go to settings and mark the DLL checkbox.
goodluck
|
|
|
|
|
Thanks Alon
Regards
Abhishake
|
|
|
|