|
Check the properties of your CListCtrl if Auto arrange, Sort, etc is on. Uncheck whichever is unnecessary and see if that helps. I cannot think of any other reason which could cause this problem.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
-- modified at 0:59 Saturday 14th January, 2006
|
|
|
|
|
i have unchecked auto arrange ,made sort order none.But still the problem persist. I found this problem with ICON view and small icon view.When style change to report view or list view its ok.
nav
|
|
|
|
|
I am trying to update a program written in C++ using VS6 to VS.NET 2003. One of the errors I can´t solve is the following:
the code:
template <class t="">
class _NoAddRefReleaseOnCComPtr : public T
{
private:
STDMETHOD_(ULONG, AddRef)()=0;
STDMETHOD_(ULONG, Release)()=0;
};
the errors:
(to the first line)
C2332: 'class' : missing tag name
C2011: '__unnamed' : 'enum' type redefinition
C2059: syntax error : 'constant'
C2143: syntax error : missing ')' before '>'
(to the second line)
C2059: syntax error : '('
I tried to solve all these errors, but with no luck. Can anyone help me?
Thank you!
Patrícia Gonçalves
|
|
|
|
|
please edit your post, and uncheck the little "Ignore HTML tags in this message (good for code snippets)" at the bottom of the emoticons...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
toxcct wrote: uncheck the little
lol
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
You're right. Sorry!
Here's the message again:
I am trying to update a program written in C++ using VS6 to VS.NET 2003. One of the errors I can´t solve is the following:
the code:
template <class T>
class _NoAddRefReleaseOnCComPtr : public T
{
private:
STDMETHOD_(ULONG, AddRef)()=0;
STDMETHOD_(ULONG, Release)()=0;
};
the errors:
(to the first line)
C2332: 'class' : missing tag name
C2011: '__unnamed' : 'enum' type redefinition
C2059: syntax error : 'constant'
C2143: syntax error : missing ')' before '>'
(to the second line)
C2059: syntax error : '('
I tried to solve all these errors, but with no luck. Can anyone help me?
Thank you!
Patrícia Gonçalves
|
|
|
|
|
Can't see anything wrong here. What I normally do in these cases is dump the pre-processor output and see if any macros are messing stuff up (see what the compiler sees). To do this you add the "/P" option to the compiler setting and rebuild. When you do this the build will appear to succeed with no errors - Don't get excited, it's just the preprocessing that has succeeded. For every .CPP file there will be a matching ".i" file with all macros fully expanded. Find a .CPP file that includes the problematic definitions and open the corresponding ".i" file. Look for your problem class - Perhaps by searching for "_NoAddRefReleaseOnCComPtr". Look for anything weird.
Steve
-- modified at 4:44 Monday 16th January, 2006
NOTE: Changed the "/P" above from "/O" (/O is wrong).
|
|
|
|
|
Thank you for your answer, Steve. I just need one more thing: where do I change the compiler settings?
Patrícia
|
|
|
|
|
I use MSVC6. This is how I setup the compiler to dump the preprocessor output:
1. Select "Project->Settings..." from file menu.
2. Select "C/C++" tab.
3. Click in the "Project Options" edit control and scroll to the end.
4. Add the "/P".
Remeber to remove the "/P" when you're done.
Steve
|
|
|
|
|
Any module to encode and decode from bufferarray with a short time?
Now, i want to encode buffer array of bmp type to another type with smaller size of buffer array, but take a little time.
With Jpeg type, it take 30 - 40 ms for encoding and decoding, i am finding another module to take about 10 ms
Thanks.
--------------------------
ERP VN: www.erpvn.net
|
|
|
|
|
I'm making a data logger using a CListCtrl. my problem is when a new row of data is inserted at the bottom of the list, the scroll does not scroll-down and the list display remain at the top.
what I want to happen is to make the vertical scroll, to scroll-downwards automatically so that the latest data received can be easily seen during actual logging of data.
Hope you can help me with my problem!
-- modified at 6:28 Friday 13th January, 2006
|
|
|
|
|
When you add a new item to the CListCtrl, use the EnsureVisible() function to make sure that the new item is visible.
romuzu wrote: Hope you can help me with my problem!
Let me know if this helped.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
I think you could send it a scroll-down message like:
m_List.SendMessage(WM_VSCROLL,MAKEWPARAM(SB_BOTTOM,0),0);
this is this.
|
|
|
|
|
MSDN says when EnsureVisible is used, the item is shown at any cost, atleast partially. If needed, it is scrolled automatically too.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Is it safe to pass MFC objects inbetween threads .
I dont fell any issue but ...
is there any special case were i should not pass
an MFC object inbetween thread.
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
vikas amin wrote: is there any special case were i should not pass
Yeah CDC objects.
Instead use HDC.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
|
It depends on what you mean by "pass" MFC objects and what kind of MFC objects you are "passing".
For instance you should never access any GUI objects from a worker thread to prevent a deadlock situation. Read this[^] if you want to know more. This article is also great to know about thread handling.
In the article forum that belongs to the article there is also a discussion regarding your original question.
I know that CAsyncSocket has some issues when being accessed from different threads, but I can't remember them at the top of my head.
Creating MFC objects, such as CString objects, on the heap and "pass" them to another thread using ::PostMessage is always save provided that you forget about the object in the thread that created the object setting the pointer to NULL and you only have one receiving thread.
You could also use some container class, such as std::queue, to "pass" objects from one thread to another. But then you have to provide synchronization with mutual exclusions such as CRITICAL_SECTION to prevent two threads accessing the same object simultaniously. You simply "lock" the container when accessing objects in the container and "unlock" the container when you're done.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
-- modified at 6:11 Friday 13th January, 2006 Added hint about article forum discussion.
|
|
|
|
|
many MFC classes (not sure if its all) are very specific to the thread it was created in.
So if you pass MFC objects from one thread to another, and when you try to use it it will ASSERT.
-Prakash
|
|
|
|
|
vikas amin wrote: Is it safe to pass MFC objects inbetween threads .
Not all, MFc library isnot consider as thread safe library
"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
|
|
|
|
|
thx for the information u have provided
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
Hi,
I encountered a problem about wprintf() to display unicode chars which is >
255 in my console app. I am sure I have defined _UNICODE in my VC6 Project
Setting.
I had a search with google and found that my question was some like the
case:
http://blog.kalmbachnet.de/?postid=23 .
Is it true that there are some bugs in wprintf()?
Thanks for your help.
David
|
|
|
|
|
We can set a window "always on top" by using SetWindowPos() with HWND_TOPMOST. I wonder is there a way to make a window is not only "always on top" but also "always activated". It means that window will be always activated, but we will still be able to activate another windows. Plz help me solve this problem. Tnx alot.
|
|
|
|
|
Only one window can be the active window. We can't activate another window but still have the first active - That would mean there would be two active windows. What are you trying to achieve?
Steve
|
|
|
|
|
What do you mean by "activated"?
Usually "activated" means that the window has the input focus which means that no other window will get keyboard input for instance.
Is this really what you want? (I don't think so, but that's just me...)
Only one window at any given time can be "active" in that sense.
Perhaps you mean that the title bar of the window should still look as if the window is "active" even if another window has got the input focus.
That's another thing and should be possible, but I don't have a solution for it.
However, I don't consider it very user friendly since the user will have multiple windows that seems to have input focus.
What is it you want to accomplish?
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|