|
try to include _i.c and .h files
I want to change Myself..Can u help me?
|
|
|
|
|
I've resolved the problem.
it was Init_guid.h havent been included.
|
|
|
|
|
I've read the docs and a few online examples of how to implement the ISAXContentHandler interface. Simple enough.
In my "stdafx.h" file, I make sure to add the following two lines.
import <msxml4.dll>
using namespace MSXML2;
Cool, I then created a class derived from ISAXContentHandler, call it ContentHandlerBase. I implemnted each of the ISAXContentHandler methods such that they all return S_OK. Then, I created a class that derived from ContentHandlerBase, call it ContentHandlerImpl. In this class I only implemented one method, say ISAXContentHandler::startElement for example.
As soon as I tried to instantiate this class via ContentHandlerImpl* chi = new ContentHandlerImpl(), I got "Cannot Instantiate Abstract Class" along with a whole bunch of ...
HRESULT MSXML2::ISAXContentHandler::raw_ignorableWhitespace(unsigned short *,int)' : pure virtual function was not defined
for example, for each of the ISAXContentHandler methods even though they HAVE been implemented in the base class.
I don't get, it. I downloaded an online sample and it compiled fine. Laboriously poring over the differences between my code and the sample code has proved fruitless as I can't see anything I did wrong
Anybody have any clues as to what might be the problem?
Thanks.
Senkwe
Woke up this morning...and got myself a blog
|
|
|
|
|
Try to use "raw_interfaces_only" attibute in import statement or rename methods in your implementation class ("raw_XXX").
Edward
|
|
|
|
|
Hi, thanksk alot for the response Unfortunately, your suggestion doesn't seem to work. I've already tried including "raw_interfaces_only", didn't work I'm afraid. I've just now tried your "raw_XXX" suggestion and I still got the same compile error.
Thanks again for the suggestions though
Woke up this morning...and got myself a blog
|
|
|
|
|
That's strange.
What's in *.tlh/*.tli files ?
Your derived classes should match interfaces in the *.tlh files.
Also try to remove all tlh and tli files and rebuild all.
Edward
|
|
|
|
|
Hi Edward. Thanks for the reply again. I took a peek at the projects *.tlh file and my eyes glazed over so I deleted it and rebuilt all. Same thing happened. Looks like I'm going to have to dig into the file and look for anything odd. Thanks for your help I'll post this problem to another newsgroup as I'm sure someone must have experienced this before.
Woke up this morning...and got myself a blog
|
|
|
|
|
Hi
I realize this utterly frequent qustion here, but once again
i had com object and wont to inject this one to my application.This object had events and i want use this too.
I create smart pointers for object by import derective.And
how i can implement events in easyest way???Use MFC or other generic class (not ATL).Any pointers will appreciated
Thanks.
|
|
|
|
|
How to refresh the tree view of the namespace extension on addition or deletion of a node at runtime
|
|
|
|
|
Use SHChangeNotify()
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
I came across some MFC sample code recently that uses DirectShow to render MPEG files in a static control.
The sample code creates a number of DirectShow interface pointers in the main dialog (eg. IGraphBuilder, IMediaSeeking, IMediaControl etc) and then calls methods on these interfaces from a worker thread.
My question is, shouldn't these interface pointers all be marshalled to the worker thread using something like CoMarshalInterThreadInterfaceInStream()? I didn't think that pointers to COM interfaces could be shared amongst threads unless they were marshalled, or is DirectX different?
Note: The calls to the DirectShow interfaces from the worker thread seem to work perfectly fine.
Regards
Martin
|
|
|
|
|
In theory, the interface pointers should be marshalled if the thread is in a separate apartment to the main thread i.e. CoInitialize() has been called in the worker thread. However, if the main thread is a MTA, the worker thread will "share" the apartment and marshalling isn't explicitly necessary (generally, the "server" will AddRef() the interface before passing it on). The reason it currently works is most likely because the code is relatively simple and there is no contention over releasing/unmarshalling of interfaces between the main and worker threads. The marshalling mechanism becomes much more important when interfaces are passed over process boundaries.
|
|
|
|
|
You are right, the interface pointers must be marshalled when passed between apartments.
But MS doesn't always follow it's own rule. DirectX objects mostly use registered as "both" (which mean that whatever apartment you created them in, no proxy will be created), so it shouldn't cause any problem to pass the interfaces like that.
But unfortunately they will do the same (I believe that was a IGraphBuilder in DX 8.0 that I noticed was doing this) with the callback interfaces, i.e. if you created DX object and your callback object in the STA and pass the callback interface to DX object, the methods of your object might be called from any thread. (btw, I observed this with some shell interfaces as well)
Edward
|
|
|
|
|
Hi there.I read the article named Make the Internet Your Office with NetMeeting by Suresh G. Nair .But I am not familiar with ATL.I dont kown how to develop the ActiveX® Template Library (ATL)-based NetMeeting wrapper,and how to use the code offered by Nair in this article. can anybody help me?
|
|
|
|
|
I have a COM object I wrote in VC6 C++ a couple of years aago - I want to rename it and use it another project - how do I do that? No matter how much I change the name in the source files the old name still exists.
If it is called foo and I want it to become bar I have changed all references to foo I can find in the source files to bar yet when I come to reference it it is called foolib - is there a utility to rename a project?
Rugby League: The Greatest Game Of All.
|
|
|
|
|
In this context, does "all source files" include (a) the IDL/ODL file and any associated .REG or RGS files?
Steve S
|
|
|
|
|
I believe so - I have done a search on all the files looking for the name to rename.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Delete the old object and clean your registry. Make sure the .rgs file is correct.
prashu
|
|
|
|
|
Done all that - it just won't go away - It's quicker just to write the thing again from scratch with a different name than it is to attempt to rename it.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Thanks for your help everybody. I have given up on this now - 2 days of trying and got nowhere - changed every name, replaced every UUID, searched every file and yet the original name persists or the thing doesn't work at all. I have decided to spend the next 3 months rewriting it in .NET - hopefully I will never have to touch COM again.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Hi!
I have one question to ask:
If I caught an Appointment window by means of InspectorEvents & ConnectionPoints and created a popup button in the Actions menu,
how do I make the button respond to my sink event?
Thanks!
|
|
|
|
|
Please find the article:
Building an Office2K COM addin with VC++/ATL
By Amit Dey
There is very good example.
================================
Useful links
|
|
|
|
|
All,
Can someone please provide me with the code for the following:
A COM object called Person with a property of Children and a property of Name
A COM Collection of Person elements as the Children property of a Person.
I wish to be able to use the following code in VB.
Dim objP as new Person
objP.Name = "dad"
dim objC as new Person
objC.Name = "child1"
objP.Children.Add objC
for each objC in objP
msgbox objC.Name
objC.Name = "already looped through"
next objC
Apologies, I have looked everywhere and cannot find an example of a read/write collection. I tried the collection wizard(s) supplied on this site, but then none of my creation code works in VB ("cannot create object").
AAGH!
Cheers,
Kieron
|
|
|
|
|
The object objP should implement the property:
[propget, restricted, id(DISPID_NEWENUM)]<br />
HRESULT _NewEnum([out, retval] IUnknown** retval);
The property should return the IUnknown interface of an object implementing IEnumVARIANT . It is the DISPID_NEWENUM + IEnumVARIANT combination that VB/VBS uses to accomplish For Each .
If you are implementing the COM objects in C++ and ATL, you may want to take a look at the MSDN documentation for CComEnumOnSTL , and use that to implement your collection.
--
Din mamma.
|
|
|
|
|
Hi all
I have a com that uses MFC.
When I register the com in a machine with Visual Studio everything is fine. But when I try to register the com in a machine without MFC it shows a error "Not all components could be loaded". Is it because I dont have visual studio installed in the target machine. ?
What files should I deploy with MyCom.dll to make it run everywhere..?
Thanks in advance
Regards
|
|
|
|