Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

wtl · WTL support list

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 413 - 442 of 16626   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#413 From: Nenad Stefanovic <nenads@...>
Date: Wed Nov 1, 2000 10:08 am
Subject: RE: Bug: vertical toolbar/rebar ==> no redraw of window con tent!
nenads@...
Send Email Send Email
 
Hi Carlos,

Layout code in CFrameWindowImpl was designed for a simple case of a
horizontal toolbar/rebar and a status bar. If you want to have a vertical
toolbar, you'll have to override UpdateLayout and add code to calculate
layout for a vertical toolbar.

Thanks,
Nenad




-----Original Message-----
From: carlos.ferraro-cavallini@...
[mailto:carlos.ferraro-cavallini@...]
Sent: Tuesday, October 31, 2000 5:51 AM
To: wtl@egroups.com
Subject: [wtl] Bug: vertical toolbar/rebar ==> no redraw of window
content!


Hi!

(First of all: I'm running WTL w/ the most up-to-day patches. Then,
for all the questions here, I just created a clean new project with
the wizard, one with only toolbar support and another with
toolbar+rebar, no command bar, just to make sure that the problems
weren't caused by my own code..)

I don't know if this has being discussed here before. I simply needed
to have a vertical toobal attached to the left, so I tried first to
simply use a toolbar, no rebar, no command bar, with the vertical
style (CCS_VERT | TBSTYLE_WRAPABLE). There were some bugs then:
#1. The bar isn't properly drawn (not really vertical!)
#2. The contents of the window weren't updated
#3. If I remove the TBSTYLE_WRAPABLE then the dimensions are correct
but #2 remains and no buttons are drawn.

All this in win2k, IE5. On NT4 IE5.5 the symptoms are sligtly
different: the bar isn't redrawn - it gets kinda transparent, so to
say ;)


If I use toolbar+rebar, NO command bar, like below - from my OnCreate:

HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd
, IDR_MAINFRAME
, FALSE
, ATL_SIMPLE_TOOLBAR_PANE_STYLE | CCS_VERT | TBSTYLE_WRAPABLE
);

CreateSimpleReBar( ATL_SIMPLE_REBAR_STYLE | CCS_VERT);
AddSimpleReBarBand(hWndToolBar);

Then we get only bug #2 left!

Whay I find really weird is that we don't even get into
OnEraseBackground!

Plz, if anyone knows the solution to this I need it badly!

Thanks in advance,
                   /Carlos





To unsubscribe from this group, send an email to:
wtl-unsubscribe@egroups.com

#414 From: carlos.ferraro-cavallini@...
Date: Wed Nov 1, 2000 4:55 pm
Subject: Bugfix [Was: Re: Bug: vertical toolbar/rebar ]
carlos.ferraro-cavallini@...
Send Email Send Email
 
--- In wtl@egroups.com, Nenad Stefanovic <nenads@m...> wrote:
> Hi Carlos,
>
> Layout code in CFrameWindowImpl was designed for a simple case of a
> horizontal toolbar/rebar and a status bar. If you want to have a
vertical
> toolbar, you'll have to override UpdateLayout and add code to
calculate
> layout for a vertical toolbar.
>
> Thanks,
> Nenad

First of all, thanks for your quick answer!

I found out that if we only change a little bit in
CFrameWindowImplBase::UpdateBarsPosition, then everything is fine! :)
Here's my working code, feel free to do what you want with it.

void UpdateBarsPosition(RECT& rect, BOOL bResizeBars = TRUE)
{
    // resize toolbar
    DWORD dwStyles = (DWORD)::GetWindowLong(m_hWndToolBar, GWL_STYLE) ;
    if(m_hWndToolBar != NULL && (dwStyles & WS_VISIBLE))
    {
        if(bResizeBars)
            ::SendMessage(m_hWndToolBar, WM_SIZE, 0, 0);
        RECT rectTB;
        ::GetWindowRect(m_hWndToolBar, &rectTB);
        // Check the orientation!
        if( dwStyles & CCS_VERT )
        {
            rect.left += rectTB.right - rectTB.left;
        }
        else
        {
            rect.top += rectTB.bottom - rectTB.top;
        }
    }

    // resize status bar
    if(m_hWndStatusBar != NULL && ((DWORD)::GetWindowLong
(m_hWndStatusBar, GWL_STYLE) & WS_VISIBLE))
    {
        if(bResizeBars)
            ::SendMessage(m_hWndStatusBar, WM_SIZE, 0, 0);
        RECT rectSB;
        ::GetWindowRect(m_hWndStatusBar, &rectSB);
        rect.bottom -= rectSB.bottom - rectSB.top;
        if( dwStyles & CCS_VERT )
        {
            ::SetWindowPos(m_hWndStatusBar , HWND_TOP, 0, 0, 0, 0,
SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE );
        }
     }
}

Remember that I'm only using a toolbar + rebar, NO command bar!

#415 From: Lipp Christian <Christian.Lipp@...>
Date: Thu Nov 2, 2000 10:12 am
Subject: RE: RE: Menu loading
Christian.Lipp@...
Send Email Send Email
 
Hi Nenad!

Sorry for this late reply, but I have been out of office
for one week.

> I've never heard of an issue like that. The only thing
> different than usual
> in your description is that you have MENUEX resource, instead
> of the usual
> MENU one. I don't know why would that make a difference, but
> maybe you can
> check if flags for MENUITEMs are OK.

MENUEX is generated by WTL-wizard, I tried to change it back
to MENU, but this leads to ressource compiler errors since the
extension is used.

> If you comment command bar lines, does the menu appear in the app?

No, the menu doesn't appear.
I also checked the CREATESTRUCT in the OnCreate-Event,
the handle of the menu is NULL there.

>  HINSTANCE hInst = _Module.GetResourceInstance();
>  CFrameWndClassInfo& oClassInfo = GetWndClassInfo();
>
>  LPCTSTR lpMenuName =
> 	 MAKEINTRESOURCE(oClassInfo.m_uCommonResourceID);
>  HMENU hMenu = ::LoadMenu(hInst, lpMenuName);
>  if (!hMenu) {
> 	 DWORD dwError = ::GetLastError();
> 	 // dwError = 13 The data is invalid.  ERROR_INVALID_DATA
>  }

I executed this code before the window is created to get the error
before ATL gets it (and changes maybe the errorcode).

I hoped someone else did encounter the same problem, but it seams
I am the only one. Strange, that I have it on two machines.
Btw, both are running on NT4SP6a.

Christian

> -----Original Message-----
> From: Lipp Christian
> Subject: [wtl] Menu loading
>
>
> Hello all!
>
> I have a question about a bug I sometimes encounter
> and wanted to know if someone has similar problems.
>
> I have a wtl-wizard-generated form with a menu on it,
> the menu has the same ID as the form, IDR_MAINFRAME.
>
> In the OnCreate-event of the form, there is the
> wizard-generated code:
>
>  HWND hWndCmdBar = m_CmdBar.Create(m_hWnd,
> 	 rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
>  m_CmdBar.AttachMenu(GetMenu());
>
> The second line did always fail on my colleagues workstation,
> but worked fine on my computer - till today.
>
> So I took a closer look and saw that GetMenu returned NULL.
> hMenu is loaded in ATL/WTL with following code
> (I inserted the temporary variables for better investigating):
>
>  HINSTANCE hInst = _Module.GetResourceInstance();
>  CFrameWndClassInfo& oClassInfo = GetWndClassInfo();
>
>  LPCTSTR lpMenuName =
> 	 MAKEINTRESOURCE(oClassInfo.m_uCommonResourceID);
>  HMENU hMenu = ::LoadMenu(hInst, lpMenuName);
>  if (!hMenu) {
> 	 DWORD dwError = ::GetLastError();
>  }
>
> LoadMenu fails, the error code is 13, which means
>  13 The data is invalid.  ERROR_INVALID_DATA
>
> Both input variables look ok.
>
> Why is there an error? Why does it works sometimes and
> sometimes not (it worked yesterday)?
>
> The menu is in the exe-file (I checked with an ressource-editor):
> 128 MENUEX
> LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
> {....
>
> Thanks in advance,
> Christian

#416 From: Nenad Stefanovic <nenads@...>
Date: Thu Nov 2, 2000 10:56 am
Subject: RE: RE: RE: Menu loading
nenads@...
Send Email Send Email
 
Hi Christian,

> MENUEX is generated by WTL-wizard

Well, that is not likely, WTL App Wizard does not use MENUEX at all, only
MENU resources.

I have to conclude that your MENUEX resource is not valid. There is probably
some value somewhere that is causing the problem. You can try replacing it
with another, simpler, menu, and than adding lines to track down which one
causes LoadMenu to fail.

Thanks,
Nenad



-----Original Message-----
From: Lipp Christian [mailto:Christian.Lipp@...]
Sent: Thursday, November 02, 2000 2:12 AM
To: 'wtl@egroups.com'
Subject: [wtl] RE: RE: Menu loading


Hi Nenad!

Sorry for this late reply, but I have been out of office
for one week.

> I've never heard of an issue like that. The only thing
> different than usual
> in your description is that you have MENUEX resource, instead
> of the usual
> MENU one. I don't know why would that make a difference, but
> maybe you can
> check if flags for MENUITEMs are OK.

MENUEX is generated by WTL-wizard, I tried to change it back
to MENU, but this leads to ressource compiler errors since the
extension is used.

> If you comment command bar lines, does the menu appear in the app?

No, the menu doesn't appear.
I also checked the CREATESTRUCT in the OnCreate-Event,
the handle of the menu is NULL there.

>  HINSTANCE hInst = _Module.GetResourceInstance();
>  CFrameWndClassInfo& oClassInfo = GetWndClassInfo();
>
>  LPCTSTR lpMenuName =
> 	 MAKEINTRESOURCE(oClassInfo.m_uCommonResourceID);
>  HMENU hMenu = ::LoadMenu(hInst, lpMenuName);
>  if (!hMenu) {
> 	 DWORD dwError = ::GetLastError();
> 	 // dwError = 13 The data is invalid.  ERROR_INVALID_DATA
>  }

I executed this code before the window is created to get the error
before ATL gets it (and changes maybe the errorcode).

I hoped someone else did encounter the same problem, but it seams
I am the only one. Strange, that I have it on two machines.
Btw, both are running on NT4SP6a.

Christian

> -----Original Message-----
> From: Lipp Christian
> Subject: [wtl] Menu loading
>
>
> Hello all!
>
> I have a question about a bug I sometimes encounter
> and wanted to know if someone has similar problems.
>
> I have a wtl-wizard-generated form with a menu on it,
> the menu has the same ID as the form, IDR_MAINFRAME.
>
> In the OnCreate-event of the form, there is the
> wizard-generated code:
>
>  HWND hWndCmdBar = m_CmdBar.Create(m_hWnd,
> 	 rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE);
>  m_CmdBar.AttachMenu(GetMenu());
>
> The second line did always fail on my colleagues workstation,
> but worked fine on my computer - till today.
>
> So I took a closer look and saw that GetMenu returned NULL.
> hMenu is loaded in ATL/WTL with following code
> (I inserted the temporary variables for better investigating):
>
>  HINSTANCE hInst = _Module.GetResourceInstance();
>  CFrameWndClassInfo& oClassInfo = GetWndClassInfo();
>
>  LPCTSTR lpMenuName =
> 	 MAKEINTRESOURCE(oClassInfo.m_uCommonResourceID);
>  HMENU hMenu = ::LoadMenu(hInst, lpMenuName);
>  if (!hMenu) {
> 	 DWORD dwError = ::GetLastError();
>  }
>
> LoadMenu fails, the error code is 13, which means
>  13 The data is invalid.  ERROR_INVALID_DATA
>
> Both input variables look ok.
>
> Why is there an error? Why does it works sometimes and
> sometimes not (it worked yesterday)?
>
> The menu is in the exe-file (I checked with an ressource-editor):
> 128 MENUEX
> LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
> {....
>
> Thanks in advance,
> Christian


To unsubscribe from this group, send an email to:
wtl-unsubscribe@egroups.com

#417 From: Lipp Christian <Christian.Lipp@...>
Date: Thu Nov 2, 2000 12:43 pm
Subject: RE: RE: RE: RE: RE: Menu loading
Christian.Lipp@...
Send Email Send Email
 
Hi Nenad,

You are right (as always), MENU is created,
I changed MENUEX back to MENU and corrected div. entries
and everything is fine again.

I never changed the ressource, it seems that VC changes the
typ when I use an extended attribute.

Though it was strange, that it occurred only on certain computers
and on NT and not Win95. But I will not investigate any further.

Thanks for your help,
Christian

> Hi Christian,
>
> > MENUEX is generated by WTL-wizard
>
> Well, that is not likely, WTL App Wizard does not use MENUEX at all, only
> MENU resources.
>
> I have to conclude that your MENUEX resource is not valid. There is
probably
> some value somewhere that is causing the problem. You can try replacing it
> with another, simpler, menu, and than adding lines to track down which one
> causes LoadMenu to fail.
>
> Thanks,
> Nenad
>
>
> -----Ursprüngliche Nachricht-----
> Von: Lipp Christian
> Betreff: RE: RE: Menu loading
>
> Hi Nenad!
>
> Sorry for this late reply, but I have been out of office
> for one week.
>
> > I've never heard of an issue like that. The only thing
> > different than usual
> > in your description is that you have MENUEX resource, instead
> > of the usual
> > MENU one. I don't know why would that make a difference, but
> > maybe you can
> > check if flags for MENUITEMs are OK.
>
> MENUEX is generated by WTL-wizard, I tried to change it back
> to MENU, but this leads to ressource compiler errors since the
> extension is used.
>
> > If you comment command bar lines, does the menu appear in the app?
>
> No, the menu doesn't appear.
> I also checked the CREATESTRUCT in the OnCreate-Event,
> the handle of the menu is NULL there.
>
> >  HINSTANCE hInst = _Module.GetResourceInstance();
> >  CFrameWndClassInfo& oClassInfo = GetWndClassInfo();
> >
> >  LPCTSTR lpMenuName =
> > 	 MAKEINTRESOURCE(oClassInfo.m_uCommonResourceID);
> >  HMENU hMenu = ::LoadMenu(hInst, lpMenuName);
> >  if (!hMenu) {
> > 	 DWORD dwError = ::GetLastError();
> > 	 // dwError = 13 The data is invalid.  ERROR_INVALID_DATA
> >  }
>
> I executed this code before the window is created to get the error
> before ATL gets it (and changes maybe the errorcode).
>
> I hoped someone else did encounter the same problem, but it seams
> I am the only one. Strange, that I have it on two machines.
> Btw, both are running on NT4SP6a.
>
> Christian

#418 From: Lipp Christian <Christian.Lipp@...>
Date: Fri Nov 3, 2000 7:50 am
Subject: Question to Nenad (was Re: Toggling the Splitter Views)
Christian.Lipp@...
Send Email Send Email
 
> For toggling the view panes, showing or hiding one of the pane(s),
> I have a toolbar for this purpose. Here I am dynamically showing or
> hiding one of splitter views.
> After hiding I am calling the UpdateSplitterLayout( ). But the view
> does not happen to update properly. I also want the LeftSplitter
> entirely to be hidden so I have only the Right Pane visible.

I had the same problem. Nenad gave me the following hint:

> Middle view should be a splitter window. Let's say that the
> splitter is assigned to a variable called m_hWndMiddleView.
> You can easily hide one pane by replacing the splitter window
> with that pane, just assign the pane window handle to
> m_hWndMiddleView and call UpdateLayout. And, of course,
> hide the splitter and the other pane (ShowWindow(SW_HIDE)).

I tried this in the mainframe, but it didn't work, because the
splitter window is the parent window of the splitter panes, so
if you hide the splitter window, the panes can't be visible.

Therefore I tried to use a derived class. The splitter window
is now always visible, I still hide the other splitter pane
and the splitter bar (actually not hide, but prevent from
being drawn).

Here is the code:

#ifndef SPLITTEREX_H
#define SPLITTEREX_H

template <bool t_bVertical = true>
class CSplitterWindowExT : public
CSplitterWindowImpl<CSplitterWindowExT<t_bVertical>, t_bVertical>
{
public:
	 DECLARE_WND_CLASS_EX(_T("WTL_SplitterWindowEx"), CS_DBLCLKS,
COLOR_WINDOW)

	 typedef CSplitterWindowExT <t_bVertical>
thisClass;
	 typedef CSplitterWindowImpl<CSplitterWindowExT<t_bVertical>,
t_bVertical> baseClass;

	 BEGIN_MSG_MAP(thisClass)
		 MESSAGE_HANDLER(WM_PAINT, OnPaint)
		 MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)
		 CHAIN_MSG_MAP(baseClass)
	 END_MSG_MAP()

	 enum eSplitterState {STANDARD, LEFTMAXIMIZED, RIGHTMAXIMIZED};

	 CSplitterWindowExT() : m_eSplitterState(STANDARD)
	 {}

	 void UpdateSplitterLayout()
	 {
		 static eSplitterState eOldState = STANDARD;

		 switch (m_eSplitterState) {
			 case STANDARD:
				 if (eOldState == LEFTMAXIMIZED) {

::ShowWindow(m_hWndPane[SPLIT_PANE_RIGHT], SW_SHOW);
				 }
				 else if (eOldState == RIGHTMAXIMIZED) {

::ShowWindow(m_hWndPane[SPLIT_PANE_LEFT], SW_SHOW);
				 }

				 baseClass::UpdateSplitterLayout();
				 break;

			 case LEFTMAXIMIZED:
				 ::ShowWindow(m_hWndPane[SPLIT_PANE_RIGHT],
SW_HIDE);
				 ::SetWindowPos(m_hWndPane[SPLIT_PANE_LEFT],
NULL, m_rcSplitter.left, m_rcSplitter.top,
					 m_rcSplitter.right -
m_rcSplitter.left, m_rcSplitter.bottom - m_rcSplitter.top, SWP_NOZORDER);
				 eOldState = LEFTMAXIMIZED;
				 break;

			 case RIGHTMAXIMIZED:
				 ::ShowWindow(m_hWndPane[SPLIT_PANE_LEFT],
SW_HIDE);
				 ::SetWindowPos(m_hWndPane[SPLIT_PANE_RIGHT],
NULL, m_rcSplitter.left, m_rcSplitter.top,
					 m_rcSplitter.right -
m_rcSplitter.left, m_rcSplitter.bottom - m_rcSplitter.top, SWP_NOZORDER);
				 eOldState = RIGHTMAXIMIZED;
				 break;
		 }
	 }

	 void SetSplitterState(eSplitterState eState)
	 {
		 m_eSplitterState = eState;
	 }

	 LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/,
BOOL& bHandled)
	 {
		 if (m_eSplitterState == STANDARD)
			 bHandled = false;
		 return 0;
	 }
protected:
	 eSplitterState m_eSplitterState;
};

typedef CSplitterWindowExT<true> CSplitterWindowEx;
typedef CSplitterWindowExT<false> CHorSplitterWindowEx;

#endif

Now you can use:
	 m_viewSplitter.SetSplitterState(bPaneVisible ?
		 CHorSplitterWindowEx::STANDARD :
CHorSplitterWindowEx::RIGHTMAXIMIZED);
	 m_viewSplitter.UpdateSplitterLayout();
or:
	 m_viewSplitter.SetSplitterState(bPaneVisible ?
		 CHorSplitterWindowEx::STANDARD :
CHorSplitterWindowEx::LEFTMAXIMIZED);
	 m_viewSplitter.UpdateSplitterLayout();

But I still have a (big) problem: I have to override
UpdateSplitterLayout (for positioning the splitter panes) and
DrawSplitter or DrawSplitterBar (for preventing the splitter bar to be
drawn).

But only DrawSplitterBar is overrideable (ATL way of "pseudo" virtual
functions).
So I had to change the sources (AtlSplit.h) and changed the declaration of
UpdateSplitterLayout to:
	 virtual void UpdateSplitterLayout()

This because I was to lazy to change every call of UpdateSplitterLayout to
the ATL way of calling virtual functions.

But with this change I lost the possibility of overriding DrawSplitterBar
(which is supported normally). Once you have a virtual function table,
the ATL way of overriding doesn't work anymore.

Since DrawSplitterBar is called from DrawSplitter, and this is called only
once from OnPaint, I intercepted this event to handle this problem.

Conclusio:
I want to toggle a splitter pane. The attached code works, but only if you
change the sources of WTL. Since I couldn't find another way to get the
same functionality, so I had to do so.

Now my question, Nenad: is there another approach, and if not:
is it possible to provide this functionality within WTL or to
provide the possibility to override UpdateSplitterLayout?

Thanks in advance,
Christian

#419 From: Nenad Stefanovic <nenads@...>
Date: Fri Nov 3, 2000 9:24 am
Subject: RE: RE: RE: RE: RE: RE: Menu loading
nenads@...
Send Email Send Email
 
Hi Christian,

It is quite possible that VC changes MENU to MENUEX if you use properties
that are supported only in MENUEX.

Since commenting out command bar calls results in a missing menu, something
is wrong with the MENUEX resource. It might be something related to version
of Windows (or IE) that you have on your system.

Thanks,
Nenad



-----Original Message-----
From: Lipp Christian [mailto:Christian.Lipp@...]
Sent: Thursday, November 02, 2000 4:44 AM
To: 'wtl@egroups.com'
Subject: [wtl] RE: RE: RE: RE: RE: Menu loading


Hi Nenad,

You are right (as always), MENU is created,
I changed MENUEX back to MENU and corrected div. entries
and everything is fine again.

I never changed the ressource, it seems that VC changes the
typ when I use an extended attribute.

Though it was strange, that it occurred only on certain computers
and on NT and not Win95. But I will not investigate any further.

Thanks for your help,
Christian

> Hi Christian,
>
> > MENUEX is generated by WTL-wizard
>
> Well, that is not likely, WTL App Wizard does not use MENUEX at all, only
> MENU resources.
>
> I have to conclude that your MENUEX resource is not valid. There is
probably
> some value somewhere that is causing the problem. You can try replacing it
> with another, simpler, menu, and than adding lines to track down which one
> causes LoadMenu to fail.
>
> Thanks,
> Nenad
>
>
> -----Ursprungliche Nachricht-----
> Von: Lipp Christian
> Betreff: RE: RE: Menu loading
>
> Hi Nenad!
>
> Sorry for this late reply, but I have been out of office
> for one week.
>
> > I've never heard of an issue like that. The only thing
> > different than usual
> > in your description is that you have MENUEX resource, instead
> > of the usual
> > MENU one. I don't know why would that make a difference, but
> > maybe you can
> > check if flags for MENUITEMs are OK.
>
> MENUEX is generated by WTL-wizard, I tried to change it back
> to MENU, but this leads to ressource compiler errors since the
> extension is used.
>
> > If you comment command bar lines, does the menu appear in the app?
>
> No, the menu doesn't appear.
> I also checked the CREATESTRUCT in the OnCreate-Event,
> the handle of the menu is NULL there.
>
> >  HINSTANCE hInst = _Module.GetResourceInstance();
> >  CFrameWndClassInfo& oClassInfo = GetWndClassInfo();
> >
> >  LPCTSTR lpMenuName =
> > 	 MAKEINTRESOURCE(oClassInfo.m_uCommonResourceID);
> >  HMENU hMenu = ::LoadMenu(hInst, lpMenuName);
> >  if (!hMenu) {
> > 	 DWORD dwError = ::GetLastError();
> > 	 // dwError = 13 The data is invalid.  ERROR_INVALID_DATA
> >  }
>
> I executed this code before the window is created to get the error
> before ATL gets it (and changes maybe the errorcode).
>
> I hoped someone else did encounter the same problem, but it seams
> I am the only one. Strange, that I have it on two machines.
> Btw, both are running on NT4SP6a.
>
> Christian


To unsubscribe from this group, send an email to:
wtl-unsubscribe@egroups.com

#420 From: Nenad Stefanovic <nenads@...>
Date: Fri Nov 3, 2000 9:27 am
Subject: RE: Question to Nenad (was Re: Toggling the Splitter Views)
nenads@...
Send Email Send Email
 
Hi Christian,

My suggestion was for multiple splitters, so I was talking about hiding a
splitter that is inside of a pane of another splitter window.

Unfortunately, there no easy way to override UpdateSplitterLayout without
modifying the sources. Now for the good news: showing only one splitter pane
will be directly supported in the new version of WTL.

Cheers,
Nenad




-----Original Message-----
From: Lipp Christian [mailto:Christian.Lipp@...]
Sent: Thursday, November 02, 2000 11:50 PM
To: 'wtl@egroups.com'
Subject: [wtl] Question to Nenad (was Re: Toggling the Splitter Views)


> For toggling the view panes, showing or hiding one of the pane(s),
> I have a toolbar for this purpose. Here I am dynamically showing or
> hiding one of splitter views.
> After hiding I am calling the UpdateSplitterLayout( ). But the view
> does not happen to update properly. I also want the LeftSplitter
> entirely to be hidden so I have only the Right Pane visible.

I had the same problem. Nenad gave me the following hint:

> Middle view should be a splitter window. Let's say that the
> splitter is assigned to a variable called m_hWndMiddleView.
> You can easily hide one pane by replacing the splitter window
> with that pane, just assign the pane window handle to
> m_hWndMiddleView and call UpdateLayout. And, of course,
> hide the splitter and the other pane (ShowWindow(SW_HIDE)).

I tried this in the mainframe, but it didn't work, because the
splitter window is the parent window of the splitter panes, so
if you hide the splitter window, the panes can't be visible.

Therefore I tried to use a derived class. The splitter window
is now always visible, I still hide the other splitter pane
and the splitter bar (actually not hide, but prevent from
being drawn).

Here is the code:

#ifndef SPLITTEREX_H
#define SPLITTEREX_H

template <bool t_bVertical = true>
class CSplitterWindowExT : public
CSplitterWindowImpl<CSplitterWindowExT<t_bVertical>, t_bVertical>
{
public:
	 DECLARE_WND_CLASS_EX(_T("WTL_SplitterWindowEx"), CS_DBLCLKS,
COLOR_WINDOW)

	 typedef CSplitterWindowExT <t_bVertical>
thisClass;
	 typedef CSplitterWindowImpl<CSplitterWindowExT<t_bVertical>,
t_bVertical> baseClass;

	 BEGIN_MSG_MAP(thisClass)
		 MESSAGE_HANDLER(WM_PAINT, OnPaint)
		 MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)
		 CHAIN_MSG_MAP(baseClass)
	 END_MSG_MAP()

	 enum eSplitterState {STANDARD, LEFTMAXIMIZED, RIGHTMAXIMIZED};

	 CSplitterWindowExT() : m_eSplitterState(STANDARD)
	 {}

	 void UpdateSplitterLayout()
	 {
		 static eSplitterState eOldState = STANDARD;

		 switch (m_eSplitterState) {
			 case STANDARD:
				 if (eOldState == LEFTMAXIMIZED) {

::ShowWindow(m_hWndPane[SPLIT_PANE_RIGHT], SW_SHOW);
				 }
				 else if (eOldState == RIGHTMAXIMIZED) {

::ShowWindow(m_hWndPane[SPLIT_PANE_LEFT], SW_SHOW);
				 }

				 baseClass::UpdateSplitterLayout();
				 break;

			 case LEFTMAXIMIZED:
				 ::ShowWindow(m_hWndPane[SPLIT_PANE_RIGHT],
SW_HIDE);
				 ::SetWindowPos(m_hWndPane[SPLIT_PANE_LEFT],
NULL, m_rcSplitter.left, m_rcSplitter.top,
					 m_rcSplitter.right -
m_rcSplitter.left, m_rcSplitter.bottom - m_rcSplitter.top, SWP_NOZORDER);
				 eOldState = LEFTMAXIMIZED;
				 break;

			 case RIGHTMAXIMIZED:
				 ::ShowWindow(m_hWndPane[SPLIT_PANE_LEFT],
SW_HIDE);
				 ::SetWindowPos(m_hWndPane[SPLIT_PANE_RIGHT],
NULL, m_rcSplitter.left, m_rcSplitter.top,
					 m_rcSplitter.right -
m_rcSplitter.left, m_rcSplitter.bottom - m_rcSplitter.top, SWP_NOZORDER);
				 eOldState = RIGHTMAXIMIZED;
				 break;
		 }
	 }

	 void SetSplitterState(eSplitterState eState)
	 {
		 m_eSplitterState = eState;
	 }

	 LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/,
BOOL& bHandled)
	 {
		 if (m_eSplitterState == STANDARD)
			 bHandled = false;
		 return 0;
	 }
protected:
	 eSplitterState m_eSplitterState;
};

typedef CSplitterWindowExT<true> CSplitterWindowEx;
typedef CSplitterWindowExT<false> CHorSplitterWindowEx;

#endif

Now you can use:
	 m_viewSplitter.SetSplitterState(bPaneVisible ?
		 CHorSplitterWindowEx::STANDARD :
CHorSplitterWindowEx::RIGHTMAXIMIZED);
	 m_viewSplitter.UpdateSplitterLayout();
or:
	 m_viewSplitter.SetSplitterState(bPaneVisible ?
		 CHorSplitterWindowEx::STANDARD :
CHorSplitterWindowEx::LEFTMAXIMIZED);
	 m_viewSplitter.UpdateSplitterLayout();

But I still have a (big) problem: I have to override
UpdateSplitterLayout (for positioning the splitter panes) and
DrawSplitter or DrawSplitterBar (for preventing the splitter bar to be
drawn).

But only DrawSplitterBar is overrideable (ATL way of "pseudo" virtual
functions).
So I had to change the sources (AtlSplit.h) and changed the declaration of
UpdateSplitterLayout to:
	 virtual void UpdateSplitterLayout()

This because I was to lazy to change every call of UpdateSplitterLayout to
the ATL way of calling virtual functions.

But with this change I lost the possibility of overriding DrawSplitterBar
(which is supported normally). Once you have a virtual function table,
the ATL way of overriding doesn't work anymore.

Since DrawSplitterBar is called from DrawSplitter, and this is called only
once from OnPaint, I intercepted this event to handle this problem.

Conclusio:
I want to toggle a splitter pane. The attached code works, but only if you
change the sources of WTL. Since I couldn't find another way to get the
same functionality, so I had to do so.

Now my question, Nenad: is there another approach, and if not:
is it possible to provide this functionality within WTL or to
provide the possibility to override UpdateSplitterLayout?

Thanks in advance,
Christian


To unsubscribe from this group, send an email to:
wtl-unsubscribe@egroups.com

#421 From: anders.wetterqvist@...
Date: Fri Nov 3, 2000 1:59 pm
Subject: MDI + Form view
anders.wetterqvist@...
Send Email Send Email
 
I have created an ATL/WTL project and chosen the MDI & dialog based
form view options. On the form I have placed Ok/Cancel buttons.

When either of those buttons are clicked I'd like to do some
processing and then close the form. How do I close the form after
I'm through with the processing in the OnOk/OnCancel handlers?

#422 From: Phil McRevis <legalize@...>
Date: Fri Nov 3, 2000 4:55 pm
Subject: Re: Question to Nenad (was Re: Toggling the Splitter Views)
legalize@...
Send Email Send Email
 
In article
<9B9A5456AFE99E4181416B252F63BDA214529D@...>,
     Nenad Stefanovic <nenads@...>  writes:

> [...] Now for the good news: showing only one splitter pane
> will be directly supported in the new version of WTL.

What version would that be?  3.0 is what's in the platform SDK right
now, yes?
--
<http://www.xmission.com/~legalize/> Legalize Adulthood!
     ``Ain't it funny that they all fire the pistol,
       at the wrong end of the race?''--PDBT
legalize@... <http://www.xmission.com/~legalize/who/>

#423 From: Nenad Stefanovic <nenads@...>
Date: Sat Nov 4, 2000 10:15 am
Subject: RE: MDI + Form view
nenads@...
Send Email Send Email
 
Hi Anders,

Just post WM_CLOSE message to the MDI child window. Note that if your
processing is in the form (dialog) handler, MDI child is the parent of the
form.

Thanks,
Nenad



-----Original Message-----
From: anders.wetterqvist@... [mailto:anders.wetterqvist@...]
Sent: Friday, November 03, 2000 6:00 AM
To: wtl@egroups.com
Subject: [wtl] MDI + Form view



I have created an ATL/WTL project and chosen the MDI & dialog based
form view options. On the form I have placed Ok/Cancel buttons.

When either of those buttons are clicked I'd like to do some
processing and then close the form. How do I close the form after
I'm through with the processing in the OnOk/OnCancel handlers?



To unsubscribe from this group, send an email to:
wtl-unsubscribe@egroups.com

#424 From: Nenad Stefanovic <nenads@...>
Date: Sat Nov 4, 2000 10:16 am
Subject: RE: Question to Nenad (was Re: Toggling the Splitter Views)
nenads@...
Send Email Send Email
 
Hi Phil,

It will be the new version (post 3.0). It will be out soon.

Thanks,
Nenad


-----Original Message-----
From: Phil McRevis [mailto:legalize@...]
Sent: Friday, November 03, 2000 8:56 AM
To: wtl@egroups.com
Subject: Re: [wtl] Question to Nenad (was Re: Toggling the Splitter
Views)



In article
<9B9A5456AFE99E4181416B252F63BDA214529D@...
m>,
     Nenad Stefanovic <nenads@...>  writes:

> [...] Now for the good news: showing only one splitter pane
> will be directly supported in the new version of WTL.

What version would that be?  3.0 is what's in the platform SDK right
now, yes?
--
<http://www.xmission.com/~legalize/> Legalize Adulthood!
     ``Ain't it funny that they all fire the pistol,
       at the wrong end of the race?''--PDBT
legalize@... <http://www.xmission.com/~legalize/who/>


To unsubscribe from this group, send an email to:
wtl-unsubscribe@egroups.com

#425 From: "Shaun Wilde" <shaun_wilde@...>
Date: Sat Nov 4, 2000 10:15 am
Subject: WM_CTLCOLOR??? msgs
shaun_wilde@...
Send Email Send Email
 
Hi all

I am trying to create a custom ComboBox based on WTLs CComboBox (actually a
port from MFC). I would like to control the background colour of the edit
box when enabled/disabled. I am subclassing the window and I have the
reflection bits added to my CMyComboBox and the hosting dialog.

however even though my handlers for WM_CTLCOLOREDIT and WM_CTLCOLORSTATIC
are being called they don't seem to have any effect.

I think I need a reflect handler for these messages but I can't determine
which ones to use :(

I'd like if possible to keep all the code within the CMyComboBox.

I am obviously missing something - can anyone help

Shaun Wilde


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

#426 From: anders.wetterqvist@...
Date: Sat Nov 4, 2000 6:22 pm
Subject: Re: MDI + Form view
anders.wetterqvist@...
Send Email Send Email
 
I thought I had tried every version of posting a WM_CLOSE message
I could think of - apparently not the one below

::PostMessage(GetParent(),WM_CLOSE,0,0);

It did it for me. Thank you!

--- In wtl@egroups.com, Nenad Stefanovic <nenads@m...> wrote:
> Hi Anders,
>
> Just post WM_CLOSE message to the MDI child window. Note that if
your
> processing is in the form (dialog) handler, MDI child is the parent
of the
> form.
>
> Thanks,
> Nenad
>
>
>
> -----Original Message-----
> From: anders.wetterqvist@t... [mailto:anders.wetterqvist@t...]
> Sent: Friday, November 03, 2000 6:00 AM
> To: wtl@egroups.com
> Subject: [wtl] MDI + Form view
>
>
>
> I have created an ATL/WTL project and chosen the MDI & dialog based
> form view options. On the form I have placed Ok/Cancel buttons.
>
> When either of those buttons are clicked I'd like to do some
> processing and then close the form. How do I close the form after
> I'm through with the processing in the OnOk/OnCancel handlers?
>
>
>
> To unsubscribe from this group, send an email to:
> wtl-unsubscribe@egroups.com

#427 From: "Paul Bludov" <paul@...>
Date: Sun Nov 5, 2000 1:20 am
Subject: Re: WM_CTLCOLOR??? msgs
paul@...
Send Email Send Email
 
----- Original Message -----
From: "Shaun Wilde" <shaun_wilde@...>
To: <wtl@egroups.com>
Sent: Saturday, November 04, 2000 6:15 PM
Subject: [wtl] WM_CTLCOLOR??? msgs


>
> Hi all
>
> I am trying to create a custom ComboBox based on WTLs CComboBox (actually
a
> port from MFC). I would like to control the background colour of the edit
> box when enabled/disabled. I am subclassing the window and I have the
> reflection bits added to my CMyComboBox and the hosting dialog.
>
> however even though my handlers for WM_CTLCOLOREDIT and WM_CTLCOLORSTATIC
> are being called they don't seem to have any effect.

     Just add REFLECT_NOTIFICATIONS() macro to your _parent_ window class.

  BEGIN_MSG_MAP(CMainFrame)
   MESSAGE_HANDLER(...)
   CHAIN_MSG_MAP(...)
   REFLECT_NOTIFICATIONS()
  END_MSG_MAP()

>
> I think I need a reflect handler for these messages but I can't determine
> which ones to use :(
>
> I'd like if possible to keep all the code within the CMyComboBox.
>
> I am obviously missing something - can anyone help
>
> Shaun Wilde
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>
>
> To unsubscribe from this group, send an email to:
> wtl-unsubscribe@egroups.com
>
>
>
>

#428 From: "Shaun Wilde" <shaun_wilde@...>
Date: Sun Nov 5, 2000 10:14 am
Subject: Re: WM_CTLCOLOR??? msgs
shaun_wilde@...
Send Email Send Email
 
>
>     Just add REFLECT_NOTIFICATIONS() macro to your _parent_ window class.
>
>  BEGIN_MSG_MAP(CMainFrame)
>   MESSAGE_HANDLER(...)
>   CHAIN_MSG_MAP(...)
>   REFLECT_NOTIFICATIONS()
>  END_MSG_MAP()
>

I had already done this

> > box when enabled/disabled. I am subclassing the window and I have the
> > reflection bits added to my CMyComboBox and the hosting dialog.

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

#429 From: Lipp Christian <Christian.Lipp@...>
Date: Mon Nov 6, 2000 8:04 am
Subject: Re: WM_CTLCOLOR??? msgs
Christian.Lipp@...
Send Email Send Email
 
David Shiel posted the solution to this (at WTL during September - posting
#302)
on "ro CEdit" and subsequent replies.

WM_CTLCOLORSTATIC (and also the others) is sent from control to parten
window,
with reflection it is sent back to the control as OCM_CTLCOLORSTATIC.

Now, when you subclass the control, you receive the OCM_CTLCOLORSTATIC in
your
parents alternate message map.

To keep all the code within your CMyComboBox, you should superclass it.
I will also send you the code for an edit box offline.

Hope, this helps.

> I am trying to create a custom ComboBox based on WTLs
> CComboBox (actually a
> port from MFC). I would like to control the background colour
> of the edit
> box when enabled/disabled. I am subclassing the window and I have the
> reflection bits added to my CMyComboBox and the hosting dialog.
>
> however even though my handlers for WM_CTLCOLOREDIT and
> WM_CTLCOLORSTATIC
> are being called they don't seem to have any effect.
>
> I think I need a reflect handler for these messages but I
> can't determine
> which ones to use :(
>
> I'd like if possible to keep all the code within the CMyComboBox.
>
> I am obviously missing something - can anyone help
>
> Shaun Wilde

#430 From: "Shaun Wilde" <shaun_wilde@...>
Date: Mon Nov 6, 2000 12:33 pm
Subject: Re: WM_CTLCOLOR??? msgs
shaun_wilde@...
Send Email Send Email
 
thanks all to get it to work properly I needed handlers for

MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic)
MESSAGE_HANDLER(OCM_CTLCOLORSTATIC, OnCtlColorStatic)
MESSAGE_HANDLER(OCM_CTLCOLOREDIT, OnCtlColorEdit)

for all these messages for it to work properly

thanks again :)

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

#431 From: anders.wetterqvist@...
Date: Mon Nov 6, 2000 2:02 pm
Subject: MDI + dialog based formview + Listview control
anders.wetterqvist@...
Send Email Send Email
 
I'm looking for an example of using a Listview control in report
mode (LVS_REPORT). I have managed to add Column headers properly
but I'm struggling with getting the actual Items to appear in the
control. An example anyone?

#432 From: David Shiel <dshiel@...>
Date: Mon Nov 6, 2000 2:11 pm
Subject: RE: MDI + dialog based formview + Listview control
dshiel@...
Send Email Send Email
 
Hi there Anders,

I am assuming that you have derived your ListView control
Try the code below,

void CMyListViewControl::AddListViewItem()
{
	 CString strText("Hello There");

	 LV_ITEM      lvi;
	 int          nCounter = GetItemCount();

	 lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
	 lvi.iItem       = nCounter;
	 lvi.iSubItem    = 0;
	 lvi.pszText     = (char*)(LPCTSTR)strText;
	 lvi.cchTextMax  = strText.GetLength();
	 lvi.iImage      = 0;

	 // and add an entry
#if 1
	 SendMessage(m_hWnd, LVM_INSERTITEM, 0, (LPARAM)(const
LPLVITEM)&lvi);
#else
	 InsertItem(&lvi);
#endif

	 // Set the Message column with the corresponding text
	 lvi.mask = LVIF_TEXT;
	 lvi.iSubItem++;
	 lvi.pszText = (char*)(LPCTSTR)strMessage;
	 lvi.cchTextMax = strMessage.GetLength();

#if 1
	 SendMessage(m_hWnd, LVM_SETITEM, 0, (LPARAM)(const LPLVITEM)&lvi);
#else
	 SetItem(&lvi);
#endif
}

Later,
Dave.

> ----------
> From:
> anders.wetterqvist@...[SMTP:anders.wetterqvist@...]
> Reply To:  wtl@egroups.com
> Sent:  06 November 2000 14:02
> To:  wtl@egroups.com
> Subject:  [wtl] MDI + dialog based formview + Listview control
>
>
> I'm looking for an example of using a Listview control in report
> mode (LVS_REPORT). I have managed to add Column headers properly
> but I'm struggling with getting the actual Items to appear in the
> control. An example anyone?
>
>
>
> To unsubscribe from this group, send an email to:
> wtl-unsubscribe@egroups.com
>
>
>

#433 From: "Alex I. Pylaev" <aip@...>
Date: Mon Nov 6, 2000 4:13 pm
Subject: Using ActiveX Controls ?
aip@...
Send Email Send Email
 
Hello All,

How can I use ActiveX controls in wtl application?

I tryed to add DateTimePicker (from standart panel of VC), but the
dialog window didn't be opened. Why?

I added "Microsoft Date Time Picker ... " by "insert ActiveX
control.." and now dialog works fine, but how can I work with
properties of this object?

"Project/ Add to Project / Components and Controls..." generates
sources where class of control derives from CWnd.

Where I can read about this?


--
Best regards,
  Alex                          mailto:aip@...

#434 From: "Yuri Kirilenko" <kiri@...>
Date: Mon Nov 6, 2000 6:43 pm
Subject: Re: Using ActiveX Controls ?
kiri@...
Send Email Send Email
 
Hi Alex,

>I tryed to add DateTimePicker (from standart panel of VC), but the
>dialog window didn't be opened. Why?

Are you use the ICC_DATE_CLASSES flag
in the INITCOMMONCONTROLSEX structure ?

Regards, Yuri


-----Original message-----
From: Alex I. Pylaev <aip@...>
To: wtl@egroups.com <wtl@egroups.com>
Sent: 6 nov 2000, 16:27
Subj: [wtl] Using ActiveX Controls ?

>Hello All,
>
>How can I use ActiveX controls in wtl application?
>
>I tryed to add DateTimePicker (from standart panel of VC), but the
>dialog window didn't be opened. Why?
>
>I added "Microsoft Date Time Picker ... " by "insert ActiveX
>control.." and now dialog works fine, but how can I work with
>properties of this object?
>
>"Project/ Add to Project / Components and Controls..." generates
>sources where class of control derives from CWnd.
>
>Where I can read about this?
>
>
>--
>Best regards,
> Alex                          mailto:aip@...
>
>
>
>
>To unsubscribe from this group, send an email to:
>wtl-unsubscribe@egroups.com
>
>

#435 From: "Stéphane Bourbeau" <stephane_bourbeau@...>
Date: Mon Nov 6, 2000 7:47 pm
Subject: CAxWindow and an ActiveX Control...
stephane_bourbeau@...
Send Email Send Email
 
Hi. I'm trying to develop an MDI application which the Child Frame
View is a superclass of an ActiveX Control (a PDF viewer). I read
that by default, the CAxWindow will instantiate the MSHTML Control.
As I understand, we can provide a ClsID in the wc structure so it
will call CoCreateInstance and create the ActiveX Component I want,
instead of the MSHTML control. So, I came with something like this :

class CTestActiveXDocView : public CWindowImpl<CTestActiveXDocView,
CAxWindow>
{
public:
	 // Pour le class id
	 static const char * GetClsid()
	 {
		 static char s_pcClsId[38] = "\0";
		 static CLSID const clsid
			 = { 0xca8a9780, 0x280d, 0x11cf, { 0xa2, 0x4d,
0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };

		 if (s_pcClsId[0] == 0)
		 {
			 LPOLESTR temp;
			 StringFromCLSID(clsid, &temp);
			 CString sTemp(temp);
			 strcpy(s_pcClsId, (const char *) sTemp);
			 CoTaskMemFree(temp);
		 }
		 return s_pcClsId;
	 }

	 DECLARE_WND_SUPERCLASS(NULL, GetClsid())

	 BOOL PreTranslateMessage(MSG* pMsg)
	 {
		 if((pMsg->message < WM_KEYFIRST || pMsg->message >
WM_KEYLAST) &&
		    (pMsg->message < WM_MOUSEFIRST || pMsg->message >
WM_MOUSELAST))
			 return FALSE;

		 // give HTML page a chance to translate this message
		 return (BOOL)SendMessage(WM_FORWARDMSG, 0, (LPARAM)
pMsg);
	 }

	 BEGIN_MSG_MAP(CTestActiveXDocView)
	 END_MSG_MAP()
};

And I get and Assertion Failed on IsWindow. Now, I would like to know
what I have to do to superclass and ActiveX Control like this and if
there's a simpler way of doing so (like the MFC wizard that creates
the IDispatch wrapper for the control).

Thank you

#436 From: anders.wetterqvist@...
Date: Tue Nov 7, 2000 7:08 am
Subject: Re: MDI + dialog based formview + Listview control
anders.wetterqvist@...
Send Email Send Email
 
Hi Dave,

Thanks for your input!

I discovered that the style for the Listview was set to 'Owner draw
fixed' in the Resource editor. When I cleared that my code worked
like a dream.
:)

Anders

--- In wtl@egroups.com, David Shiel <dshiel@f...> wrote:
> Hi there Anders,
>
> I am assuming that you have derived your ListView control
> Try the code below,
>
> void CMyListViewControl::AddListViewItem()
> {
>  CString strText("Hello There");
>
>  LV_ITEM      lvi;
>  int          nCounter = GetItemCount();
>
>  lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
>  lvi.iItem       = nCounter;
>  lvi.iSubItem    = 0;
>  lvi.pszText     = (char*)(LPCTSTR)strText;
>  lvi.cchTextMax  = strText.GetLength();
>  lvi.iImage      = 0;
>
>  // and add an entry
> #if 1
>  SendMessage(m_hWnd, LVM_INSERTITEM, 0, (LPARAM)(const
> LPLVITEM)&lvi);
> #else
>  InsertItem(&lvi);
> #endif
>
>  // Set the Message column with the corresponding text
>  lvi.mask = LVIF_TEXT;
>  lvi.iSubItem++;
>  lvi.pszText = (char*)(LPCTSTR)strMessage;
>  lvi.cchTextMax = strMessage.GetLength();
>
> #if 1
>  SendMessage(m_hWnd, LVM_SETITEM, 0, (LPARAM)(const LPLVITEM)
&lvi);
> #else
>  SetItem(&lvi);
> #endif
> }
>
> Later,
> Dave.
>
> > ----------
> > From:
> > anders.wetterqvist@t...[SMTP:anders.wetterqvist@t...]
> > Reply To:  wtl@egroups.com
> > Sent:  06 November 2000 14:02
> > To:  wtl@egroups.com
> > Subject:  [wtl] MDI + dialog based formview + Listview control
> >
> >
> > I'm looking for an example of using a Listview control in report
> > mode (LVS_REPORT). I have managed to add Column headers properly
> > but I'm struggling with getting the actual Items to appear in the
> > control. An example anyone?
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > wtl-unsubscribe@egroups.com
> >
> >
> >

#437 From: Lipp Christian <Christian.Lipp@...>
Date: Tue Nov 7, 2000 7:11 am
Subject: Re: WM_CTLCOLOR??? msgs
Christian.Lipp@...
Send Email Send Email
 
> thanks all to get it to work properly I needed handlers for
>
> MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic)
> MESSAGE_HANDLER(OCM_CTLCOLORSTATIC, OnCtlColorStatic)
> MESSAGE_HANDLER(OCM_CTLCOLOREDIT, OnCtlColorEdit)
>
> for all these messages for it to work properly

Hello Shaun,

great that you solved your problem.
I just wanted to mark that I don't understand, why you need

MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic)

In the control, this message never comes.
In the parent, this message is handled via the
REFLECT_NOTIFICATION() macro, so you also don't
have to handle it.

Greetings,
Christian

#438 From: "Shaun Wilde" <shaun_wilde@...>
Date: Tue Nov 7, 2000 10:54 am
Subject: Re: Re: WM_CTLCOLOR??? msgs
shaun_wilde@...
Send Email Send Email
 
>
>Hello Shaun,
>
>great that you solved your problem.
>I just wanted to mark that I don't understand, why you need
>
>MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic)

this is because when I use CBS_DROPDOWN the combo box has an edit box
which has my combobox as its parent


I actually missed out another handler that is required

MESSAGE_HANDLER(WM_CTLCOLOREDIT, OnCtlColorEdit)

the full map is

MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic) // called when the edit
in the combo is disabled
MESSAGE_HANDLER(WM_CTLCOLOREDIT, OnCtlColorEdit) // called when edit is
enabled
MESSAGE_HANDLER(OCM_CTLCOLORSTATIC, OnCtlColorStatic) // called when the
edit in the combo is disabled
MESSAGE_HANDLER(OCM_CTLCOLOREDIT, OnCtlColorEdit) // called when edit is
enabled

I disable/enable the edit box to create an effect that I am toggling between
   CBS_DROPDOWNLIST and CBS_DROPDOWN

I tried without the two extra handlers and my box had white/grey borders
around the text

the MFC sample I was porting is here - it also handles both types of
messages

http://codeguru.earthweb.com/combobox//combo_dropdown_dropdownlist.shtml


>In the control, this message never comes.
>In the parent, this message is handled via the
>REFLECT_NOTIFICATION() macro, so you also don't
>have to handle it.
>
>Greetings,
>Christian

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

#439 From: "M.Mottl" <mmottl@...>
Date: Tue Nov 7, 2000 12:59 pm
Subject: CString::TrimLeft Bug?
mmottl@...
Send Email Send Email
 
has anyone ever used WTL::CString::TrimLeft with _UNICODE defined on NT4sp5?
I always run into a crash. It seems to me that TrimLeft (maybe others also)
work only with ANSI strings. In my case CString::nDataLength goes below zero
in TrimLeft and memmove causes the crash.

#440 From: Christian.Lipp@...
Date: Tue Nov 7, 2000 1:14 pm
Subject: Re: WM_CTLCOLOR??? msgs
Christian.Lipp@...
Send Email Send Email
 
> this is because when I use CBS_DROPDOWN the combo box has an
> edit box which has my combobox as its parent

my fault.

> I tried without the two extra handlers and my box had white/grey
> borders around the text
>
> the MFC sample I was porting is here - it also handles both types
> of messages
>
>
http://codeguru.earthweb.com/combobox//combo_dropdown_dropdownlist.sht
ml

I never programmed in MFC but when I looked at this example,
I was surprised how similar the MFC code is compared to the
WTL code.

I was always following the discussions about the differences,
but there are also a lot of common issues.

Thanks for pointing me to this example,
Christian

#441 From: kchristen@...
Date: Tue Nov 7, 2000 1:49 pm
Subject: RE: CString::TrimLeft Bug?
kchristen@...
Send Email Send Email
 
I have run into a similar bug in CString::Remove(), at line 2227 of
atlmisc.h.  It fails to update the string length correctly in UNICODE mode,
causing a crash when the string is later accessed.  The code in TrimLeft()
looks identical.

-----Original Message-----
From: M.Mottl [mailto:mmottl@...]
Sent: Tuesday, November 07, 2000 6:59 AM
To: wtl@egroups.com
Subject: [wtl] CString::TrimLeft Bug?



has anyone ever used WTL::CString::TrimLeft with _UNICODE defined on NT4sp5?
I always run into a crash. It seems to me that TrimLeft (maybe others also)
work only with ANSI strings. In my case CString::nDataLength goes below zero
in TrimLeft and memmove causes the crash.




To unsubscribe from this group, send an email to:
wtl-unsubscribe@egroups.com

#442 From: "Simon-Pierre Cadieux" <simon-pierre.cadieux@...>
Date: Tue Nov 7, 2000 2:24 pm
Subject: Re: CString::TrimLeft Bug?
simon-pierre.cadieux@...
Send Email Send Email
 
See "WTL::CString bugs under Unicode" at
http://www.codeproject.com/wtl/wtl_bugs.asp
. I think it can be of some help.

Simon-Pierre

--- In wtl@egroups.com, kchristen@m... wrote:
> I have run into a similar bug in CString::Remove(), at line 2227 of
> atlmisc.h.  It fails to update the string length correctly in
UNICODE mode,
> causing a crash when the string is later accessed.  The code in
TrimLeft()
> looks identical.

Messages 413 - 442 of 16626   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help