|
You can get some of the properties using GetSystemMetrics().
SM_CMOUSEBUTTONS will get you the number of buttons.
SM_MOUSEWHEELPRESENT will tell you if it has a wheel.
SM_SWAPBUTTON will tell you if they swapped their buttons (left handed).
|
|
|
|
|
I have created a bmp file.
Using CImage can load the file and save as a another file format like tiff, but how can i set the DPI of the image.
Please help, thanks.
|
|
|
|
|
|
I am declaring a list and add in contents into it~
But i am always unpredictably facing the display problem~
For example, i am reading information from a database entry by entry, but what is displayed in the list control is totally out of order, and correspondance is wrong. what is worse, some of the colums are blank though i can see the entries are correctly inserted into the list(i have traced this using break point).
The code i used is as below:
(m_bList is the list control declared)
int index;<br />
for(index = 0; index < total; index++)<br />
{<br />
LV_ITEM lvi;<br />
lvi.mask = LVIF_TEXT;<br />
<br />
lvi.iItem = index;<br />
lvi.iSubItem = 0;<br />
lvi.pszText = (LPSTR)(LPCSTR)sbatchid;<br />
lvi.lParam = 1;<br />
m_bList.InsertItem(&lvi); <br />
<br />
lvi.iSubItem = 1;<br />
lvi.pszText = (LPSTR)(LPCSTR)page;m_bList.SetItem(&lvi);<br />
<br />
CString modi = time.Format("%Y/%m/%d/%H:%M");<br />
<br />
lvi.iSubItem = 2;<br />
lvi.pszText = (LPSTR)(LPCSTR)modi;<br />
m_bList.SetItem(&lvi);<br />
}
|
|
|
|
|
zhaopi wrote:
what is displayed in the list control is totally out of order
First thought (without reading your code) have you disabled the "Sorted" option of the list control ?
~RaGE();
|
|
|
|
|
Second thought, after reading the code :
It is a safe thing to zero the LVITEM struct (you wrote LV_ITEM, but it is in fact LVITEM) before using it.
LVITEM lvi;
ZeroMemory(&lvi,sizeof(lvi));
It is also not a bad idea to check for the result of the InsertItem and SetItem functions before going on.
Last thing to do is maybe to prevent updating the control before it is entirely full, or use virtual list if you are dealing with database entries (search on Code Project for virtual lists).
But the code seems OK to my point of view. You should really check that the Sort ComboBox in the Properties of the control is set on "None" (in the VC++ Dialog Editor). Or programatically unset the LVS_SORTASCENDING and LVS_SORTDESCENDING window styles of the control.
~RaGE();
|
|
|
|
|
Thanks for your reply first~
I have checked the sort combobox, unfortunately it is set to none.
For the result of insertitem, it is always returning 0 which seems to be fine~
and the setitem function is returning 1 for successful.
And how should i use zeromemory function, since it seems to be deleting the LVITEM and all the items are failed to be displayed in the list~
|
|
|
|
|
zhaopi wrote:
And how should i use zeromemory function, s
For initialisation of your lvi variable. Use it just once, after the variable definition:
LVITEM lvi;
ZeroMemory(&lvi,sizeof(lvi));
Now you can use lvi safely.
~RaGE();
|
|
|
|
|
How about:
for (int index = 0; index < total; index++)
{
int item = m_bList.InsertItem(index, 0, sbatchid);
m_bList.SetItemText(item, 1, page);
m_bList.SetItemText(item, 2, time.Format("%Y/%m/%d/%H:%M"));
}
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
it works,
but i really cannot see what is the difference between your method and mine~
Can explain a little bit~?
Thanks
|
|
|
|
|
I think the difference is that David uses the index returned by InsertItem to access the associated subitems, whereas you use the loop index, which is then not necessarily equal to the inserted Item index. Meaning if loop index is 3, and inserted Item gets index 2, you will then modify subitem of Item with index 3 instead of 2. Is this clear ?
~RaGE();
|
|
|
|
|
how to save/open variable2 from (expl: edit box) to text file?
|
|
|
|
|
using fopen() , fread() , fwrite() and fclose()
or fstream class
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
when i write the code:
PWSTR env = _L("hello!");
std::cout<
|
|
|
|
|
Yes, use the w* classes. In your case std::wcout.
|
|
|
|
|
|
I need implement creation DIME-envelope in C++. And, conversely, I must restore source attachments from this DIME-envelope. I don't need implement sending or receiving data, only creation/parsing DIME-envelope.
What tools can I use for this? I think that this problem is typical and must be typical solution too. Can you help me, please?
May be Microsoft SOAP Toolkit 3.0 is suitable for this? And I found gSOAP Toolkit http://prdownloads.sourceforge.net/gsoap2, but I think that it
is very complicated and cumbersome for my simple task.
Thanks very mach
|
|
|
|
|
Microsoft SOAP Toolkit 3.0 isn't suitable for such task
|
|
|
|
|
|
You can make an entry in the Software/Microsoft/Windows/CurrentVersion/Run registry or just create a shortcut to your program in the startup folder.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
pantao551 wrote:
: How to make my program run when my computer boots.
Which Version Of Windows, are you quering about?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
after I compile my programme, my programme got a lot of error and most of the error are almost the same. And I not understand the error can somebody tell me...
myExceptionTester.obj : error LNK2005: _main already defined in myClient.obj
myExceptionTester.obj : error LNK2005: "class myLog winLog" (?winLog@@3VmyLog@@A) already defined in myClient.obj
myHostInfoTester.obj : error LNK2005: _main already defined in myClient.obj
myHostInfoTester.obj : error LNK2005: "class myLog winLog" (?winLog@@3VmyLog@@A) already defined in myClient.obj
myLogTester.obj : error LNK2005: _main already defined in myClient.obj
|
|
|
|
|
The libraries you are linking (myExceptionTester, myHostInfoTester + myLogTester) probably already have a 'main' function. Check your libraries and remove the 'main' functions. You don't need these anyway, since these are libraries, which are used in other applications.
Er zit een korstje op mijn aars.
|
|
|
|
|
what is unresolved external symbol "public: __thiscall...
|
|
|
|
|
what do you think it is ?
unresolved external symbol means that the linker was looking for an external symbol (defined outside the .c/.cpp file) but could not find it...
you are missing some lib files...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|