|
Hi all,
i m using a groupbox when i add variablr for this groupbox than this error occurs.
and than i m not able to add variable for groupbox.
please tell me what can i do.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
Hi,
I made CListCtrl application which is used in column '0' checkboxes,column '1' comboboxes.when check combo will place,when you uncheck combo disappear.its working fine using onItemChanged() function.but problem is when user do double click check box becomes uncheck but combo placing in column '1' instead of disappear .am placing checkboxes dynamically using LVS_EX_CHECKBOXES.for this i need use dblclick event,then i should i write code?please help me in this.
Code Snippet:
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
int index=0;
int i;
index=pNMListView->iItem;
CStringList pComboList;
pComboList.AddTail("Sonu");
pComboList.AddTail("Sunny");
pComboList.AddTail("Cheechaa");
pComboList.AddTail("Srinu");
for(i=0;i < m_List.GetItemCount();i++)
{
bChecked=m_List.GetCheck(i);
CString strTemp;
strTemp.Empty();
strTemp.Format("%s",m_List.GetItemText(m_List.iRowIndex,1));
if(strTemp.IsEmpty())
{
if((i==m_List.iRowIndex) && (bChecked==1))
{
m_List.ShowInPlaceList(m_List.iRowIndex,1,pComboList,"");
//ShowinPlaceList is used for to place combo box
}
}
else
{
if(i==m_List.iRowIndex && bChecked==0) m_List.SetItemText(m_List.iRowIndex,1,"srinu");
}
}
*pResult = 0;
Regards,
Govind
|
|
|
|
|
Hi all,
i am using wmi for getting hard disk values...
SELECT * FROM Win32_DiskDrive
Now i am getting value in hard disk model name like this
hr = pclsObj->Get(L"Model", 0, &vtProp, 0, 0);
AfxMessageBox(vtProp.bstrVal);
also number of cylinders is also coming using this coding
hr = pclsObj->Get(L"TotalCylinders", 0, &vtProp, 0, 0);
AfxMessageBox(vtProp.bstrVal);
Now my problem is i am not getting value for Total Heads
its printing blank
hr = pclsObj->Get(L"TotalHeads", 0, &vtProp, 0, 0);
AfxMessageBox(vtProp.bstrVal);
hr = pclsObj->Get(L"TotalHeads", 0, &vtProp, 0, 0);
AfxMessageBox(vtProp.bstrVal);
in total heads value i am getting
156296385
I am not getting how to resolve it....
what method i should use to get values???
|
|
|
|
|
I think TotalCylinders, TotalHeads will be numbers(may be UINT or some other number data type)
So to get these values i think you have to access corresponding ( depending on the data type of field) member of VARIANT. Look MSDN for details of VARIANT. Does it make sense?
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
Are you sure that the variant in vtProp is a BSTR ? You should always check the value of vtProp.vt , as that tells you which data member of vtProp is valid. You can then convert vtProp to be a string using the VariahntChangeType function.
|
|
|
|
|
I used vtProp.vt parameter and it's returning 3 and in debug window its showing I4 = 255. Now what should i do to print this value?
|
|
|
|
|
Easiest way is to change the variant to a BSTR using VariantChangeType
VariantChangeType(&vtProp, &vtProp, 0, VT_BSTR);
AfxMessageBox(vtProp.bstrVal);
|
|
|
|
|
i want to display multiline tooltip on popup menu when mouse is moved over popup menu.
thanks in advance.
|
|
|
|
|
|
|
I have created an SDI application which i want to start maximised and disable the Restore button. For which i have written the following line in IniInstance().
m_pMainWnd->ModifyStyle(WS_MAXIMIZEBOX,0);
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->UpdateWindow();
With the above lines the window is shown maximised and the Restoredown button looks disabled. But when I double click the Titlebar, the window is being restored and can not be maximised then.
I want the window to be maximised or minised, but not to be resotred down.
How to do that.
Thank you
Saadhinchaali
|
|
|
|
|
You're probably better off handling WM_GETMINMAXINFO , and telling Windows what you want the minimum and maximum size of your window to be (hint: same size as the screen!).
|
|
|
|
|
Try handling the WM_SYSCOMMAND messages (OnSysCommand) and swalow the restore (SC_RESTORE) message. Don't know how reliable that is though...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
|
Check out this[^]and this[^]. Those links will be helpful.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
i hv a button(IDC_NEXT) thats functionality against mouse clicking is to switch to another dialog thats all fine but when i press space bar then execute the button clicking code and move to next dialog , i want to restrict it. for this i hv used pretranslate Message where capturing space bar event but still it execute function onNext() that is called when click next button so how to restrict this
if ((pWnd->GetDlgCtrlID() == IDC_NEXT))
{
if(ConfigMessage==VK_SPACE)
{
}
}
|
|
|
|
|
Is the input focus on your next button? Because if yes, then don't wonder it gets pushed when someone hits SPACE, it's written that way. If you don't see the focus rect, press ALT on your keyboard, that should make it appear, and if it sits on your button... if you only want the command message from the button when the user clicks on it and not when he uses the keyboard -and in my humble oppinion you shouldn't do that unless it is absolutely needed- you will have to subclass the button and overwrite its keyhit-handler(s).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
timeSetEvent is used to use multimidea timers and setTimer() is used to windows timer
either we can use boht timers at a time to perform different task
or is there any problem to use both timer at a time
what u will prefer we should use only one timer or can we use combination according to requirement
|
|
|
|
|
You can use them both at once. SetTimer is better integrated with the window messaging infrastructure (because it sends a WM_TIMER message on expiry). Multimedia timers are more accurate and have a higher resolution than SetTimer , but are harder to use (I suspect your callback runs in a different thread than the one you call timeSetEvent . Also, there are limitations on what you can call in hte callback).
|
|
|
|
|
My function:
void ConvertToUpper ( char name[] )<br />
{<br />
cin >> name ;<br />
int i = 0;<br />
while(name[i] != '\0')<br />
{<br />
if(name[i] > 'Z')<br />
name[i] += 'A' - 'a';<br />
i++;<br />
}<br />
}<br />
Why when entered, will it take John_Doe, and convert it to JOHN?DOE
|
|
|
|
|
yeah, just think about it a second (or 2 or 3 ) more.
Do/run/simulate your "algo" on paper, and see what happens to the "_" caracter.
This signature was proudly tested on animals.
|
|
|
|
|
void ConvertToUpper(char name[])
{
cin >> name;
int i = 0;
while(name[i] != '\0')
{
if(name[i] >= 'a' && name[i] <= 'z')
name[i] += 'A' - 'a';
i++;
}
}
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
Manish, thanks for the response, I meant--when you input John_Doe, it should translate to JOHN DOE with a space.
Now I see that "_" ASCII value is 95; if I add A - a to "_", i'll get "?".
So where would I add -63 to get a " " instead of a "?" when converting a "_"?
|
|
|
|
|
Why on earth would you wish to make it as cryptic as adding -63 to the numerical representation of the _ character?
Consider the following addition to your unchecked code:
void ConvertToUpper ( char name[] )
{
cin >> name ;
int i = 0;
while(name[i] != '\0')
{
<code>if (name[i] == '_')
name[i] = ' ';
else </code>if(name[i] > 'Z')
name[i] += 'A' - 'a';
i++;
}
}
EDIT: made an error and assigned the = character to name[i] if it was previously _
|
|
|
|