|
I'm not sure what's wrong.
I extended my test with a listview control.
Here's the code:
m_cImageListSmall.Create(16, 16, ILC_COLOR32|ILC_MASK, 1, 1);
BYTE AND[32];
for( int i=0; i<32; i++ )
{
AND[i] = 0xFF;
}
DWORD XOR[256];
for( int i=0; i<256; i++ )
{
XOR[i] = 0xFFFF0000;
}
HICON icon = ::CreateIcon(NULL,16,16,1,32,AND,(BYTE*)XOR);
m_cImageListSmall.Add(icon);
m_ListCtrl.SetImageList(&m_cImageListSmall, LVSIL_SMALL);
m_ListCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT);
m_ListCtrl.InsertColumn(0, _T("Column"), LVCFMT_LEFT, 100);
m_ListCtrl.InsertItem(10, _T("aaaaaa"), 0);
m_ListCtrl.InsertItem(10, _T("cccccc"), 0);
m_ListCtrl.InsertItem(10, _T("eeeeee"), 0);
m_ListCtrl.InsertItem(10, _T("bbbbbb"), 0);
m_ListCtrl.InsertItem(10, _T("dddddd"), 0);
All the items have a red icon as expected.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
This time it worked. I'm not sure what was the problem. Thank you .
|
|
|
|
|
Cool!
Thanks for the update!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I am facing in the retriving value from record set i dont know what is happeninf here .. can some body help me here ...
i am looping through 10 times for following code with try catch block, but for some values it just going to the catch block giving me the exception,something like DB_errorparams
FieldPtr pField = pSourceRS->Fields->Item[iField];
_variant_t Var;
Var = pField->GetValue();
can anybody help me here
vikas da
|
|
|
|
|
The debugger as first aid. Then us. But you should provide us detailed info coming from the first aid tool.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks Pallini.....
am building my clint it ll take another 30 min get up... in the mean time can you tell me what are the possible senarios when thye function
Var = pField->GetValue();
can fail ..
Thanks alot....
vikas da
|
|
|
|
|
tasumisra wrote: in the mean time can you tell me what are the possible senarios when thye function
Well, this is your task, read the documentation.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello,
I have a CRichEditCtrl on a CMdiChildWnd which works as an edit box on the window.But I am not able to change the color of the text in the edit box but the background color can be changed with the following.
CRichEditCtrl *T2;
COLORREF C(250);
CDC *c = T2->GetDC();
T2->Create(this,Rect2,false);
T2->SetBackgroundColor(false,C);
Thanks
Prithaa
|
|
|
|
|
Use
m_cfDefault.crTextColor = color;
m_T2->SetSelectionCharFormat(m_cfDefault);
where
CHARFORMAT m_cfDefault;
|
|
|
|
|
Hello,
Thanks,
When I do the above the color doesn't change but I get the strike out effect.
CHARFORMAT m_cfDefault;
m_cfDefault.crTextColor = RGB(0,125,0);
T1->SetSelectionCharFormat(m_cfDefault);
Thanks,
Prithaa
|
|
|
|
|
Hi,
Is there any win32 API available for date calculation?
All i need is, once the system date time is read (for EX: Mon, 10 Nov 2008 11:11:20) from this we need to add 72 hours, and the time after 72 hours should be Thu, 13-Nov-2008 12:11:20.
I am able to get the current time from system. But i like to know how to calculate date and time after 72 hours. Is there any API available for this?
Mon, 10 Nov 2008 11:11:20 - This I am able to get from system.
Thu, 13-Nov-2008 12:11:20 - I need to calculate for this date and time (that I should after 72 hours)
Can anyone help me in this regards.
-Nanadu
|
|
|
|
|
The solution is as follows.
<code>
int main()
{
time_t now = time(0);
int number_minutes=72*60;
tm* localtm = localtime(&now);
cout << "The local date and time is: " << asctime(localtm) << endl;
now += (60 * number_minutes);
struct tm* localtm_edited = localtime(&now);
tm* localtm_edited = localtime(&now);
cout <<"The local date and time i is: " << asctime(localtm_edited);
}
return 0;
}</code>
<div class="ForumSig">Somethings seem HARD to do, until we know how to do them.
;-)_AnShUmAn_
</div>
|
|
|
|
|
the "localtm_edited" redefinition..
|
|
|
|
|
is there some error you get? Please check you have not define localtm_edited variable twice in your code.
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks, its working fine.
Similarly is there any way to give the time as input and get the out put calculated for next 72 hours.
For Example in-put will in the format "Thu, 13 Nov 2008 12:11:20 GMT" and i need the out-put as "Mon, 10 Nov 2008 11:11:20 GMT", this is calculated for next 72.
Is it possible to give in-time and get calculated for next 72 hours?
-Nandu
|
|
|
|
|
Just out of curiosity, why do you repeat same question 3 times
-Saurabh
|
|
|
|
|
Can someone help me?
i am making a app. and i want to heave my custom skin on it.
|
|
|
|
|
|
|
Hi friends, I have a query regarding display of image from remote machine.
In the current scenario we are displaying images from remote machine by copying the files from remote machine to local machine and displaying them using "MoveFile" method. But I can see in the preview b/w image to image there is a time delay of 10 sec
To be more specific:
I have 10 file paths of remote machine and I need to display preview of the images so we are copying files from remote machine to local machine using "MoveFile" after the preview of first image there is a time delay of 10sec to preview second image as it's being copied from remote machine. Is there any better method to reduce the time delay? or is it better to access the images directly from remote path and display instead of copying it to local machine?
Please do let me know your suggestions
|
|
|
|
|
Please do reply your suggestions
|
|
|
|
|
Super Hornet wrote: displaying them using "MoveFile" method
Huh? MoveFile displays images?
Super Hornet wrote: is it better to access the images directly from remote path and display instead of copying it to local machine?
Why don't you try it?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I want to add String, long value pair in a map. I've done it as follows.
<br />
string user_key[5] = {"cocacola", "pepsi", "cocacola", "mango", "pepsi"};<br />
unsigned long comm_val[5] = {25, 45, 24, 67, 98};<br />
<br />
map<const string, unsigned long> comm_map;
map<const string, unsigned long>::const_iterator iter;<br />
<br />
for(int i = 0; i < 5; i++)<br />
{<br />
iter = comm_map.find(user_key[i]);<br />
<br />
if(iter == comm_map.end())<br />
{<br />
comm_map.insert(pair<const unsigned="" long="">(user_key[i], comm_val[i]));<br />
}<br />
else<br />
{<br />
comm_map[user_key[i]] = comm_val[i];<br />
} <br />
}<br />
</const>
Actually in my application, this map updated around every 30 milliseconds. I mean every 30 milliseconds data is send to the map. It's fine so far.
But what I need to do is, regularly I want to send map content to a XML file. My question is, at the XML write time I want to stop updating the map. Otherwise data can be loss or some other effect. How can I avoid this? Using a flag?
Any comments,
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
|
Actually I want to avoid threads and achieve for a best.
I appreciate your help all the time...
CodingLover
|
|
|
|