|
Thanks for your reply, I'll try it later.
Thank you.
|
|
|
|
|
I've created a Connection Page (in the Data Source Object of my OLE DB Provider) to be displayed by the Data Link core component.
Now I'm trying to add a tab control on the page using CreateWindow with the WC_TABCONTROL class (being registered through InitCommonControlsEx(...).
But I can't get the Instance Handle needed by CreateWindow,
because
hInst = (HINSTANCE)::GetWindowLong(hwndParent, GWL_HINSTANCE);
always returns 0x0000000.
(I've received the hwndParent through the IPropertyPage::Activate Method, that's being called by the Data Link core component)
How can I get that Instance Handle? Or is there another way of using a tab control on my property page?
|
|
|
|
|
Hi All,
I have a COM component which supports outgoing interface IDataCallback,which calls OnDataChange event.
When client Get Connectionpoints and Call Advise for Server,i want to fire OnDataChange.Where should i Know that Client has called Advise so that i should send him OnDataChange callback,just to show that callback is working.
In normal working i am sending OnDataChange whenever data Changes in my server,but i want to send this first OnDataChange as soon as Client call Advise.
Where should i write the code for this?
Code for my server is like this:
class MyServer;
typedef IConnectionPointImpl <myserver,&iid_idatacallback,ccomdynamicunkarray> DataCallback;
class ATL_NO_VTABLE MyServer :
public IInterface1,
public IInterface2,
public IConnectionPointContainerImpl<myserver>,
public DataCallback,
public CComObjectRootEx<ccommultithreadmodel>
{
---
}
Thanks in advance
Tushar.
|
|
|
|
|
Because you're deriving from IConnectionPointContainerImpl, then it's doing all the hard work for you.
You might be able to provide your own implementation of Advise, but you'd need to make sure you called the templated implementation first, then fired the event (if successful). Don't know whether (a) this is possible or (b) it's allowed, since you're effectively firing an event before Advise has completed, so I don't know if there's COM runtime magic involved.
Steve S
|
|
|
|
|
Hi, i need an ADDin for Word 2000 ( XP and 2003 too) that has an dialog box
like a ATL Composite Control ( VC 7.1).
The problem is when this control is inserted in the Word (insert object) and lost focus,the dialog disapear (seems like the WM_PAINT don´t be triggered).
The control draws it self only when i "double click" the control.
I read some articles that this behavior is because the Word Container
don´t give us an Window to draw when the control is without the focus.
In VB, the control don´t disapear only in the Word.
Can anyone help me ?
thanks
|
|
|
|
|
Is there a way to save the web page contents to an image. Just the contents, no toolbar, no status bar. In other words print web page to image file??
Thanks a lot.
|
|
|
|
|
Hi everybody
I have written an ATL 3.0 project including two sample classes named CAttachment & CAttachments. These classes have interfaces IAttachment & IAttachments in order. IAttachments has got a method named "Item" that returns a result of the type of IAttachment. But before returning the IAttachment, I want to call some member functions of the CAttachment class to setup the IAttachment properly. I know how to create the IAttachment interface, but I don't know how to have access to the members of the CAttachment from the "Item" method. I will be thankful if anybody replies to me.
Regards,
Roozbeh.
|
|
|
|
|
CAttachement *pAttach;
IAttachment pIAttach;
pAttach = (CAttachement*) pIAttach;
pAttach can now call the class members of the its class.
This space is empty.
|
|
|
|
|
*bzzt* Wrong way. This should never ever be done. You can never be certain what pIAttach points to. Any COM book will tell you this at least a dussin times.
A better way to gain access to members of CAttachment is to use CComObject<CAttachement> instead.
CComObject<CAttachement>* pObj;
HRESULT hr = CComObject<CAttachement>::CreateInstance(&pObj);
pObj->AddRef();
pObj->member = value;
pObj->InterfaceMethod();
IAttachment* pAtt = pObj;
--
Unser Tanz ist so wild! Ein neuer böser Tanz.
Alle gegen Alle!
|
|
|
|
|
yeah correct.
Code Review Correction.
if(pObList == NULL)
{
pObList = NULL;
delete pObList;
}
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Surely not.
if (pObList != NULL)
{
delete pObList;
pObList = NULL;
}
unless, of course, you've worked where I'm working at the moment, where apparently that would be an acceptable style of coding.
Steve S
|
|
|
|
|
Steve S wrote:
Surely not.
sure i aggree with you, it was the code review correction that i gave to my coworker (its a mistake that i asked him to correct it)
but for some reason, that piece code works perfectly, coz deleteing null pointer is ignored.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Indeed
However, unless somewhere there is a corresponding delete for non-null pointers, I suspect you might have at the very least some diagnostics about leaks when running under the debugger.
Steve S
|
|
|
|
|
Steve S wrote:
unless somewhere there is a corresponding delete for non-null pointers
no this is was the only delete for that object in the dtor. Yes there was a memory leak in this case and other places.
I just placed it in my sig to show that how stupid anyone can get to write that kinda of code.
But then i removed it coz i thought it was not rite to make a joke of others programming pratice.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Hi, I've an ATL activeX control that is a dialog with some windows. When it's hosted in IE there are resizing problems (it has resizing border) when IE isn't maximized. The dialog will not draw outside its original size, even though the border seems to drag out to a much larger size (the controls and dialog size, but are clipped to the original width and height). This doesn't happen when IE is maximized, as the dialog and controls are drawn to new sizes/positions.
I've no idea of the cause, is it a bug in IE or just a special case I need to account for in the code?
Thanks in advance.
Brian.
|
|
|
|
|
in a BHO, if the user clicks on any word how can i know which word user clicked on
there is a function elementFromPoint but that will give the whole Element i want the specific text
how does IE know that the stuff under the mouse is Text cause the mouse pointer changes to a carat when the mouse moves over text on a HTML page
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
mailMonty wrote:
how does IE know that the stuff under the mouse is Text
IE..err God knows everything.
|
|
|
|
|
In OnClick Event Write this :
CComPtr<IHTMLTxtRange> spHTMLTxtRange;
m_pHTMLBody->createTextRange(&spHTMLTxtRange);
spHTMLTxtRange->collapse(VARIANT_TRUE);
long x,y;
pEvent->get_clientX(&x);
pEvent->get_clientY(&y);
spHTMLTxtRange->moveToPoint(x,y);
spHTMLTxtRange->expand(CComBSTR("word"),&vtBool);
spHTMLTxtRange->get_text(&bstrText);
//bstrText now contains the Word which user clicked
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Nice!!!
good to see that you posted the solution when you got it, ppl usally forget about it.
This space is empty.
|
|
|
|
|
i have an full control ImageControl.
i have a composite control imageDisplay.
i want to put imagecontrol into imagedisplay. that's fine.
but when i want to invoke a method in imageControl, i can't. not even to compile. i am using code i found in txts and websites:
CComPtr<iimagecontrol> pImg;
GetDlgControl(IDC_IMAGECONTROL, IID_IImageControl, reinterpret_cast<void**> (&pImg));
error: IImageControl unknown identifier.
must i import something? when i inserted the ImageControl, a h.file and cpp.file is added to the project. but neither defines the interface of imagecontrol.
must both source codes be in the same project to work?
help....
|
|
|
|
|
Hello,
I’m looking for a way to display the SysTreeView32 control in a WTL application. Is there an easy way to do this or is there a custom WTL control that can be used? Should I resign to my fate and implementing my own?
If I have to implement my own, what are your recommendations? IShellFolder interface?
Thanks in advance,
-mass
---
PAGE FAULT: Please insert "Swap File Disk 2" in drive and press any key to continue
|
|
|
|
|
There is the excellent http://www.codeproject.com/shell/explorer.asp article by leon Finker (WTL), I think it just lack notification. Also an ATL Tree activeX http://www.codeproject.com/atl/shellfoldertree.asp by Nick Hodapp.
These are the 2 I prefer and both WTL compatible.
Yarp
http://www.senosoft.com/
|
|
|
|
|
Thank you very much
---
PAGE FAULT: Please insert "Swap File Disk 2" in drive and press any key to continue
|
|
|
|
|
I'm just getting into atl but do not think I have all the header files, notably :
atltypes.h
is missing.
I have spent they day downloading various microsoft updates and SDKs but still have not found this file.
any hints?
jema
|
|
|
|
|
I think this is a VC.NET only file. If you're using ATL3.0/3.1 from VC6, you won't have this file, and as far as I know, the only legal way to get it is to buy and install a copy of VC.NET
Steve S
|
|
|
|