|
hi..
i have a hiden column in my list . to avoid it from shown to the user
to prevent it from showing the headers onitemchanging is overridden
the code is as follows
CMyView::OnItemchanging(NMHDR* pNMHDR, LRESULT* pResult)
{
HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR;
// TODO: Add your control notification handler code here
if((phdn->hdr.code ==HDN_ITEMCHANGING)&&phdn->iItem ==0)
{
*pResult = TRUE;
return ;
}
*pResult = 0;
}
but calling RedrawWindow() in onitemchanged of list view solved the problem.
but i dont know if this will have some perfomance problems .
if there any way in which i can solve the problem.
thanks...
sourabh
|
|
|
|
|
hi..
yes to stop the user from resizing the first column i overrided the header item change message like
void CMyView::OnItemchanging(NMHDR* pNMHDR, LRESULT* pResult)
{
HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR;
if((phdn->hdr.code ==HDN_ITEMCHANGING)&&phdn->iItem ==0)
{
*pResult = TRUE;
return ;
}
*pResult = 0;
}
probably this was the cause.
any how calling RedrawWindow() in item changing solved the problem.
code is like
void CDirView::OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
if(m_nNoItemChange && LVIS_SELECTED == m_List.GetItemState(pNMListView->iItem,LVIS_SELECTED))
{
//my neaded code here
}
*pResult = 0;
RedrawWindow();
}
but i dont know if this is a proper methord. and i would like to know if i can set the size of each column in onitemchanging of header.
thanks...
|
|
|
|
|
Dear friends,
I'm using istream_iterator in vc++ after entering the text in the console i dont know how to exit out and get the output. i tried all the ways like cntrl+d etc.. If i'm using cntrl+c it is completely exiting out,with out displaying the output how so solve this problem. The program is
please help in this aspect.
# pragma warning(disable:4786)
# include <iostream>
# include <string>
# include <iterator>
# include <vector>
# include <algorithm>
using namespace std;
bool length_less(string s1,string s2)
{
return s1.size()<s2.size();
}
int main()
{
="" istream_iterator<string=""> input(cin),eos;
vector<string> text;
copy(input,eos,back_inserter(text));
string* max=max_element(text.begin(),text.end(),length_less);
cout<
|
|
|
|
|
Please suggest me the code to convert bmp to jpeg file conversion.
aasstt
|
|
|
|
|
|
|
Hi everyone!
I want to customize MFC's CTreeCtrl. I need to place a command button for the parent items(side to the text) and a progress bar(side to the text) for the child items.
Is this possible by extending CTreeCtrl?
If possible please give an idea. otherwise please give the alternative ways to do this.
Thanks,
Sivaji Reddy
|
|
|
|
|
You can do this by creating the buttons and progress windows as child windows of the tree control and placing them properly next to the items.
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
|
|
|
|
|
Hi every1, am just a beginer in app. development using VC++ v6...
want to develop a very simple application that would connect a pc to mobile phones so they could communicate...
what steps do i need to go through using a VC++ v6.0???
any hints appreciated!
tmcc
|
|
|
|
|
Hi.
Your project doesn't seem to me as a "very simple application".
I would suggest you to:
1.
Decide in what way the app will commmunicate with the phone (IR or/and USB).
2.
Do your homework about communication. Study and learn.
3.
Decide what software parts you will need.
4.
Design the parts from step3.
5.
Start coding your app. And when you get specific problems, send them here.
Good luck.
|
|
|
|
|
this doesn't mean anything... there are so many ways to communicate with a periph (here, a mobile phone).
do you expect to use BlueTooth, IrDA, RS232, cable connection, user defined protocol ?
first point that out, and learn for it. after that only, think about how you're going to implement that.
if you want a "very simple application", console mode should be the right project to choose. this way, you'll be able to establish a connection between the PC and the phone.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
oh my god !! i thought "simplest Application"s'd start with CDialog and CButton
V
|
|
|
|
|
Indeed this is one of the most non-simple beginner projects I'm seen requested. Any reason why you aren't starting with something a little less involved? I'm not even sure where I would start with such a project.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I have design a Dialog but not a Dos to type my message in edit box and a click button to send the message. I dont' know how to design the receive dialog. My design are same with the server and client that can send and receive message. But most of the example I can found are in Dos application, can someone give me some example that it is in dialog application.
|
|
|
|
|
The core code will be the same, the samples are console apps to keep them simple.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How to design for the receive dialog when I send a message to it? My send dialog can send a message but the receive side is a Dos application, how do I design a dialog that I can receive and see the message I send?
|
|
|
|
|
1983ttj wrote:
but the receive side is a Dos application, how do I design a dialog that I can receive and see the message I send?
I repeat - the code in your DOS app will work in an MFC app.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
((int)((int)(r+100000.5f)-100000))
((int)((int)(r+0.5f))
Is the former one better? Why?
|
|
|
|
|
Rnd, Floor or Ceil from math.h is the way to go.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There is no rnd in math.h.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
(int) (r+0.5f) is the way to go if you are rounding to the nearest integer with ?.5 always rounding up.
The second version avoids overflow problems. My question would be why would someone think adding 100000 would improve the rounding function. When dealing with floating point numbers, you really have to be careful when adding and subtracting values.
(NOTE: this only works for positive numbers, negative numbers must use -0.5f and not 0.5f)
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
-- modified at 10:26 Friday 9th September, 2005
|
|
|
|
|
Oh dear god, I just realized what they are doing.
(int) (f) does a truncation of the floating point number. In otherwords, it rounds to zero.
2.5 -> 2
0.3 -> 0
-4.5 -> -4
The "(int) (r+0.5f)" trick only works for positive values.
2.3 -> 2
2.7 -> 3
-0.2 -> 0
-0.7 -> 0 (WRONG - should be -1)
By doing 100000.5f, they AVOID (not remove) the negative problem.
Example, but we use 10.5f instead of 100000.5f
-0.2 + 10.5f = 10.3f -> 10 -> 0
-0.7 + 10.5f = 9.8f -> 9 -> -1
But dear god, WHAT A HACK.
The proper way of doing it is:
int i = (int) (r + (r > 0.0f ? 0.5f : -0.5f));
This is why Christian wants people to use math.h because it is easy to create things that sort of work, but often they don't always work.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
please, somebody could publish a simple example on SNMP in C++?
Thanks!
Sorry for my english
|
|
|
|
|
Search CP articles for SNMP. There are several examples.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
sebastianos wrote:
somebody could publish a simple example on SNMP in C++?
here is list :-
SNMP ARTICLE[^]
"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
|
|
|
|