lyshsd | 1 Oct 2006 02:54
Favicon

how to stream in rtf string of unicode

hi:
  i want stream in unicode string to richedit control.when ansi, 
following is right.how to modify it to adapt to unicode?
   a unicode string like this:
 CString s=_T("{\\rtf1\\ansi \\v [\\v0 100\\v #100#]\\v0}");

    typedef struct RtfStream
   {
      LPTSTR pstr;
      DWORD pos;
   };

LONG CLearner::StreamInRTF(LPCTSTR pstrRTF)
{
	// Stream in new text...
	USES_CONVERSION;
//	RtfStream st = { T2A((LPTSTR)pstrRTF), 0 }; // TODO: Don't 
use inline conversion for large texts
	RtfStream st = { (LPTSTR)pstrRTF, 0 }; 
	EDITSTREAM es = { 0 };
	es.dwCookie = (DWORD) &st; 
	es.dwError = 0;
	es.pfnCallback = StrStreamReadCallback;
	UINT uFormat = pstrRTF[0]==_T('{') ? SF_RTF : SF_TEXT;
	return StreamIn(uFormat | SFF_SELECTION, es);
}

DWORD CALLBACK CLearner::StrStreamReadCallback(DWORD dwCookie, 
LPBYTE pbBuff, LONG cb, LONG* pcb)
{
(Continue reading)

Alain Rist | 1 Oct 2006 17:23

RE: CString in WTL and other ideas

Hi,

You may be interested by this article :

WTL CString class <http://www.codeproject.com/useritems/WtlStdString.asp>
implemented with the Standard C++ Library

Plug-in CodeProject's CStdString as WTL::CString and get the WTL CString
support with Standard C++ Library implementation

cheers,

AR

  _____  

De : wtl@...
[mailto:wtl@...] De la part de
enjoy_yjh
Envoyé : jeudi 28 septembre 2006 16:10
À : wtl@...
Objet : [wtl] CString in WTL and other ideas

Is it still necessary to provide CString class in WTL? ATL 7 seems to 
have a more complicated CString/CSimpleString and so on. CString in WTL 
is lack of some functions, for instance, Tokenize. 

And what's the relationship between WTL and ATL? ATL no long needs 
_Moudle, but WTL still does. Is it a conflict in design philosophy? Is 
there a trend in Microsoft to merge ATL and MFC since they have so many 
(Continue reading)

Bjarke Viksøe | 2 Oct 2006 14:44
Picon
Favicon

Re: how to stream in rtf string of unicode

--- In wtl@..., "lyshsd" <lyshsd <at> ...> wrote:
>
> hi:
>   i want stream in unicode string to richedit control.when ansi, 
> following is right.how to modify it to adapt to unicode?
>    a unicode string like this:
> lyshsd
>

If you read the MSDN documentation closely, it seems that you cannot 
combine the SF_UNICODE and SF_RTF flags, so keeping it ASCII/MBCS seems 
to be the only choice. You may have some luck simply using 
SetWindowTextW on richedit 2.0 or later, but I found no reliable 
solution.

regards,
bjarke

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)
(Continue reading)

hallgrenjohan | 3 Oct 2006 14:11
Picon

Toolbar at PocketPC

Hello

I tries to create a application for PocketPC with menues and tools in
the commandbar. And how I tries the tools just show up. The menues are
there but not the tools. I use the ATL/WTL AppWizard for windows CE
and I create a toolbar with some tools and I give the toolbar the same
name as the menu. Now I can compile it but the tools isn't there when
I run it.

I use VS 2005 professional.

Any idea what I have done wrong?

Regards
Johan

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
(Continue reading)

hallgrenjohan | 3 Oct 2006 20:29
Picon

Re: Toolbar at PocketPC

--- In wtl@..., "hallgrenjohan" <jhhal <at> ...> wrote:
OK, I had to do it in two steps:

CreateSimpleCEMenuBar(IDR_MAINFRAME, SHCMBF_HMENU);
CreateSimpleCEToolBar(IDR_TOOL);

/Johan

>
> Hello
> 
> I tries to create a application for PocketPC with menues and tools in
> the commandbar. And how I tries the tools just show up. The menues are
> there but not the tools. I use the ATL/WTL AppWizard for windows CE
> and I create a toolbar with some tools and I give the toolbar the same
> name as the menu. Now I can compile it but the tools isn't there when
> I run it.
> 
> I use VS 2005 professional.
> 
> Any idea what I have done wrong?
> 
> Regards
> Johan
>

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
(Continue reading)

cnkknd | 4 Oct 2006 11:47
Picon
Favicon

Question about CContainedWindow(subclasswindow) and Class inheriting.


Some of dialogs in my application is nearly the same. So I made a base
class for them.
This base class contained thier common functions.

I use CHAIN_MSG_MAP to send common messages to the base class in sub
classes. It works.
There are some CContainedWindow in the base class. Normally I can use
ALT_MSG_MAP to handle these messages. But here, I have to add
ALT_MSG_MAP to sub classes. If I put ALT_MSG_MAP in to the base class,
the functions specified in ATL_MSG_MAP will not be activated.
CHAIN_MSG_MAP seems not send messages from these subclasswindow controls
to the base class.

Is there any way to send messages from subclasswindow to ALT_MSG_MAPs in
base class?

[Non-text portions of this message have been removed]

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
(Continue reading)

Jim Barry | 4 Oct 2006 17:45

Re: Question about CContainedWindow(subclasswindow) and Class inheriting.

cnkknd wrote:
> Is there any way to send messages from subclasswindow to ALT_MSG_MAPs
> in base class?

You need CHAIN_MSG_MAP_ALT. For example:

BEGIN_MSG_MAP(DerivedClass)
  // ...
ALT_MSG_MAP(1)
  CHAIN_MSG_MAP_ALT(BaseClass, 1)
ALT_MSG_MAP(2)
  CHAIN_MSG_MAP_ALT(BaseClass, 2)
END_MSG_MAP()

Unfortunately, ATL doesn't provide a way to chain to all the alternative message maps at once, so the
derived class requires knowledge of which message map IDs are used by the base class.

--

-- 
Jim Barry, MVP (Windows SDK)

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
(Continue reading)

avewtl | 9 Oct 2006 12:21
Picon
Favicon

Scrollbar problem

I've created a vertical CScrollBar control (as a child of MDI child 
frame) for my client view (also a child of MDI child frame) . 

The VScrollbar is initialized using:

            SCROLLINFO si = { sizeof(SCROLLINFO) };

            si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS | 
SIF_DISABLENOSCROLL;
            si.nMin  = 0;
            si.nMax  = 639;         
            si.nPage = 640;
            si.nPos  = 0;

            m_pVScroll->SetScrollInfo(&si);

And the child frame is initialized so that the client view has a size 
of 640*480.

I've made these settings so that when the child frame is first shown, 
an image of size 640*480 is wholly visible, and the scrollbar is 
shown disabled (since 100% is displayed).

But in my test, the scrollbar turns out to be still enabled, with the 
thumb box occupying 100% of the shaft. If I immediately maximize the 
child frame and restore it, the scrollbar becomes disabled, which is 
what I want to see when the child frame is first shown.

My question is: why is this scrollbar still enabled when 100% is 
displayed?
(Continue reading)

avewtl | 9 Oct 2006 12:32
Picon
Favicon

Re: WTL and Scrollbars

You'll have to call SetScrollPage() before calling SetScrollSize().

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:wtl-digest@... 
    mailto:wtl-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    wtl-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Jim Barry | 10 Oct 2006 13:05

Re: Scrollbar problem

avewtl wrote:
> But in my test, the scrollbar turns out to be still enabled, with the
> thumb box occupying 100% of the shaft. If I immediately maximize the
> child frame and restore it, the scrollbar becomes disabled, which is
> what I want to see when the child frame is first shown.

For some reason, SetScrollInfo only disables the scrollbar if it is visible. As a workaround, you can
either disable the scrollbar explicitly, or wait until it is visible before calling SetScrollInfo.

-- 
Jim Barry, MVP (Windows SDK)

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:wtl-digest@... 
    mailto:wtl-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
(Continue reading)


Gmane