|
Hi All,
I want to implement an Interface only (no class backing it) in an ATL Dll. It will be similar to ISupportErrorInfo, but without an implementation. In pure C++, this would be a pure virtual base class. This is sometimes loosely called 'the contract'. In my library, I would then like my objects to derive from it:
class ATL_NO_VTABLE CWidget :
public CComObjectRootEx<CComSingleThreadModel>,
...
public IMyPureVirtualBase,
public IDispatchImpl<IWidget, &IID_IWidget, &LIBID_WidgetLibrary>
{
...
BEGIN_COM_MAP(CWidget)
...
COM_INTERFACE_ENTRY(IMyPureVirtualBase)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
};
How do I add this through Visual Studio? I can add a simple object, but it seems to get an implementation.
Jeff
|
|
|
|
|
I assume you mean a COM interface. A COM interface -- from a C++ perspective -- is just an abstract class with certain restrictions (for example, only virtual methods, no destructor, etc). Obviously other languages can not consume a C++ class however. Normally you describe the interface in an IDL file and use MIDL to create a type library from it. Languages that support COM can consume type libraries and MIDL will create an abstract class that can be consumed by C++ (or you can use #import to use the type library).
Steve
|
|
|
|
|
Add a class with the wizard and delete whatever method implementations you don't want.
|
|
|
|
|
How to create toolbars on ie and how to add tooltips for buttons using ATL
RAMU
|
|
|
|
|
|
I find that in ATL, the macro BEGIN_MSG_MAP(theClass) is defined this way:
#define BEGIN_MSG_MAP(theClass) \<br />
public: \<br />
BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID = 0) \<br />
{ \<br />
BOOL bHandled = TRUE; \<br />
hWnd; \<br />
uMsg; \<br />
wParam; \<br />
lParam; \<br />
lResult; \<br />
bHandled; \<br />
switch(dwMsgMapID) \<br />
{ \<br />
case 0:
Interestingly, theClass is not used anywhere, then what's the use of theClass here?
Thanks.
|
|
|
|
|
|
Probably either a) consistency with MFC map macros, or b) in case it's needed in the future?
|
|
|
|
|
It's probably for compatibility with MFC
Steve S
Developer for hire
|
|
|
|
|
Wrong forum. Please try VC++ forum to get quicker answer to this.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hey All,
A very happy new year to you all. I am working on GoF design patterns. I want to know if it is feasible or possible to make a library like STL for design patterns using .net Generics? If there are some existing projects like this can someone please send me links to it?
thanks
RB
|
|
|
|
|
I'm not clear what you are asking. What have GoF design patterns got to do with generics? Or are you asking whether there is something similar to STL (i.e., algorithms and containers) but for .NET generics?
Kevin
|
|
|
|
|
Hi All,
I need to learn about ATL from the basic.Anyone can tell me the good tutorial for ATL.
Thankx in advance..
|
|
|
|
|
This[^] yielded a lot of hits...
|
|
|
|
|
ab_wahab wrote: ttp://rapidshare.de/files/14816390/Wordware_.Developers.Workshop.to.COM.and.ATL.3.0._2000_.LiB.rar.html
you can be in deep trouble dude!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
VC6.0 IDE has message-map Wizard to help us add ATL-style Message handle Macros .Like "MESSAGE_HANDLER()" etc .
Is there any tool to help me add WTL-style Macros likes "MSG_WM_CREATE()" ?
(my current WTL version in use is WTL 7.0 under VC6.0)
thanks !
|
|
|
|
|
There's a plugin here at CP called WTL Helper, but IIRC it's only for VC7. I don't know of anything for VC6, but I haven't looked that much either. I've memorized the most common MSG_WM_* macros by now.
|
|
|
|
|
Michael Dunn wrote: I've memorized the most common MSG_WM_* macros by now
LOL
|
|
|
|
|
how to upload 1gb data through mail in code behind using .net using C#
|
|
|
|
|
Hi Kalyankasula,
PJ Naughter has a SMTP mailer class on the site. Others have similar code.
I'm not aware of any mail server that will accept an email message that large. From my networking experience, a moderate limit is placed on the size of incoming messages. For example Exchange 2000 and 2003. An administrator must specifically raise the limit.
Just in case this is for an email bomb, you'll have to look the limits up yourself.
Jeff
|
|
|
|
|
what is the difference btn callback() and Ispostback()
|
|
|
|
|
Wrong forum.
|
|
|
|
|
Hi again,
I discovered a new problem and I have to share this with you as I can't solve this on my own...
My Browser Helper Object creates a window (inherits from CDialogImpl). I've managed to position this window in the lower right corner of Internet Explorer but the problem is that whenever the user resizes or moves Internet Explorer, my window stays put. I would like to move my little window as the parent window (IE) moves.
How can my window react upon move/resize messages from the parent window (IE)?
BTW: My window steals the focus once it's displayed, how can I give the focus back to IE?
All help is grea... well, you know I love you guys!
/T
|
|
|
|
|
Tommy Svensson wrote: BTW: My window steals the focus once it's displayed, how can I give the focus back to IE?
I can answer this part of your qestion.
Get handle to browser, as stated in last reply. And use SendMessage.
i.e.
SendMessage(hWnd,WM_SETFOCUS,0,0);
|
|
|
|
|
Thx Prasad, the latter part now solved! Thx.
Still, this question remains unanswered:
My Browser Helper Object creates a window (inherits from CDialogImpl). I've managed to position this window in the lower right corner of Internet Explorer but the problem is that whenever the user resizes or moves Internet Explorer, my window stays put. I would like to move my little window as the parent window (IE) moves.
How can my window react upon move/resize messages from the parent window (IE)?
/Tommy
|
|
|
|