|
Stone Free wrote:
...its purpose is to allow the user to select/deselect 0 or more types that a particular row on a database table is applicable for.
If the items are mutually exclusive, use checkboxes instead.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The items arent mutually exclusive, hence 0 or more types. Zero types could be set or 3 of them or all of them. It needs to be a unified control so that I can have one of them for each row in the Listview that have been returned from the database.
|
|
|
|
|
Stone Free wrote:
The items arent mutually exclusive, hence 0 or more types.
Exactly my point. With radio buttons, one and only one in a group is selected. With checkboxes, all, some, or none of them can be selected. If you are allowing 0, 3, or all types to be set, then a checkbox is your only option.
In your original post, you likened it to a "voting control." When you are voting for a group of related items (e.g., size of pizza, score of an article), you only get to select one of them. If the items are mutually exclusive (e.g., toppings on a pizza, favorite programming language), then you can select any number of them.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Sorry when I referring to "Voting Control" I was talking about the look of the CodeProject article voting control, rather than its function.
OK, if we change this to a row of checkboxes where 0 or more items can be selected. I still need it in the form of a single control that would be able to return its state and live in each of the rows in the Listview control
|
|
|
|
|
Stone Free wrote:
OK, if we change this to a row of checkboxes where 0 or more items can be selected.
No problem. I've used this control for exactly that purpose. For each row was the name of a scheduled job in column 1, and in the other dozen or so columns were the different permissions (e.g., read, write, execute, delete, manage) for that particular job. Worked great.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I am having some problem with property sheet.
A property page contains static text and one command button (namely "Click")
When we press the Click button on a property page then static
text should be Changed or hide.
What should we write code?
rajesh
|
|
|
|
|
try,
((CWnd*)GetDlgItem(YOUR_STATIC_ID))->SetWindowText("the text");
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hi,
Please help me!
How use ProgressCtrl to present runing program in another main form?
Thanks
|
|
|
|
|
You need to do what ? Could you be a bit more specific ?
If you need to use a progress control, familiarize yourself with CProgressCtrl class in MFC. This class represents a progress control that can be stepped through to represent the advances during a lenghty operation.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Unless you know how long the other program is going to run and how long it has run (e.g., it has run 13 of 17 minutes, so the control will reflect 76% completion), a progress control is of no use here. Make sense?
You might want to further explain what you are after.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I want to open an image sequence or an avi file, and i want to process it frame by frame. Then i will show the result in a window (i mean in a dialog ).
How can i do this in mfc? The first step is, i will open an avi file and play it on the screen (in a window).
|
|
|
|
|
Have you tried CAnimateCtrl ?
|
|
|
|
|
I have a CWebBrowser2 control on my dialog. I navigate it in a worker thread.
It works on mostly computers, but on a few computers it can't browse the URL content.
I have monitored these status:
"NavigateError"
"NavigateComplete2"
"DownloadComplete"
"DocumentComplete"
On those computer that the CWebBrowser2 control refuse to work there is no "NavigateError", but after "DownloadComplete" there is nothing to happen, so I think there is something wrong in the display process, but I have no idea about the wrong and how to solve it. (winXP,win2k, ADSL)
Any suggestions?
|
|
|
|
|
Hi,
I have defined a new TreeCtrl in my project with checkboxes. What I would like to do is, that these checkboxes have a third state. Not only checked and not checked but also, the third state from the normal checkboxes (checked but disabled).
Is there any way to do this without bitmaps???
Thank you in advance!
Xia.
|
|
|
|
|
I have constant connection to the .mdb '97 file and use local variables for executing temporary queries:
CDaoQueryDef query(&db);
query.Create("", NULL);
query.SetSQL(strSQL);
query.Execute(strSQL);
...
query.SetSQL(strSQL);
query.Execute(strSQL);
When i execute 1000 INSERT/DELETE statement, I have more than 35MB memory lost, but when I comment just the execution lines, I have no memory losts.
Is this some DAO enternal caching that may allocate memory, cause I can't find any other reason?
were rgrtgrtvrtrt rtrtb brt tyuhjghj hbhbnh hnjm 1234567?
|
|
|
|
|
i wrote the following code
FILETIME ftNow;
SYSTEMTIME ftSys;
FILETIME ftTemp;
GetSystemTimeAsFileTime( &ftNow );
FileTimeToSystemTime(&ftNow,&ftSys);
SystemTimeToFileTime(&ftSys,&ftTemp);
here the problem is
ftTemp.dwLowDateTime != ftNow.dwLowDateTime
why?
but if i use
CoFileTimeNow(&ftNow) instead of GetSystemTimeAsFileTime( &ftNow );
the code works fine
why?
does any one know about it?
how can i get the actual file time as ftNow from the system time.
|
|
|
|
|
In either case, the wMilliseconds member of the SYSTEMTIME structure is the same. Since the GetSystemTimeAsFileTime() function does not need granularitry beyond milliseconds, the extra value can be ignored.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is that considered good or bad?
I just read a paper by Bjarne, where he used
Vector::Vector(int i) : sz(i), v(new int[i]) { } which I never do myself.
If heap allocation is needed, then I initialize the pointer with NULL in the member initialization list (MIL) and allocate the memory with new in the ctor body. But if you're using standard compliant tools that throws correctly if new fails, then it's perhaps OK to do it in the MIL.
Any thoughts on this?
--
The Blog: Bits and Pieces
|
|
|
|
|
i write a global CBT_HOOK function in a win32 DLL ,and i want to send a message to the DLL's calling windows.But it doesnt work. Here is my code:
HWND hCallWnd = NULL;
LRESULT CALLBACK CbtProc(int nCode,WPARAM wParam,LPARAM lParam)<br />
{<br />
switch(nCode)<br />
{<br />
case HCBT_CREATEWND: SendMessage(hCallWnd,MyMsgID,0,0);
break;<br />
}<br />
return CallNextProc(nCode,...);<br />
}<br />
void InstallHook(HWND hcallwnd)<br />
{<br />
SetWindowsHookEx(WH_CBT,CbtProc,DllHandle,0);
hCallWnd = hcallwnd;
}
the Error is : in InstallHook() function,the hCallWnd's value is correct. But in CALLBACK CbtProc() function, the hCallWnd's value is always ZERO! so my SendMessage() doesnt work at all.
Who can point out reason ?
|
|
|
|
|
The DLL is loaded into the address space of each process and each process gets a separate copy of the global variable. You need to put hCallWnd into a shared partition.
See this article[^].
|
|
|
|
|
Is there any function to know that the current logon user is Administrator or Limited user?
Jesa
|
|
|
|
|
Hi
I think this will help you...Buffer in this function will be having all informatin that you want...
1. NetUserGetInfo()
2. GetUserName (Win API)
"Most of the failures in their life are the people are those who don't how near they were from the solution"
- Mahesh Amarelia
Gujarat
India
|
|
|
|
|
I survey the MSDN for the two function,
I think the problem will be solved by the two function.
But I need more time to realize the usage for the two function.
Anyway, you really help me a lot! Thanks
Jesa
|
|
|
|
|
Years ago I had the same problem, how to know user has admin rights if admin's user name is e.g "john" or if the user name is admin, does s/he really have those privileges ? I solved the problem by opening ServiceControlManager's database requesting SC_MANAGER_ALL_ACCESS rights. If it won't open, user is not an admin, if it opens user is really an admin.
I don't know how correct way this is to solve the problem, but it worked fine, and I think it is also rather simple way to detectuser's admin-level rights.
BOOL XYZ::IsUserAdmin(){
SC_HANDLE hSC;
ENUM_SERVICE_STATUS enumsstat;
hSC=::OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS);
if(hSC==NULL){
DWORD dwErr;
dwErr=GetLastError();
char szMsg[300]="";
switch(dwErr){
case ERROR_ACCESS_DENIED:
return FALSE;
break;
case ERROR_DATABASE_DOES_NOT_EXIST:
wsprintf(szMsg,"ServiceControlManager Database doesn't exist");
break;
case ERROR_INVALID_PARAMETER:
wsprintf(szMsg,"Invalid parameter while executing OpenSCManager()");
break;
default:
wsprintf(szMsg,"Error when executing OpenSCManager(), Error code is %ld",(long) dwErr);
break;
}
AfxMessageBox(szMsg);
return FALSE;
}
::CloseServiceHandle(hSC);
return TRUE;
}
|
|
|
|
|
Thanks for your answer!
This way works fine
Jesa
|
|
|
|