|
MSDN says
ON_THREAD_MESSAGE must be used instead of ON_MESSAGE when you have a CWinThread clas
Is this the only 1 difference
|
|
|
|
|
Am I missing something here? OK - I can derive a class and write my own method spending a minute of my time, but what annoys me is - am I not supposed to use a CStringArray if I will require to execute a find operation on it? Is there a valid reason for this class not supporting a find method, or is it just ridiculous?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
An argument for not including such Find function is that there are different methods for finding a match. For instance as CString::Compare and CString::CompareNoCase.
I'm not so sure but an array isnt suitable for a lot of findings. If you search a lot you should use an other data type with Hashes, so the members are pre-sorted.
Greetings from Germany
|
|
|
|
|
KarstenK wrote: An argument for not including such Find function is that there are different methods for finding a match. For instance as CString::Compare and CString::CompareNoCase.
Nope, I'm talking about a simple search, the same exact thing, what CString is providing me. If I buy the case sensitivity argument, why not give me an overload?!
KarstenK wrote: I'm not so sure but an array isnt suitable for a lot of findings.
OK - that's the only valid reason I could also think of. I was just wondering if someone else will come up with a different opinion or provide me another reason.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
In case of array , only association is index and element. What purpose should Find operation serve, if provided one ? It should only return it's index. And how that index will be usefull, given that you already have string at that index ? This may be the reason, that it is not logical to provide such function.
Or, you are talking about some more functionality from find operation ? Because, as already mentioned, for string specific find there are already such functions available.
|
|
|
|
|
No, I did not get that first paragraph. When I look at this class as a container, I will expect it to provide me a find function (I pass a string to it, and then it comes back to me to tell that the string is found at location N). It should take less than one minute to derive a class and implement this find method, but I was just wondering why would it not be given to me. This makes the class look like an unfinished container. Can you please explain me the first paragraph? I simply didn't get it. May be I need a whack on my head and a cup of coffee.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Let me explain.
Functions would be provided,only when it is needed,
e.g CMap::Lookup gives you fast access to element.
In this case, suppose, there is function long CStringArray::Find(CString strToFind) , returning index of element in array. But, question is, why and how often that index will be needed ?
And you answer, that it will be useful for faster access ,etc. Then there are other datastructure, which are more efficient doing this.
The reason could be, just keep this class simple, not adding overhead to it.
|
|
|
|
|
OK - you mean to say that if I do a lot of searches, then an indexed container would be an ideal candidate. That's the same exact thing I thought. But nevertheless, it was shocking to me that MS hasn't provided a find on CStringArray.
Thanks for the reply man, I appreciate it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
INT, INT32, LONG and LONG32 all are 32-bit signed integer.
Then what is the main difference among them?
Also I have saw other many similar data types (e.g LONGLONG, LONG64.
What is the need of this difference?
Any one please describe about it.
Regards
Maxim
|
|
|
|
|
This would be compiler and platform dependent.
Regards,
Sandip.
|
|
|
|
|
I dont think so. All are used in VC++ on same compiler(VS 2005) and same platform(Windows).
Please describe the difference.
By the way, Thanks for your effort.
|
|
|
|
|
see int and long both will be 4 bytes each on windows(VC++). but still they are kept as is may be for backward compatibility.
If you really want the difference try to find sizes for these data types on all the windows versions for above then you will get an idea.
Regards,
Sandip.
|
|
|
|
|
Please tell me about all not only two. Also, I want to know about INT, INT32, LONG, LONG32 not int and long. If you can, please compare atleast these four data types.
Regards,
Maxim.
|
|
|
|
|
Have you problems with 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
|
|
|
|
|
No, not at all. But I am little bit confused.
I am just curious to know the difference among them on same windows version with same compiler.
I am talking about their uses and importance also need. I have used all in my program and not found any difference. That is why I am asking here.
Because you all are experienced and experts.
Please guide me.
Sorry, If i am wrong or rude anywhere.
Regards,
Maxim.
|
|
|
|
|
Sir, Can I know the reason of down voted?
Is my way of asking question is not right?
I am new here in this forum. I was just trying to explain me before all of you...
Thanks.
Maxim.
|
|
|
|
|
I can only guess (since I didn't down vote you): possibly your post appeared a bit rude.
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
|
|
|
|
|
i am trying to tell you only one thing is today there might not be any difference but still these will be kept as is for compatibility.
Tomo with vista and 64bit machines coming in , int , long, int64 all might have 64 bit values but still they will be maintained different for compatibility.
Regards,
Sandip.
modified on Monday, June 2, 2008 8:03 AM
|
|
|
|
|
SandipG wrote: Tomo with vista and 64bit machines coming in , int int32 int64 all might have 64 bit
if int32 have 64 bit then it is meaningless.
|
|
|
|
|
|
I will change my reply but i am not saying it i just took it as an example.
Regards,
Sandip.
|
|
|
|
|
Helpful link. Thanks.
And your answer is also very supportive.
Giving you 5 votes...
|
|
|
|
|
The difference on the windows platform isnt there, but if you use the source-code on other platforms or other compilers than from MS there 'maybe' differences.
But LONGLONG, LONG64 are resolved to 64-bit data on WIN64 so there can stroe 64-bit data!!!
Greetings from Germany
|
|
|
|
|
Hi
When clicks on View, my program draws ellipse and I tried to make all changes in one view reflects to all views.
1-)OnLbuttonDown adds a point to CArray m_PointList
2-)UpdateAllViews calls OnUpdate
3-) OnUpdate Invaliates so OnDraw called.
void CDocumentView::OnLButtonDown(UINT nFlags, CPoint point)
{
GetDocument()->m_PointList.Add(point);
GetDocument()->UpdateAllViews(NULL);
CView::OnLButtonDown(nFlags, point);
};
void CDocumentView::OnDraw(CDC* pDC)
{
CDocumentDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
for(int i = 0; i < GetDocument()->m_PointList.GetCount(); i++)
{
pDC->Ellipse(GetDocument()->m_PointList[i].x - GetDocument()->m_PointSize,
GetDocument()->m_PointList[i].y - GetDocument()->m_PointSize,
GetDocument()->m_PointList[i].x + GetDocument()->m_PointSize,
GetDocument()->m_PointList[i].y + GetDocument()->m_PointSize);
}
}
void CDocumentView::OnUpdate(CView* , LPARAM , CObject*
)
{
Invalidate();
}
But when i open a new document, it doesn't draw ellipse which is m_PointList , it shows a clean view window. And when i started to click also it doesn't change the other views.
Where am i wrong?
|
|
|
|
|
If you open a new dicument contents of m_PointList will be changed ,isn't it?
because you will be having new docuemnt class pointer.
Regards,
Sandip.
|
|
|
|