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...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 10025 - 10054 of 16626   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#10025 From: "qwertyqaa" <maskofzero@...>
Date: Thu Sep 30, 2004 1:27 am
Subject: Whidbey atl-less environment
qwertyqaa
Send Email Send Email
 
It appears there is now a need for a free replacement
to ATL since the MS Dorks have prevented ATL from being part of
the whidbey express install package. I couldnt really care about
MFC, but ATL is needed with WTL for us to get by.
thoughts?

#10026 From: Bjoern Graf <bjoern.graf@...>
Date: Thu Sep 30, 2004 3:35 am
Subject: Re: Whidbey atl-less environment
bjoern23p
Send Email Send Email
 
Express is targeted at .NET and Windows Forms and does not feature a
resource editor; and I wouldn't want to use it for anything else :)
Anyway, all other flavours of VS.NET 2005 come with ATL/MFC and RC
editor so there's no real need to replace ATL in WTL.

-- b.gr


On Thu, 30 Sep 2004 01:27:45 -0000, qwertyqaa <maskofzero@...> wrote:
>
> It appears there is now a need for a free replacement
> to ATL since the MS Dorks have prevented ATL from being part of
> the whidbey express install package. I couldnt really care about
> MFC, but ATL is needed with WTL for us to get by.
> thoughts?

#10027 From: "Adelle L. Hartley" <adelle@...>
Date: Thu Sep 30, 2004 5:26 am
Subject: RE: Re: Why wtl? Why not .Net/C#
adelle@...
Send Email Send Email
 
Hi,

Andrew Fedoniouk wrote:
> E.g. garbage collectible systems way better on server side
> than reference
> counted ones.

Why?

Adelle.

#10028 From: akshay harsulkar <akshayhh@...>
Date: Thu Sep 30, 2004 8:59 am
Subject: error solution
akshayhh
Send Email Send Email
 
In my code i used FindFirstFileEx API . I got error about it .

error C2039: 'FindFirstFileEx' : is not a member of '`global namespace''
error C2065: 'FindFirstFileEx' : undeclared identifier

I included #define _WIN32_WINNT 0x0500
                #include "windows.h"
                 #include "stdio.h"

still i am getting same error . Is it any solution about FindFirstFileEx  in ATL
.






Thanks & Regards
Akshay Harsulkar
Mobile No. 9822556538

Doing ordinary things exraordinarily




---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

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

#10029 From: "Jeff Henkels" <jeff-wtl@...>
Date: Thu Sep 30, 2004 11:52 am
Subject: Re: error solution
jhenkels
Send Email Send Email
 
In my copy of <winbase.h> from the Feb 2003 Platform SDK, in which
FindFirstFileEx is defined, the definition is wrapped in #if _WIN32_WINNT >=
0x0501.  So redefine _WIN32_WINNT appropriately, and you should be OK.


"akshay harsulkar" <akshayhh@...> wrote
in message news:20040930085930.97878.qmail@....
> In my code i used FindFirstFileEx API . I got error about it .
>
> error C2039: 'FindFirstFileEx' : is not a member of '`global namespace''
> error C2065: 'FindFirstFileEx' : undeclared identifier
>
> I included #define _WIN32_WINNT 0x0500
>               #include "windows.h"
>                #include "stdio.h"
>
> still i am getting same error . Is it any solution about FindFirstFileEx
> in ATL .
>
>
>
>
>
>
> Thanks & Regards
> Akshay Harsulkar
> Mobile No. 9822556538
>
> Doing ordinary things exraordinarily
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> vote.yahoo.com - Register online to vote today!
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>

#10030 From: Karol Pluciennik <troloo@...>
Date: Thu Sep 30, 2004 8:23 am
Subject: RE: OnTimer function is not being called
troloo
Send Email Send Email
 
Angus Comber wrote:
> Hello
>
> If I create a standard SDI WTL application using the wizard I can add
> a Windows message handler OnTimer.  I then SetTimer(10, 1000) in
> OnCreate and it all works fine.
>
> But in my SDI application (I have been working on) my OnTimer function
> never gets called!

Maybe you could try to use normal, API function:

UINT SetTimer(HWND hWnd, UINT nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc
);

and associate TimerFunc with it (pass the pointer to your TimerProc)? You
can try it... after all.

--
Regards - TroLoo
m@il: troloo@...
gg#: 69365
icq#: 83033632

#10031 From: "emailora2002" <emailora2002@...>
Date: Thu Sep 30, 2004 6:22 am
Subject: question about CListViewCtrl and screen flicker
emailora2002
Send Email Send Email
 
1 In my code,have a CListViewCtl control and need to support  edit
function ,I don't know how to implete ,could you give me some
examples?
2 I don't know how to avoid screen flicker when I draw a graphic and
clear it?I only know create a memory device context and calling Win32
funciton CreateCompatibleDC is a better way,and I wrote following
code,but it doesn't work:
     (1)clear a graphic:
     ClientDC pDC(m_hWnd);
	 CDC dc;
	 HDC hDC;
	 hDC = GetDC();
	 pDC.m_hDC=hDC;
	 RECT lpRect;
	 GetClientRect(&lpRect);
	 lpRect.bottom=BOTTOM;
         pDC.GetClipBox(&lpRect);

	 CRect rect;
	 dc.CreateCompatibleDC(pDC.m_hDC);
	 COLORREF color=GetBkColor(pDC.m_hDC);
	 HBRUSH  OldBrush,hblbrush;
	 CBrush *blbrush=new CBrush(NULL);
     hblbrush=blbrush->CreateSolidBrush(m_colorBack);
	 dc.SetBkMode(TRANSPARENT);
	 dc.SetBkColor(color);
	 OldBrush = dc.SelectBrush(hblbrush);
	 dc.Rectangle(&lpRect);
	 dc.SelectBrush(OldBrush);
    (2) draw a graphic:
         CPaintDC dc(m_hWnd); // device context for painting
	 CBrush *pBrushc = new CBrush(NULL);
	 HBRUSH  pNewBrush, pOldBrush;
	 pNewBrush = pBrushc->CreateSolidBrush(m_colorBack);
	 pOldBrush =  dc.SelectBrush(pNewBrush);
	   dc.Rectangle(12, 25, 675, 345);
	  dc.SetBkMode(TRANSPARENT);
	   dc.SelectBrush(pOldBrush);
	 CDC memdc;
	   CBitmap bitmap;
	   HBITMAP pOldBitmap;
	   RECT lpRect;
	  GetClientRect(&lpRect);
	 lpRect.bottom=BOTTOM;
	 mpdc.GetClipBox(&lpRect);

	   CRect rect;
	   if(mem.CreateCompatibleDC(dc.m_hDC))
	   {

		   HBITMAP hbitmap=bitmap.CreateCompatibleBitmap
(dc.m_hDC,rect.Width(), rect.Height());
		   pOldBitmap=dc.SelectBitmap(hbitmap);
		   memdc.SelectClipRgn(NULL);
		   memdc.IntersectClipRect(&lpRect);
              }

Would appreciate any ideas to resolve this.


Thanks & Regards
Ashley li

#10032 From: "qwertyqaa" <maskofzero@...>
Date: Thu Sep 30, 2004 7:08 am
Subject: Re: Whidbey atl-less environment
qwertyqaa
Send Email Send Email
 
I think it is ok not to have an RC Editor, one can get by without
it - the layout language is not too hard to copy/paste/manipulate
from elsewhere. but removing atl just means you cannot compile a
whole bunch of useful stuff, plus not use wtl etc.
I cant believe that MS removed atl to just save space. In any
case i am all for an ATL replacement just to make WTL complete.

Isnt it ridiculous that a "student" cannot compile a whole bunch
of MS samples? And BTW, its kind of suspicious that MSSDK download
has ATL for win64 but not win32, else i wouldnt have bothered to
even start this thread...

The other motivation to work on a spinoff of WTL/ATL would be
to get it to work with mingw and Borland.



--- In wtl@yahoogroups.com, Bjoern Graf <bjoern.graf@g...> wrote:
> Express is targeted at .NET and Windows Forms and does not feature
a
> resource editor; and I wouldn't want to use it for anything else :)
> Anyway, all other flavours of VS.NET 2005 come with ATL/MFC and RC
> editor so there's no real need to replace ATL in WTL.
>
> -- b.gr
>
>
> On Thu, 30 Sep 2004 01:27:45 -0000, qwertyqaa <maskofzero@h...>
wrote:
> >
> > It appears there is now a need for a free replacement
> > to ATL since the MS Dorks have prevented ATL from being part of
> > the whidbey express install package. I couldnt really care about
> > MFC, but ATL is needed with WTL for us to get by.
> > thoughts?

#10033 From: "Gordon Smith" <schmoo2k@...>
Date: Thu Sep 30, 2004 2:23 pm
Subject: Re: Re: Why wtl? Why not .Net/C#
schmoo2k
Send Email Send Email
 
Server software generally needs to run 24/7 garbage collected software is
easier to write for this scenario, as 1 small leak in conventional
programming will add up over time and cause degradation/crashes.

Gordon

"Adelle L. Hartley" <adelle@...> wrote
in message news:E1CCtTI-00025X-00@....
> Hi,
>
> Andrew Fedoniouk wrote:
> > E.g. garbage collectible systems way better on server side
> > than reference
> > counted ones.
>
> Why?
>
> Adelle.
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>

#10034 From: "Roger Headrick" <lilsroro@...>
Date: Thu Sep 30, 2004 2:27 pm
Subject: Re: question about CListViewCtrl and screen flicker
lilsroro
Send Email Send Email
 
--- In wtl@yahoogroups.com, "emailora2002" <emailora2002@y...> wrote:
> 1 In my code,have a CListViewCtl control and need to support  edit
> function ,I don't know how to implete ,could you give me some
> examples?

1.  Make sure that the listview control has the LVS_EDITLABELS
window style when its created.  It does not have this style by
default.

2.  If there are some item labels that you do not want the user to
be able to edit, handle the LVN_BEGINLABELEDIT notification sent to
the listview's parent by returning TRUE.  By default, the user can
edit all item labels if the listview has the LVS_EDITLABELS window
style.

3.  Handle the LVN_ENDLABELEDIT notification sent to the listview's
parent by returning TRUE if you want the label changed to the edited
value.  By default, the item's label will not be changed to the
edited value.

For example, the parent's message map would the following:

NOTIFY_CODE_HANDLER(LVN_ENDLABELEDIT, OnLVEndLabelEdit)

The parent's handler might look like this:

LRESULT  OnLVEndLabelEdit(...)
{
BOOL bRet = FALSE;
LPNMLVDISPINFO p = (LPNMLVDISPINFO)pnmh;
if(p->iItem.pszText != NULL)
{
CString str = (LPCTSTR)p->iItem.pszText;
// do whatever validation needs to be done here
// set bRet to TRUE if valid
}
return bRet;
}

> 2 I don't know how to avoid screen flicker when I draw a graphic
and
> clear it?

I would recommend using Viksoe's CMemDC class which can be found
here:

http://www.viksoe.dk/code/atlgdix.htm


If I remember correctly, here is how its used from inside a window's
WM_PAINT handler:

CPaintDC dc(m_hWnd);
CMemDC dcMem(dc);
// do all your painting here using dcMem, not dc.

// when dcMem goes out of scope, it will be automatically
// be BitBlt'd to dc.
return 0;

I believe thats all there is to it.

-Roger

#10035 From: Karol Pluciennik <troloo@...>
Date: Thu Sep 30, 2004 2:34 pm
Subject: RE: Re: question about CListViewCtrl and screen flicker
troloo
Send Email Send Email
 
Roger Headrick wrote:
> I believe thats all there is to it.

You could also intercept WM_ERASEBKGND message (doing nothing in it
acutally). It helps if you're repainting whole image all the time.

--
Regards - TroLoo
m@il: troloo@...
gg#: 69365
icq#: 83033632

#10036 From: "Roger Headrick" <lilsroro@...>
Date: Thu Sep 30, 2004 3:00 pm
Subject: Re: question about CListViewCtrl and screen flicker
lilsroro
Send Email Send Email
 
--- In wtl@yahoogroups.com, Karol Pluciennik <troloo@i...> wrote:
> Roger Headrick wrote:
> > I believe thats all there is to it.
>
> You could also intercept WM_ERASEBKGND message (doing nothing in it
> acutally). It helps if you're repainting whole image all the time.
>
> --
> Regards - TroLoo
> m@il: troloo@z...
> gg#: 69365
> icq#: 83033632

Yes, as suggested by TroLoo, you should handle the window's
WM_ERASEBKGND message by returning 1;

-Roger

#10037 From: "Roger Headrick" <lilsroro@...>
Date: Thu Sep 30, 2004 4:00 pm
Subject: Re: I need a hint...(Please) :)
lilsroro
Send Email Send Email
 
--- In wtl@yahoogroups.com, "cengman7" <cengman7@y...> wrote:
>
> I have a somewhat unusual situation.  I'm using CxWindow in an app
> that hosts a number of custom controls.  These controls are
designed
> to have a common subset of events, and the app I'm working on
> (several share these controls) only cares about the subset.
>
> What I'd like to do is define an abstract interface such as
> ICommonCtrl with the common events difined and use that interface
as
> the definition to sink the events.  Unfortunately, when one of the
> controls fires an event, I get the following error in the output
> window.
>
> ERROR : Unable to load Typelibrary. (HRESULT = 0x8002801d)
>  Verify TypelibID and major version specified with
>  IDispatchImpl, CXXXPropImpl, IProvideClassInfoImpl or
> IProvideCLassInfo2Impl
>
>
> Can someone give me a clue as to how I can define my sink and set
up
> the advise so that my sink handle events from one or more controls
> sharing the same interface definition?
>
> Any thoughts or suggestions are greatly appreciated.

If you post a COM question that doesn't get a fairly quick reply,
you might try reposting it using a subject like:

Dear Igor and Kim - Please Help With My Com Problem

-Roger

#10038 From: "Igor Tandetnik" <itandetnik@...>
Date: Thu Sep 30, 2004 4:13 pm
Subject: Re: error solution
itandetnik
Send Email Send Email
 
"Jeff Henkels" <jeff-wtl@...> wrote
in message news:cjgs1v$eb4$1@...
> In my copy of <winbase.h> from the Feb 2003 Platform SDK, in which
> FindFirstFileEx is defined, the definition is wrapped in #if
> _WIN32_WINNT >= 0x0501.  So redefine _WIN32_WINNT appropriately, and
> you should be OK.

I have the same version of Platform SDK installed, but in my copy
FindFirstFileEx is defined under

#if(_WIN32_WINNT >= 0x0400)

The directive is at line 6890
--
With best wishes,
     Igor Tandetnik

"On two occasions, I have been asked [by members of Parliament], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able to rightly apprehend the kind of
confusion of ideas that could provoke such a question." -- Charles
Babbage

#10039 From: Bjoern Graf <bjoern.graf@...>
Date: Thu Sep 30, 2004 4:22 pm
Subject: Re: Re: Whidbey atl-less environment
bjoern23p
Send Email Send Email
 
Comments inline

On Thu, 30 Sep 2004 07:08:52 -0000, qwertyqaa <maskofzero@...> wrote:
> I think it is ok not to have an RC Editor, one can get by without
> it - the layout language is not too hard to copy/paste/manipulate
> from elsewhere.

Well, ok, with RC Editor I meant the dialog designer, not the string
et al. manipulation editors. These indeed are simple to hand code. But
building advanced (includes usable) dialogs without a designer is
nothing I would want to do :)

> but removing atl just means you cannot compile a
> whole bunch of useful stuff, plus not use wtl etc.
> I cant believe that MS removed atl to just save space. In any
> case i am all for an ATL replacement just to make WTL complete.
> Isnt it ridiculous that a "student" cannot compile a whole bunch
> of MS samples?

Again, the target audience is the novice student/hobbyist programmer
that wants to do Windows Forms in C++/CLI, not the ones doing native
Win32 applications. And for these Express is a nice IDE. Removing the
Platform SDK from the download (which is required for ATL) does save
lots of space.

> And BTW, its kind of suspicious that MSSDK download
> has ATL for win64 but not win32, else i wouldnt have bothered to
> even start this thread...

I assume that's because VS.NET 2003 doesn't include ATL64. VS.NET 2005
most likely has ATL64 on board.

> The other motivation to work on a spinoff of WTL/ATL would be
> to get it to work with mingw and Borland.

This motivation is a better one than getting Express support but I'm
not sure if the number of users of these justify the amount of work to
decouple WTL from ATL.

#10040 From: "Angus Comber" <angus@...>
Date: Thu Sep 30, 2004 4:27 pm
Subject: Re: OnTimer function is not being called
anguscomber
Send Email Send Email
 
Lord knows what was happening.  I rebooted and then started receiving the
message OK!

Angus

----- Original Message -----
From: "Karol Pluciennik" <troloo@...>
To: <wtl@yahoogroups.com>
Sent: Thursday, September 30, 2004 9:23 AM
Subject: RE: [wtl] OnTimer function is not being called


> Angus Comber wrote:
> > Hello
> >
> > If I create a standard SDI WTL application using the wizard I can add
> > a Windows message handler OnTimer.  I then SetTimer(10, 1000) in
> > OnCreate and it all works fine.
> >
> > But in my SDI application (I have been working on) my OnTimer function
> > never gets called!
>
> Maybe you could try to use normal, API function:
>
> UINT SetTimer(HWND hWnd, UINT nIDEvent, UINT uElapse, TIMERPROC
lpTimerFunc
> );
>
> and associate TimerFunc with it (pass the pointer to your TimerProc)? You
> can try it... after all.
>
> --
> Regards - TroLoo
> m@il: troloo@...
> gg#: 69365
> icq#: 83033632
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>

#10041 From: "Igor Tandetnik" <itandetnik@...>
Date: Thu Sep 30, 2004 4:42 pm
Subject: Re: Whidbey atl-less environment
itandetnik
Send Email Send Email
 
"qwertyqaa" <maskofzero@...> wrote
in message news:cjgbe4+9ejd@eGroups.com
> And BTW, its kind of suspicious that MSSDK download
> has ATL for win64 but not win32, else i wouldnt have bothered to
> even start this thread...

This was a temporary stop-gap measure. ATL shipped with VC would not
compile with 64-bit compilers, and 64-bit compiler apparently is (or
was) owned by SDK team, so they ported ATL3 to 64-bit and included it in
the SDK.

ATL version eventually shipped with Whidbey will work with 64-bit
compiler, so when Whidbey officially ships, ATL will be pulled from
Platform SDK.
--
With best wishes,
     Igor Tandetnik

"On two occasions, I have been asked [by members of Parliament], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able to rightly apprehend the kind of
confusion of ideas that could provoke such a question." -- Charles
Babbage

#10042 From: "Aaron Hudon" <aaronh@...>
Date: Thu Sep 30, 2004 5:01 pm
Subject: Re: CImagelist - Detach or Destroy?
ajhuddy2000
Send Email Send Email
 
Thanks for the reply.
So, if you look back at the code sample I provided, what would be a
better design for the sheet setting the imagelist in its tab control?
I did it on the 'initialized' callback for the sheet, but that
function needs to be static.

Thanks!


> Scratch my message. CImageList does not have one (I wonder why). Having
> it as a static member is not a good idea then. I'd derive a class from
> CImageList that does call Destroy in its destructor, and used that for a
> static member (assuming the static member is indeed warranted by the
> design).
> --
> With best wishes,
>     Igor Tandetnik
>
> "On two occasions, I have been asked [by members of Parliament], 'Pray,
> Mr. Babbage, if you put into the machine wrong figures, will the right
> answers come out?' I am not able to rightly apprehend the kind of
> confusion of ideas that could provoke such a question." -- Charles
> Babbage

#10043 From: "Andrew Fedoniouk" <news@...>
Date: Thu Sep 30, 2004 5:45 pm
Subject: Re: Re: Why wtl? Why not .Net/C#
newsterrainf...
Send Email Send Email
 
>> E.g. garbage collectible systems way better on server side
>> than reference
>> counted ones.
>
> Why?
>

Reasons are many, just some of them:

1) Cyclic reference problem: e.g. if you have COM collection of items where
each item has reference to the parent collection object. In GC world it is
just enough to "forget" reference to collection itself (remove it from
controlled perimeter) to destroy whole bunch of items together with
collection during mark-n-sweep cycle. In COM world you should
detach/destroy/release-parent-ref for each item to call parent destructor.
DB/ADO Connection and Recordset objects are example of such collection/items
relationship. Severity of the problem is also a degree of number of
developers involved.

2) Server side functionality could be reperesented as a collection of
stateless functions (good and classic design) exposed to the outer world.
During invocation of such function memory allocation can be performed
upfront (in most cases) - one chunk of memory where all object will be
placed. Upon exit of the function it is enough to just delete/free this
chunk as one block without need to call particular destructors. So server
side software could use very simple and fast memory management. In GC world
such allocation schema happens automaticly. Allocation there is extremely
simple and collection of garbage happens (as a rule) after function exit.
    (GC is not a must to use such schema . You can implement it by hands.
     E.g. Apache server uses memory pools for that.
     Implementation is available also as a standalone package:
     APR - http://apr.apache.org/)

Some comments about GC and UI...

Surprise, but straightforward use of Object Oriented Design and GC can ruin
totaly "GCable" UI Frameworks.

Example: Empty Java applet with one paint function overloaded. This paint
does filling applet's background by some solid color.
Java calls around 5 times new Dimension()/ new Rectangle() during simple
WM_PAINT handling. So ten times refresh - one time GC.
.NET Framework has same problems - you can see how applications noticeably
freeze sometimes.
E.g. there are no such thing as draw-fragment-of-string function in
System.Drawing.Graphics class. Just one: DrawString(String s)
So e.g. to draw some custom label with word wrapping you need to call new
String() for each word.
Therefore painting is just on permanent cry there: "GC wake up!".

It does not mean though that GC and UI are not compatible.
I did J-SMILE experiment
(http://www.terrainformatica.com/org/j-smile/index.htm)
and can tell that it is possible (and usefull) to use GC in UI.  Some design
principles just need to be changed.

Andrew Fedoniouk.
http://terrainformatica.com

#10044 From: "cengman7" <cengman7@...>
Date: Thu Sep 30, 2004 6:27 pm
Subject: Dear Igor and Kim - Please Help With My Com Problem
cengman7
Send Email Send Email
 
I have a somewhat unusual situation. I'm using CxWindow in an app
that hosts a number of custom controls. These controls are designed
to have a common subset of events, and the app I'm working on
(several share these controls) only cares about the subset. The
control also uses a common set of methods.

What I'd like to do is define an abstract interface such as
ICommonCtrl with the common events defined and use that interface
as the definition to sink the events. Unfortunately, when one of the
controls fires an event, I get the following error in the output
window.

  ERROR : Unable to load Typelibrary. (HRESULT = 0x8002801d)
  Verify TypelibID and major version specified with
  IDispatchImpl, CXXXPropImpl, IProvideClassInfoImpl or
  IProvideCLassInfo2Impl

Any clues as to how I can define my sink and set up the advise so
that my sink handles events from one or more controls sharing the
same interface definition?

Any thoughts or suggestions are greatly appreciated.

#10045 From: "cengman7" <cengman7@...>
Date: Thu Sep 30, 2004 6:28 pm
Subject: Re: I need a hint...(Please) :)
cengman7
Send Email Send Email
 
Thank you Roger.


--- In wtl@yahoogroups.com, "Roger Headrick" <lilsroro@y...> wrote:
> --- In wtl@yahoogroups.com, "cengman7" <cengman7@y...> wrote:
>
>
> If you post a COM question that doesn't get a fairly quick reply,
> you might try reposting it using a subject like:
>
> Dear Igor and Kim - Please Help With My Com Problem
>
> -Roger

#10046 From: "Igor Tandetnik" <itandetnik@...>
Date: Thu Sep 30, 2004 6:38 pm
Subject: Re: Dear Igor and Kim - Please Help With My Com Problem
itandetnik
Send Email Send Email
 
"cengman7" <cengman7@...> wrote in
message news:cjhj6f+cp07@eGroups.com
> I have a somewhat unusual situation. I'm using CxWindow in an app
> that hosts a number of custom controls. These controls are designed
> to have a common subset of events, and the app I'm working on
> (several share these controls) only cares about the subset. The
> control also uses a common set of methods.
>
> What I'd like to do is define an abstract interface such as
> ICommonCtrl with the common events defined and use that interface
> as the definition to sink the events.

What kind of interface is ICommonCtrl? Is it a COM interface, or just a
class with pure virtual methods? If it is a COM interface, is it a
custom, dual, or dispinterface? If it is a dual or dispinterface, do you
have its IDL description and have you compiled a type library from that
description.

How do you attempt to sink events from this interface?

I don't see any need for you to use COM here. It looks like you are
trying to use IDispEventImpl or something. Don't. Just define a regular
C++ interface (a class with no data members and all function members
being pure virtual). A control would take a pointer to this class and
store it somewhere. A container would implement it, simply by deriving
from it and implementing its methods. Then the container passes its
implementation to the control, thus establishing a connection.
--
With best wishes,
     Igor Tandetnik

"On two occasions, I have been asked [by members of Parliament], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able to rightly apprehend the kind of
confusion of ideas that could provoke such a question." -- Charles
Babbage

#10047 From: "Jeff Henkels" <jeff-wtl@...>
Date: Thu Sep 30, 2004 6:49 pm
Subject: Re: error solution
jhenkels
Send Email Send Email
 
You're right, Igor -- I didn't see the #endif on line 6888 closing the #if
_WIN32_WINNT >= 0x0501.

"Igor Tandetnik" <itandetnik@...> wrote in message
news:cjhbc8$utc$1@....
> "Jeff Henkels" <jeff-wtl@...> wrote
> in message news:cjgs1v$eb4$1@...
>> In my copy of <winbase.h> from the Feb 2003 Platform SDK, in which
>> FindFirstFileEx is defined, the definition is wrapped in #if
>> _WIN32_WINNT >= 0x0501.  So redefine _WIN32_WINNT appropriately, and
>> you should be OK.
>
> I have the same version of Platform SDK installed, but in my copy
> FindFirstFileEx is defined under
>
> #if(_WIN32_WINNT >= 0x0400)
>
> The directive is at line 6890
> --
> With best wishes,
>    Igor Tandetnik
>
> "On two occasions, I have been asked [by members of Parliament], 'Pray,
> Mr. Babbage, if you put into the machine wrong figures, will the right
> answers come out?' I am not able to rightly apprehend the kind of
> confusion of ideas that could provoke such a question." -- Charles
> Babbage
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>

#10048 From: "cengman7" <cengman7@...>
Date: Thu Sep 30, 2004 6:59 pm
Subject: Re: Dear Igor and Kim - Please Help With My Com Problem
cengman7
Send Email Send Email
 
--- In wtl@yahoogroups.com, "Igor Tandetnik" <itandetnik@m...> wrote:
> "cengman7" <cengman7@y...> wrote in
> message news:cjhj6f+cp07@e...
>
> What kind of interface is ICommonCtrl? Is it a COM interface, or
just a
> class with pure virtual methods? If it is a COM interface, is it a
> custom, dual, or dispinterface? If it is a dual or dispinterface,
do you
> have its IDL description and have you compiled a type library from
that
> description.
>
> How do you attempt to sink events from this interface?
>
> I don't see any need for you to use COM here. It looks like you are
> trying to use IDispEventImpl or something. Don't. Just define a
regular
> C++ interface (a class with no data members and all function members
> being pure virtual). A control would take a pointer to this class
and
> store it somewhere. A container would implement it, simply by
deriving
> from it and implementing its methods. Then the container passes its
> implementation to the control, thus establishing a connection.
> --
> With best wishes,
>     Igor Tandetnik
>
> "On two occasions, I have been asked [by members of
Parliament], 'Pray,
> Mr. Babbage, if you put into the machine wrong figures, will the
right
> answers come out?' I am not able to rightly apprehend the kind of
> confusion of ideas that could provoke such a question." -- Charles
> Babbage


I'm sorry I wasn't more clear.  The controls are ATL controls that I
cannot alter.  I created an IDL and defined ICommonCtrl with the
common events and methods of the controls and tried to #import the
tlb file and use it accordingly. I can instantiate any of the
controls generically using CreateControl, but I can't seem to sink
them generically.

Does this help?

Thanks in Advance!

#10049 From: "Todd Bandrowsky" <tbandrow@...>
Date: Thu Sep 30, 2004 7:00 pm
Subject: Re: Re: Re: Why wtl? Why not .Net/C#
tbandrowsky
Send Email Send Email
 
Garbage collection is no magic bullet.  You can do plenty of dumb
things like the hashtable that always grows, using DataSets too much
(if at all).  On a server side, even with C#, you still have to
forcibly close or dispose of things like file handles or database
connections.

If performance is your object, and you are willing to pay the price,
you can architect to minimize dynamic memory allocation or at least the
need to free it.  It's so easy to use your own Heaps and then you can
allocate bunches of little things, and free them all in one shot with
one HeapDestroy.   You can do the same kind of thing with VirtualAlloc
and a bit more work.  I have it half in my head to build a language
runtime that frees everything after every windows message, and leaves
the rest in a database like repository where you -have- to explicitly
delete. This would be ideally suited for video game work, because the
allocator would just keep doling out objects almost in a stacklike
fashion - no need for searching through the heap, and without a need
for mark and sweep and you still would get free garbage collection. It
would be really fast for video games and other performance critical
applications.

C++ native code versus the .NET runtime and C# is always a function of
cost versus benefit.  .NET's appeal is that it makes it less expensive
to do certain things, but if those aren't things you really need in
your architecture, then, you can certainly use something else.

.NET is a great architecture and a great class library, but having been
through one too many of, "oh lets adopt this or that vision", only to
see it backtrack or fork, or the thing that was obsolete supposedly
actually never die.  I mean, I still remember reading about NT 3.51
made Unix obsolete, and I'm sure the Penguinistas would take great
exception to that!

> Server software generally needs to run 24/7 garbage collected
software is
> easier to write for this scenario, as 1 small leak in conventional
> programming will add up over time and cause degradation/crashes.
>
> Gordon
>
> "Adelle L. Hartley" <adelle@...> wrote
> in message news:E1CCtTI-00025X-00@....
> > Hi,
> >
> > Andrew Fedoniouk wrote:
> > > E.g. garbage collectible systems way better on server side
> > > than reference
> > > counted ones.
> >
> > Why?
> >
> > Adelle.
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor --------------------~--
>
> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
> Now with Pop-Up Blocker. Get it for free!
> http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
> --------------------------------------------------------------------~-
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>

--
tj bandrowsky
tbandrow@...
www.mightyware.com

#10050 From: "Igor Tandetnik" <itandetnik@...>
Date: Thu Sep 30, 2004 7:53 pm
Subject: Re: Dear Igor and Kim - Please Help With My Com Problem
itandetnik
Send Email Send Email
 
"cengman7" <cengman7@...> wrote in
message news:cjhl1r+fnl1@eGroups.com
> I'm sorry I wasn't more clear.  The controls are ATL controls that I
> cannot alter.

Then what do you mean you want to _define_ an event interface? If you
can't alter the controls, how are you going to get them to use your
interface?

> I created an IDL and defined ICommonCtrl with the
> common events and methods of the controls and tried to #import the
> tlb file and use it accordingly. I can instantiate any of the
> controls generically using CreateControl, but I can't seem to sink
> them generically.

So you are saying you have defined your own dispinterface that matches
the common subset of all the source interfaces of all the controls. The
match must be both in signature and in the DISPID. Now you want to code
a sink that implements this interface, and use it to sink common events
from all the controls. Did I understand you correctly?

This is theoretically possible, but not trivial. Your immediate problem
is that you are apparently trying to use IDispEventImpl. This class
requires a type library to be registered - that's why it takes a LIBID
as one of the template parameters, and that's why it cannot load your
type library (you apparently have never registered it). However, you can
work around this requirement using techniques described here:

http://groups.google.com/groups?threadm=OadH12ipEHA.1296%40TK2MSFTNGP12.phx.gbl

Alternatively, you can IDispEventSimpleImpl. This class does not require
a type library nor an IDL description of the interface. Instead, you
will have to describe each event in _ATL_FUNC_INFO structure.

Your second problem is as follows. When you try to sink events from a
control with a particular outgoing interface, with a specific DIID, this
control expects your sink to succeed a QueryInterface call for this
DIID. Otherwise, Advise call fails. IDispEvent[Simple]Impl has a
hardwired implementation of QueryInterface that succeeds for IUnknown,
IDispatch and a single DIID passed in as a template parameter.
IDispEventImpl also uses the same DIID to look up the interface in the
type library, so you can't just fake it (but you can in
IDispEventSimpleImpl).

Assuming you go IDispEventImpl and type library route, you will need
something like this:

class CMySink :
     public IDispEventImpl<1, CMySink, &DIID_YourInterface,
&LIBID_YourLib, 1, 0>
{
     typedef IDispEventImpl<1, CMySink, &DIID_YourInterface,
&LIBID_YourLib, 1, 0> BaseClass;
     IID m_sourceIID;
public:
     void SetSourceIID(REFIID sourceIID) {m_sourceIID = sourceIID;}

     STDMETHODIMP _LocDEQueryInterface(REFIID riid, void ** ppvObject)
     {
         if (InlineIsEqualGUID(riid, m_sourceIID) && ppvObject)
         {
             AddRef();
             *ppvObject = this;
             return S_OK;
         }
         return BaseClass::_LocDEQueryInterface(riid, ppvObject)
     }

     BEGIN_SINK_MAP(CMySink)
         // Usual sink map entries here
     END_SINK_MAP()

     // Event handlers here
};


To use this class, you will need some way to figure out the DIID of the
outgoing interface of a particular control, at run-time. This is not an
easy problem, unless you are lucky and the control implements
IProvideClassInfo2, in which case you just call
IProvideClassInfo2::GetGUID
--
With best wishes,
     Igor Tandetnik

"On two occasions, I have been asked [by members of Parliament], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able to rightly apprehend the kind of
confusion of ideas that could provoke such a question." -- Charles
Babbage

#10051 From: "qwertyqaa" <maskofzero@...>
Date: Thu Sep 30, 2004 11:42 pm
Subject: Re: Whidbey atl-less environment
qwertyqaa
Send Email Send Email
 
well, it does make sense it is part of the sdk. since you
are the creator of wtl can you outline what are the steps needed
to get something like a replacement (based on a define) going?

I mean, are there interface dependencies you can think of?
Otherwise it should really mean nothing more than a renamed,
parallel family of classes.

I propose we call it ATRL (Atl replacement library).



--- In wtl@yahoogroups.com, "Igor Tandetnik" <itandetnik@m...> wrote:
> "qwertyqaa" <maskofzero@h...> wrote
> in message news:cjgbe4+9ejd@e...
> > And BTW, its kind of suspicious that MSSDK download
> > has ATL for win64 but not win32, else i wouldnt have bothered to
> > even start this thread...
>
> This was a temporary stop-gap measure. ATL shipped with VC would
not
> compile with 64-bit compilers, and 64-bit compiler apparently is
(or
> was) owned by SDK team, so they ported ATL3 to 64-bit and included
it in
> the SDK.
>
> ATL version eventually shipped with Whidbey will work with 64-bit
> compiler, so when Whidbey officially ships, ATL will be pulled from
> Platform SDK.
> --
> With best wishes,
>     Igor Tandetnik
>
> "On two occasions, I have been asked [by members of
Parliament], 'Pray,
> Mr. Babbage, if you put into the machine wrong figures, will the
right
> answers come out?' I am not able to rightly apprehend the kind of
> confusion of ideas that could provoke such a question." -- Charles
> Babbage

#10052 From: "johndiiix" <wtllist@...>
Date: Fri Oct 1, 2004 12:40 am
Subject: Re: Whidbey atl-less environment
johndiiix
Send Email Send Email
 
Just to clarify, Nenad Stefanovic is the creator of WTL.  Igor is one
of the developers on the SourceForge project (as am I).

John

--- In wtl@yahoogroups.com, "qwertyqaa" <maskofzero@h...> wrote:
> well, it does make sense it is part of the sdk. since you
> are the creator of wtl can you outline what are the steps needed
> to get something like a replacement (based on a define) going?
>
> I mean, are there interface dependencies you can think of?
> Otherwise it should really mean nothing more than a renamed,
> parallel family of classes.
>
> I propose we call it ATRL (Atl replacement library).
>
>
>
> --- In wtl@yahoogroups.com, "Igor Tandetnik" <itandetnik@m...> wrote:
> > "qwertyqaa" <maskofzero@h...> wrote
> > in message news:cjgbe4+9ejd@e...
> > > And BTW, its kind of suspicious that MSSDK download
> > > has ATL for win64 but not win32, else i wouldnt have bothered to
> > > even start this thread...
> >
> > This was a temporary stop-gap measure. ATL shipped with VC would
> not
> > compile with 64-bit compilers, and 64-bit compiler apparently is
> (or
> > was) owned by SDK team, so they ported ATL3 to 64-bit and included
> it in
> > the SDK.
> >
> > ATL version eventually shipped with Whidbey will work with 64-bit
> > compiler, so when Whidbey officially ships, ATL will be pulled from
> > Platform SDK.
> > --
> > With best wishes,
> >     Igor Tandetnik
> >
> > "On two occasions, I have been asked [by members of
> Parliament], 'Pray,
> > Mr. Babbage, if you put into the machine wrong figures, will the
> right
> > answers come out?' I am not able to rightly apprehend the kind of
> > confusion of ideas that could provoke such a question." -- Charles
> > Babbage

#10053 From: Baryon Lee <baryon@...>
Date: Fri Oct 1, 2004 2:20 am
Subject: context menu on SplitterWindow
baryonlee
Send Email Send Email
 
I have a splitter view with CSplitterWindow.LeftView and RightView was
created like

m_wndSplitter.Create (m_hWnd, ... ...);
m_viewLeft.Create(m_wndSplitter, ......);
m_wndSplitter.SetSplitterPane(SPLIT_PANE_LEFT, m_viewLeft);
m_viewRight.Create(m_wndSplitter, ... ...);
m_wndSplitter.SetSplitterPane(SPLIT_PANE_RIGHT, m_viewRight);
m_hWndClient = m_wndSplitter;

I want show different context menu when click right button.
So, I do it like
... ...
MSG_WM_CONTEXTMENU(OnContextMenu)
  ... ...
void OnContextMenu(CWindow wnd, CPoint point)
{
if(wnd.m_hWnd == m_viewLeft.m_hWnd)
{
  //TrackPopupMenu menuPopupLeft here
}
if(wnd.m_hWnd == m_viewRight.m_hWnd)
{
  //TrackPopupMenu menuPopupRigt here
}
else
{
SetMsgHandled(FALSE);
}
}

BUT, it don't work.

wnd.m_hWnd is the handle of m_wndSplitter.
Any Idea?

Thanks in advance

#10054 From: Baryon Lee <baryon@...>
Date: Fri Oct 1, 2004 6:43 am
Subject: Re: context menu on SplitterWindow
baryonlee
Send Email Send Email
 
I have good idea without changing view.
I add some code in LeftView and RightView.
Now it works fine, but I wonder if this is the right way to do it?

	 BOOL PtInClientRect(const CPoint& p) const
	 {
		 CRect rc;
		 GetClientRect(&rc);
		 ClientToScreen(&rc);
		 return rc.PtInRect(p);
	 }

	 void OnContextMenu(CWindow wnd, CPoint point)
	 {

		 if(PtInClientRect(point))
		 {
			 SendMessage(GetTopLevelParent(), WM_CONTEXTMENU, (WPARAM)m_hWnd,
MAKELPARAM(point.x,point.y));
		 }
		 else
		 {
			 SetMsgHandled(FALSE);
		 }
	 }

Messages 10025 - 10054 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