|
Here is a snippet of my .h file
[
coclass,
noncreatable,
threading(apartment),
support_error_info("IAttachment"),
vi_progid("RMMAPIParserLib.Attachment"),
progid("RMMAPIParserLib.Attachment.1"),
version(1.0),
uuid("32ECA67C-0B5F-4489-B163-85C6CEDDB746"),
helpstring("Attachment Class")
]
class ATL_NO_VTABLE Attachment :
public IAttachment
{
.....
STDMETHOD(GetPropUNICODE)(LONG PropertyID, BSTR* pRetVal);
.....
}
and here is the function
STDMETHODIMP Attachment::GetPropUNICODE(LONG PropertyID, BSTR* pRetVal)
{
if ((PROP_TYPE_MASK & PropertyID) != PT_UNICODE)
{
return E_FAIL;
}
redmap::mapi::FoundProperty prop
= m_Attachment->FindProperty(PropertyID);
if (prop.second)
{
ATL::CComBSTR bstr (prop.first.lpszW);
return bstr.CopyTo(pRetVal);
}
else
{
ATL::CComBSTR bstr (L"");
return bstr.CopyTo(pRetVal);
}
}
Now my problem is I am getting the support_error_info error, what is wrong with the code?
Thanks
Jj
|
|
|
|
|
I think for the "support error info" to work, you class has to implement ISupportErrorInfo, which allows a caller to request extra information about the last error.
Nathan
|
|
|
|
|
Hi,
it hapend something very strange to me, when i call 'this' from inside the activeX control class, when i debug project with 'activex test container', it work fine, but when i start the release with iexplorer, when call 'this' it seems to get not activex control pointer to DC, but pointer to desktop DC. Because when iexplorer is not maximized, in the center of screen, when call 'this', it starts to write on the top left corner on the desktop, outside of iexplorer.
I get this pointer and then construct CClientDC dc(this); I tought that maybe this is null and get desktop dc, but when put condition if(){}, this is not null and enter int brckets.
Thanks.
-- modified at 2:17 Monday 17th September, 2007
|
|
|
|
|
Dear all, i'm developing an activex component to use in a web application. my task requires using a dll to do some work...
When i try to add it to the references of the project i get the message of "can't add a reference to the specified file"
I'm using Visual Studio 6 and vb6 as a language
Any help or hints would be appreciated
Thanks in advance
Best Regards
3ala2
|
|
|
|
|
just3ala2 wrote: Dear all, i'm developing an activex component to use in a web application. my task requires using a dll to do some work...
When i try to add it to the references of the project i get the message of "can't add a reference to the specified file"
I'm using Visual Studio 6 and vb6 as a language
It sounds like you are trying to add a reference to a dll that isn't a COM dll. VB6 does provide a way to access them, but it involves creating a module file and writing code to import all the functions that you need to call in the dll.
Nathan
|
|
|
|
|
I c
Thanx nathan, i found another dll that does the same job and can be added as a reference
Best Regards
3ala2
|
|
|
|
|
Hey ,
Can you please explain the diffrence between .idl and .h file?
Also How to create a new .idl file in VC6?
Thanks,
Ash.
|
|
|
|
|
The idl-File is the input for the midl-compiler which creates an _i.c and .h file for further use. See MIDL-Compiler for more information. For creation of an idl-file use the ATLCOM-wizard in the VS.
|
|
|
|
|
I am learning COM. And has come to know about one of the Advantages of the COM over .dll file. That
It extends the functionality of (client)application without rebuilding.
I.e. If you make the changes in function of .Dll File which client application is using you need to recompile the application. But if you are using the COM you dont need to do recompilation of client application
But How ?? afterall the COM ( inprocess COM) is also a .dll
|
|
|
|
|
Well you don't necessarily have to rebuild the entire app that is using a dll when it changes. Think about how Microsoft provides patches or updates to DLLs. Do you need to rebuild your OS to use the new DLLS
As long at the function interface does not change you don't need to worry about rebuilding the app that uses the DLL.
COM provides interfaces that other app use. As long as the interface is not changed everything will be fine if the COM object has some code changes.
Let's say a code of a COM interface was modify like a bug fix, then the app using the old COM object will be able to use the new COM object because all it needs to do is CoCreate the COM object and Query for it's interface. This part remains the same in the app, so the app doesn't need to be changed.
|
|
|
|
|
I m thinking to learn COM but not getting from where to start ?. If u know about any good book please tell. If you can provide the link to the Ebook it will be gr8 HELP!.
Thnx in Advance.
|
|
|
|
|
|
Thnx but I have already read this article b4 and other aricles from the codeproject.com. So if u know about any good Book which have explained COM in Depth please tell me.
|
|
|
|
|
Essential COM by Don Box.
|
|
|
|
|
Essential COM - by Don Box
you may also want to look at
Inside COM - by Dale Rogerson
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi,
How will you talk with Activex or COM(could be created in MFC) From C#?
Plzz send me ur valuable suggestions to me as soon as possible...Thanks to u..What is CCW and RCW?How to use it?
spalanivel
|
|
|
|
|
|
Thanks for ur information.. and if any coding related to these it will be more useful...
|
|
|
|
|
|
|
I have a COM component with no .h files.
I want to use,but how should I begin?
Thanks.
GOOD LUCK!
|
|
|
|
|
IDispatch can help
or
use #import[^] on the Type library which could be a seperate file or embeded in the COM server DLL
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Thanks very much.But I am a beginer of COM,would you like to give me a demo of such task?
GOOD LUCK.
|
|
|
|
|
Some interfaces in Windows Media Player are only available by using a "remote" host. I'd like to remote the player control from my OCX which is embedded in IE. I am searching for way to get a reference to a container that would support IObjectWithSite (ideally IE itself) to set up my remote host object in order to create the remoted WMP instance... any assistance, ideas or comments would be greatly appreciated.
Addition: BTW all this works fine when done from an MFC app... but I can't get a container reference in the OCX.
-- modified at 12:10 Wednesday 12th September, 2007
|
|
|
|
|
Here's exactly what's going wrong -
CAxWindow *m_pView;
CComPtr<IAxWinHostWindow> spHost;
RECT rectWMP={1,1,1,1};
AtlAxWinInit();
m_pView = new CAxWindow();
hr = m_pView ? S_OK : E_OUTOFMEMORY;
if(SUCCEEDED(hr))
{
MessageBox(_T("Got AxWindow"), _T("WMP Container"), MB_OK);
m_pView->Create(m_hWnd, rectWMP, NULL, WS_CHILD);
hr = ::IsWindow(m_pView->m_hWnd)? S_OK : E_FAIL;
}
Is it clearer what is going on from that? (this same code works fine in a local app)
|
|
|
|