|
real_space_monkey wrote:
//This routine query interface from internal object and add referience number of one
ISomeInterface* pIface = GetSomeIface();
Fire_MyEvent(pIface);
//My question is - "should client release this interface or this my labour?"
pIface->Release();//Do i???
YES, you should, because the pIface is in your ownership.
With best wishes,
Vita
|
|
|
|
|
I am trying to create an ActiveX control to be used within MS Access. I want to bind it in a field within an Access form, like you can do with the objects access provides.
Is this possible?
Does anyone have an idea what interfaces should I implement?
Thanks in advance for any hints.
...Plug & Pray...
|
|
|
|
|
I need to catch and handle the WM_DEVICECHANGE message in my COM dll server. I tried to force one of the class inherit from CWindowImp, but it doesn't work. Any idea? Thanks.
Linn
|
|
|
|
|
Hi all
I use in my COM interafse some method which receive BSTR as parameter ie
HRESULT MyObject::SomeFun(BSTR str)
{
SysFreeString(str);//exception is here
}
And i invoke this method from VB client
As far as is known i should free BSTR what had been created by myself directly with SysFreeString(...)
and in my example i free it in this way.But i had unhandled exception at my VB client during SysFreeString(str)
Thats wrong???
Thanks all
|
|
|
|
|
The object that creates the string should be responsible for freeing it again. In your case, whoever calls SomeFun() will create the string (say by SysAllocString) and will also be responsible for calling SysFreeString on the object they created as a parameter, once the call returns:
BSTR bstrNewString = ::SysAllocString(L"Test");
pIMyObjectPtr->SomeFun(bstrNewString);
::SysFreeString(bstrNewString);
|
|
|
|
|
|
The rules are:
[in] data initialized before passed to method, and is expected to be initialized when the method returns. COM-objects living in the same apartment can modify parameters (i.e. strings) eventhough they're labeled as [in] . It may or may not work - it sure won't work across apartment boundaries.
[out] has no reference to any valid data. If it does, that's just a coincidence - don't rely on it. You, the method callee, are responsible for allocating data to return through this parameter (or nothing/NULL if you're dealing with reference semantics).
[in, out] If you are to update the value of such a parameter, you must first free the passed in value, and allocate a new one for the return. Note that if [in, out] long* param is passed, you don't have to allocate memory, just *param = value; . If you get a [in, out] IInterface** p , then (*p)->Release(); *p = ... .
[edit][out, retval] has the exact semantics as a [out]. Clients such as VB uses the retval attribute only to synthesize a return type for methods.[/edit]
--
Din mamma.
|
|
|
|
|
THAKS ALL
|
|
|
|
|
|
please tell me how can i initialize ITBasicCallControl
interface of tapi3lib.dll component in VC.net using type library
thanx....
babur
|
|
|
|
|
Hi gurus,
I'm working on a ATL plug-in for MS Outlook, but I would like to make it work on Outlook Express as well. I understand that it's not possilble via COM technology (as OE does not expose any COM interfaces ), but something with hooks? Any documentation on the subject?
Any help / hint would be much appreciated.
Thanks in advance,
Doru K.
|
|
|
|
|
There are articles here on codeproject. The guy is Amit Dey.
|
|
|
|
|
Hi,
I only found his article about Outlook add-ins, but Outlook Express is a COMPLETELLY different thing. Maybe there is an article about Outlook Express as well, but I didn't find it...could you send me the link?
Thanks,
Doru
|
|
|
|
|
I recently used the interface that I found in this article
http://www.codeproject.com/useritems/email.asp?target=MAPI[^]
Some of the code is perhaps a bit rusty, and may not be fully implemented, but working with the example code made it easy for me to understand the mechanisms involved, and it was straightforward to sort out any problems and adapt the COM interface for my own needs. I was extremely grateful for the help provided by this article.
|
|
|
|
|
Thank you! I hope this is what I need, although I'm not sure...I would like to add buttons to Outlook Express' toolbars, etc (like I did for MS Outlook).
Thanks again,
Doru K.
|
|
|
|
|
What is the difference between objects and interfaces in COM...?
For instance I use CoCreateInstance to create a COM object: ie IWebBrowser2
Then I use QueryInterface to get other interfaces like...IHTMLDocument2 or IHTMLEditDesign .
Can I create a COM object from IHTMLEditDesign as well or can I only get to IHTMLEditDesign via QueryInterface once an IWebBrowser2 object has been created...?
Thanks
How do I print my voice mail?
|
|
|
|
|
I think you have got a little mixed up with the terminology. CoCreateInstance creates the COM object that supports the IWebBrowser2 interface and returns you an pointer to that interface. COM rules state that once you've obtained an interface from a COM object, you can use that interface pointer to QueryInterface for any other interface supported by that object.
|
|
|
|
|
Hockey wrote:
What is the difference between objects and interfaces in COM...?
Interfaces must always adhere to a binary layout, while objects don't. When developing COM classes in C++, the objects will be laid out just like ordinary C++ objects in memory. In VB - who knows? This is why interfaces are the lingo of COM - it serves as a protocol to communicate with objects.
Interfaces also allow for advanced proxying. If you can wire the vtable so that proxy functions are called instead of the virtual methods, then you can add things like network transparency, apartment marshalling, etc, without having to require too much of a burden of the caller!
So the crude answer to your question would be; an object is a binary blob of data, and an interface is a structured and well formed table of function pointers, which points to functions which know how to manipulate the binary blob of data in a meaningful way. In C++ this distinction is not very obvious.
--
Din mamma.
|
|
|
|
|
My name is Nagarjuna.I am working on an ActiveX control (Not create by me).After registering it the control is not coming under control column in the component dialog box of Visual Basic 6. I checked the afxOleregisterControl(BOOL ) function in UpdateRegistry() function of my Cotrol class.The nRegFlag is properly set.My questions are:
1) In Visual Basic Component Dialog Box. why is that some control are just visible in Insertable column but not in Control column, even when ActiveX component is registered as Control.
2) If we want it in the control column what should we do.
Kindly help me out.
Bugfixer
|
|
|
|
|
Hi,
1) The major difference between the insertable column and the control column is that the control column is for displaying the activex controls while insertable column displays activex controls which supports linking and embedding. For example word, excel, acrobat activex controls fall in these category. They also works based on activex standards, but they are the true successors of old vb5 ole controls. These OLE controls were used for linking and embedding data files created by other OLE compatible apps.
2) By default all vc++ activex controls will come under Controls column. but if we want that to be displayed in Insertable column too, then we have to select the checkbox "Available in Insert Object Dialog" in the Activex creation wizard during creation. Or if u missed it out while creation, you can do it manually by modifying the sixth parameter of AfxOleRegisterControlClass call to include afxRegInsertable too. Do not forget to compile the application after modifying this. Compilation will register the activex and will add a new registry key called Insertable under the progId and clsid of the control. Then the control will get displayed in both Controls and Insertable Objects tabs of the Components dialog in VB
rgds .... mil10
|
|
|
|
|
I'm looking for a good sample project that shows how to implement interaction with an ActiveX control on a web page. I'm looking to create an ActiveX control that displays a listcontrol with checkboxes based on information gathered from the client machine's registry and filesystem, and then performing operations based on the user's selection. Embedding the control seems easy enough, using the object tag, but what then. Can anyone point me to good examples of going beyond step 1?
Cheers,
Carl
|
|
|
|
|
|
I am working on an application that needs to be able to archive data to CDR with the minimum of operator intervention (ideally just put in the disc).
It will run on XP and I want to use the IMAPI interface. That doesn't seem to be too difficult except that there's an AddData function that needs an IStorage pointer.
I need a pointer ( ) to how to get an IStorage filled with chosen directories and files from hard disc. I thought there must be an easy way but I can't find any documentation anywhere.
Please can someone tell me at least where to look?
Thanks.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Phil J Pearson wrote:
Please can someone tell me at least where to look?
MSDN[^].
HRESULT hr;
IStorage *pIst = NULL;
hr = pIst->CreateStorage(L"SomeName", STGM_READWRITE|
STGM_SHARE_EXCLUSIVE|STGM_CREATE,
0, 0, &pIst);
if(SUCCEEDED(hr))
{
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks, but I know how to create a storage. The question is how to fill it with a set of directories and files.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|