|
OK,I found a very simple solution...
template <class t,="" const="" iid*="" piid,="" class="" cdv="CComDynamicUnkArray">
class CAdviSeNotify: public IConnectionPointImpl<t,piid,cdv>
{
public:
typedef IConnectionPointImpl<t,piid,cdv> baseClass;
CAdviSeNotify(){};
virtual ~CAdviSeNotify(){};
STDMETHOD(Advise)(IUnknown* pUnkSink, DWORD* pdwCookie)
{
T* pT = static_cast<t*>(this);
pT->OnClientAdvise(pUnkSink,piid);
return baseClass::Advise(pUnkSink,pdwCookie);
}
STDMETHOD(Unadvise)(DWORD dwCookie)
{
T* pT = static_cast<t*>(this);
return baseClass::Unadvise(dwCookie);
}
};
|
|
|
|
|
I want to debug a COM server (DLL) but inspite of setting all the necessary options the dllhost.exe is loaded for debugging instead of my DLL. Can anyone tell me why is this happeining ?
|
|
|
|
|
Check the Debugging Application book by John Robbins,
chapter 10 Debugging Windows 2000 Services and DLLs
That Load into Services.
Igor
|
|
|
|
|
I want to know (get) ICommandWithParameters implementation code of a oledb data provider.
Where can I get it ??
(I got the some codes
-->(ex) ICommandWithParametersImpl.h file in SimpleDataObject project at this site ; .
but it is very simple.
so I can't refer it.
)
help me.....
|
|
|
|
|
Hi,
How can I use an activeX in a mfc dll ?
I made my MFC Dll, made a Dialog in it added a ActiveX control without problem, but when I want to display the dialog it doesn't open.
How can I set up ole in my mfc dll ?
Thanks for the help
|
|
|
|
|
Hi Developer.
I have two questions.
First...
I want to get scrollbar handle to the Webbrowser.
But i have not any method.
Anybody knows that?.
Second...
I develop webbrowser using CHtmlView.
I want to change cursor in my browser and change the mousemove event.
But It is not correct solution.
Because the cursor is flickering.
Thanks in advance.
dooly
|
|
|
|
|
The New ATL Object menu item was disappeared from my Insert menu. Anyone knows what happened to the ATL Object Wizard and how can I get it back as normal?
Thanks,
Tony
|
|
|
|
|
Select Tools/Customize, then select "Insert" from the "Category" combobox on the "Commands" tab. Drag the icon for the "New ATL Object" command over the "Insert" menu, and drop it into place.
Thats it!
Regards,
Nick Hodapp
|
|
|
|
|
Hi Folks, Does anyone know how to capture no. of clicks on an Image drawn through an IPicture Interface in an ATL Project. Also is it possible to redirect to a website when a user clicks on the Image.
Thx a lot.
Vesel
|
|
|
|
|
HI,
Say I have a MFC application. On InitInstance or InitDialog I want to check if there is any COM server(registered) that belongs to the application.(I don't know any CLSID)Is it possible to do that. If so then I wan't to add an item in the menu for each com server I find.
|
|
|
|
|
Hi,
Information about registered COM objects is stored in the registry. You can try the CLSIDFromProgID function to check if specified ProgID is registered. You can also create an instance of the object and then release it, to be 100% sure that all pieces in place.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hi,
COM object is a binary file, and dll also binary file.
what is difference between them (internally)?
thanks,
koteswara
|
|
|
|
|
Hi,
COM object can be stored in the DLL or EXE file. When a COM object is stored in the DLL the only difference with the usual DLL file, is that the COM DLL must have several COM related methods:
DllGetClassObject
DllRegisterServer
DllUnregisterServer
DllCanUnloadNow
See description of these functions in MSDN for more details...
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hello Everybody
I have written what I think to be a comprehensive, seven-step tutorial which is easy enough for beginners to use, and posted it on The Code Project to help you get started on DCOM programming. It guides you through using and doing:
+ Implementing a DCOM server as a Windows NT Service;
+ using the ATL COM AppWizard;
+ using all of the Visual C++-IDE features like New ATL Object Wizard, Add Method to Interface, etc etc
- implementing Connection Points:
+ Over the network with DCOM
+ On the client side with MFC and ClassWizard (!)
+ MFC and AppWizard and ClassWizard on the client side
Full source code provided for each step of the tutorial, and a full client that reports status is provided with the last step, plus a source code archive and Questions and Answers page.
Check it out! It's as yet an "unedited reader contribution" but I want to invite you to look at it anyway and let me know what you think. Feedback is so very needed on this kind of a project.
The tutorial starts with Step 1. Enjoy!
(NOTE: "Step 1" above is a hyperlink to the tutorial.)
|
|
|
|
|
Hi,
what is exact difference between aggragation and containment.
aggregation is 'has a' relationship between classes.
Inheritence is 'is a' relationship. is it correct?
what about containment?
send me msdn links
thanks,
- Koteswara,
pkoti@staff.juno.com
|
|
|
|
|
Hi,
In C++ you can use inheritance, which is 'kind-of' relationship, or composition, which is 'has-a' relationship. You also can use the private inheritance, which is just a syntactic variant of composition.
Aggregation and containment are related to the COM. Aggregation is exposing a binary sub-object to the client as is using the QueryInterface. Not all classes are aggregatable and you may want to expose only part of the object's functionality, in this case you can use containment.
The best source of information on this topic is the Don Box's book "Essential COM".
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
In simple terms aggregration means that the COM Component has an Internal Interface which is doing all your work though you are talking to front interface which redirects your job to its internal interface. As far as containment is correctly interpreted by me refers to the interface by which COM is exposing the rest of the interface contained inside it.
|
|
|
|
|
I developing a webbrowser using CHtmlView.
But this browser is not repaint properly.
That is, i want to use CView::Invalidate() for browser repaint.
But this function is not work.
Anybody have sample code.
Thanks in advance.
dooly
|
|
|
|
|
To have the view repaint, call CHtmlView::Refresh(). CHtmlView doesn't behave like a normal MFC view because all it does is wrap the WebBrowser control.
|
|
|
|
|
Thank you for your reply.
|
|
|
|
|
You can use CHTMLView::GetHTMLDocument to get the dispatch pointer for the document. Then you can get the window for the document. If you use Spy++, you will see that this has a classname of "Internet Explorer_Server". The following code will get you the handle to the window so that you can call InvalidateRect and UpdateWindow on it.
IOleWindow* pOleWindow = NULL;
HWND hWnd = NULL;
// pDispatch is the IDispatch pointer retrieved from GetHTMLDocument of CHTMLView.
HRESULT hr = pDispatch->QueryInterface(IID_IOleWindow,(LPVOID*)&pOleWindow);
if (SUCCEEDED(hr) && pOleWindow)
{
hr = pOleWindow->GetWindow(&hWnd);
// Ouput the classname to the debugger for verification
if (SUCCEEDED(hr))
{
TCHAR szClassName[256];
GetClassName(hWnd, szClassName, 256);
OutputDebugString(szClassName);
OutputDebugString(TEXT("\n"));
}
pOleWindow->Release();
pOleWindow = NULL;
}
I hope this helps,
-Erik Thompson
|
|
|
|
|
Thank you for your reply.
|
|
|
|
|
Hi,
I successfully crea the .chm file. But i want GUI like MSDN help.
Like two panes, on clicking an item in the left pane should give its contents on
right pane.
Thanks,
- Koteswara
|
|
|
|
|
A GUI comes with Windows which is like MSDN!
|
|
|
|
|
Hi,
I can't figure out how to implement each interface in separate C++ class(not COM object) with ATL.
|
|
|
|