|
Hi!
I'm developing an application that's burning CD/DVDs using IMAPIv2.0, and need to receive notifications when adding data to the disc image before burning. I've implemented the DFileSystemImageEvents in the same manner as the DDiscFormat2DataEvents interface, but I don't receive any notifications when calling IFsiDirectoryItem::AddTree() on the root directory item retrieved using IFileSystemImage::get_Root().
Also, I call the AddTree() method in a separate thread, COM initialization and pointer marshalling all taken care of (I believe), and the operation for some reason blocks both the separate thread and the primary application thread. But once this operation is done, and I move on to creating result image, retrieving image stream and launching IDiscFormat2Data::Write() (still in the separate thread), the primary thread is unblocked and starts receiving events from the DDiscFormat2DataEvents interface.
This is my how I've implement the interface:
class CIMAPIBurnerImageEvent :<br />
public CIMAPIBurnerEvent,<br />
public ::ATL::CComObjectRootEx<::ATL::CComSingleThreadModel>,<br />
public ::ATL::CComCoClass<CIMAPIBurnerImageEvent>,<br />
public ::ATL::IDispatchImpl<IDispatch, &IID_DFileSystemImageEvents, &LIBID_IMAPILib2, IMAPILib2_MajorVersion, IMAPILib2_MinorVersion>,<br />
public ::ATL::IDispEventImpl<1, CIMAPIBurnerImageEvent, &IID_DFileSystemImageEvents, &LIBID_IMAPILib2, IMAPILib2_MajorVersion, IMAPILib2_MinorVersion><br />
{<br />
DECLARE_NOT_AGGREGATABLE(CIMAPIBurnerImageEvent)<br />
<br />
BEGIN_COM_MAP(CIMAPIBurnerImageEvent)<br />
COM_INTERFACE_ENTRY(IDispatch)<br />
END_COM_MAP()<br />
<br />
BEGIN_SINK_MAP(CIMAPIBurnerImageEvent)<br />
SINK_ENTRY_EX(1, IID_DFileSystemImageEvents, DISPID_DFILESYSTEMIMAGEEVENTS_UPDATE, &Update)<br />
END_SINK_MAP()<br />
<br />
public:<br />
STDMETHOD_(VOID, Update)(IFileSystemImage* fileSystemImage, BSTR currentFile, LONG copiedSectors, LONG totalSectors);<br />
};
This class is hooked up for event listening from the IFileSystemImage interface in the same way as with the DDiscFormat2DataEvents, like this:
m_pImageEvent->DispEventAdvise(m_pFileSystemImage);
To summarize; I don't receive any notifications and both threads are blocked.
What can I possibly be doing wrong?
Regards,
Ole Petter
|
|
|
|
|
|
All,
We have code to call a component remotely from a standard VB.NET Form. I've compiled the code on my machine and it works fine. Calling from another client over the network causes the following error message:
Retrieving the COM class factory for remote component with CLSID {F655F1E8-50B6-31EF-9C5D-B14B7D9B56D3} from machine XP1111 failed due to the following error: 80070005.
The Client Call is made as follows:
Dim svr As Type = Type.GetTypeFromProgID("ZFTestCOMPlus.ZFComPlusOne", _<br />
txtServer.Text) <br />
' txtServer.Text is the name of the server e.g "XP1111"<br />
Dim o As Object = Activator.CreateInstance(svr)<br />
Dim x As ZFTestCOMPlus.ZFComPlusOne = CType(o, ZFTestCOMPlus.ZFComPlusOne)<br />
Dim str As String = x.GetSomeDataFromMe()
The problem occurs on the line Dim o As Object = Activator.CreateInstance(svr).
This is the first COM+ application that has been written here. It is totally client based but users Library COM+ Application (which causes all kinds off issues).
The component is a COM+ Server Application with one class and 2 methods.
Troubleshooting (in the dark) so far...
1. Installed Component into GAC.
2. Created a MSI from COM+ to install the components on remote machine as
a proxy.
2. Added user calling the component from the remote machine to a role
under the COM+ Application. This role has been given access to
ZFTestCOMPlus.ZFComPlusOne class
3. Tried disabling Enforce access checks for this application.
4. Granted full access/remote launch to the user in dcomdnfg in the COM
Security tab.
Anyone have any ideas?
Just fumbling about in the dark at the mo and not come across any decent artices
Andez
|
|
|
|
|
This is permission problem, is the user has the execute permission on the remote machine?
Please try to use the credential of user who has administrator rights on remote m/c
Regards,
Sunil Tonger
|
|
|
|
|
Hey,
I have to define a user defined property but in the "IDL" file i am getting a compilation error
i.e
error MIDL2025 : syntax error : expecting a type specification near "ADO_ROWSET"
at this line
[propget, id(6), helpstring("property FetchRowSet")] HRESULT FetchRowSet([out, retval] ADO_ROWSET *pVal);
Please help me in doing so as my whole of design of dll depends on this problem pls through some light
Regards,
Pankaj Sachdeva
|
|
|
|
|
pan_angel wrote: ADO_ROWSET
MIDL compiler is not recognizing ADO_ROWSET , isn't that declared before using ?
Prasad
MS MVP - VC++
|
|
|
|
|
actually it is a seperate class and i want to use it's object as the argument,
but it is not declared in IDL file before this statement.
This is actuall IDL file that is created in default
<br />
<br />
import "oaidl.idl";<br />
import "ocidl.idl";<br />
<br />
typedef enum<br />
{<br />
connOracle = 1,<br />
connSQLServer = 2,<br />
connAccess = 3<br />
} dbFlag;<br />
<br />
[<br />
object,<br />
uuid(6DD75115-9828-4BA0-9006-D85B1DFDA2A8),<br />
dual,<br />
helpstring("IADO_DB Interface"),<br />
pointer_default(unique)<br />
]<br />
interface IADO_DB : IDispatch<br />
{<br />
[id(1), helpstring("method ConnectDatabase")] HRESULT ConnectDatabase(BSTR sDatabase,BSTR sUserID,BSTR sPassword,BSTR sServer,dbFlag connDB);<br />
[id(2), helpstring("method DisconnectDatabase")] HRESULT DisconnectDatabase();<br />
[id(3), helpstring("method ExecuteSQL")] HRESULT ExecuteSQL(BSTR sQuery);<br />
[propget, id(4), helpstring("property DatabaseName")] HRESULT DatabaseName([out, retval] BSTR *pVal);<br />
[propget, id(5), helpstring("property SQL")] HRESULT SQL([out, retval] BSTR *pVal);<br />
[propput, id(5), helpstring("property SQL")] HRESULT SQL([in] BSTR newVal);<br />
[propget, id(6), helpstring("property RowSet")] HRESULT RowSet([out, retval] ADO_ROWSET *pVal);<br />
};<br />
<br />
[<br />
object,<br />
uuid(DEAD417C-B1EA-401D-8F8B-55A2207BDB52),<br />
dual,<br />
helpstring("IADO_ROWSET Interface"),<br />
pointer_default(unique)<br />
]<br />
interface IADO_ROWSET : IDispatch<br />
{<br />
};<br />
<br />
[<br />
uuid(440FC80A-7700-4291-B683-7B4B2BE7D9E2),<br />
version(1.0),<br />
helpstring("dbcs07 1.0 Type Library")<br />
]<br />
library DBCS07Lib<br />
{<br />
importlib("stdole32.tlb");<br />
importlib("stdole2.tlb");<br />
<br />
<br />
[<br />
uuid(2A6DE5C6-9BEC-49FE-8626-23D4C9656C93),<br />
helpstring("ADO_DB Class")<br />
]<br />
coclass ADO_DB<br />
{<br />
[default] interface IADO_DB;<br />
};<br />
<br />
[<br />
uuid(74FCF560-93D9-4F15-B477-5A62E529C567),<br />
helpstring("ADO_ROWSET Class")<br />
]<br />
coclass ADO_ROWSET<br />
{<br />
[default] interface IADO_ROWSET;<br />
};<br />
};
if it has any problem pls let me know
Thank you
Regards,
Pankaj Sachdeva
|
|
|
|
|
You could use IADO_ROWSET as argument, not it's coclass.
And need to make forward declaration for interface , before using as parameter.
Prasad
MS MVP - VC++
|
|
|
|
|
Thankx Mr. Prasad i got u it worked
Regards,
Pankaj Sachdeva
|
|
|
|
|
Hi All,
QueryInterface call is failing with RPC_E_SYS_CALL_FAILED HRESULT.
Scenario Description:
When many objects are selected, same operation is performed on those objects. For most the objects, the operation is successful. But for some, problem occurs and QueryInterface fails with RPC_E_SYS_CALL_FAILED. The objects in question are of similar sought.
Please let me know if further clarification is required. I am in a fix due to this error and unable to figure out anything on this.
Any help on this will be greatly appreciated.
Thanks,
Suraj
|
|
|
|
|
Hi
I would like to know if somebody knew how to decode the HRESULT values.
I get 2 different values of HRESULT for 2 of my methods.
There are in hexadecimal : 0x7c839aa8 and 0x7c809ba8 and I would like to know what are their meanings. I think it's not an error, else it would have been something like 0x8.......
Thanks in advance
|
|
|
|
|
Have a look at [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Go to MSDN to this link ms-help://MS.MSDN.vAug06.en/mobilesdk5/html/mob5lrfHRESULT.htm
and you will see
modified 11-Feb-21 21:01pm.
|
|
|
|
|
hi i want to highlight some text,when the web page first loads through
toolbar, i have used Iobjectwithsite class to notify when page is about to
load etc,i have registered a event handler that notifies me that document is
completely loaded,then i hightlight some text.this solution works fine on
normal webpages, but it fails on AJax enabled wesites bcos these site are not
completed(loaded to browser at once), here is event handler which i m
using,what other event handler should i use that work with AJAX enabled site
as well.
Explorer.DocumentComplete += new
SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(Explorer_DocumentComplete);
Regards.
Tasleem Arif
|
|
|
|
|
Hi.
We're working on migrating a system from vb6 to .Net 2.0, but we've run into a problem. Calling the old vb6 com objects from the new .Net code works fine, and vice versa. However, when using one of the old com objects as parameters in calls from the new .Net code to either old vb6 com objects or the new .Net com objects, things don't work quite as well, and I get an error like this one:
System.Runtime.Remoting.RemotingException : The argument type 'System.__ComObject' cannot be converted into parameter type 'XMLEntities._IXMLEntity'.
The method signauture in this example is:
Public Overrides Function UpdateEntity(ByRef objEntity As _IXMLEntity, ByRef objParent As _IXMLEntity, ByRef ilngBrukerOrganisasjonsNr As Integer) As Object
and the call something like this:
object svar = tomtWriterNew.UpdateEntity(ref object1, ref object2, ref brukerOrganisasjonsNummer); (yeah, we're mixing vb6 and c# a bit, but hey, it's only a test project).
Have anyone ecountered a similar problem and know what happens and how to solve it? Any input would be appriciated. It is quite possible to do a workaround of the problem, but it would be nice to know what's going wrong because it's something I feel we will run into again in the future.
|
|
|
|
|
I have an application in which I want to initialize a COM object.
I have included objbase.h and ole32.lib in the workspace. I have also declared the following in the header file
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT = 0x0500
#define _WIN32_DCOM
But still I get the following errors
error C2065: 'CoInitializeEx' : undeclared identifier
error C2065: 'COINIT_MULTITHREADED' : undeclared identifier
WHY SO??
|
|
|
|
|
koumodaki wrote: I have included objbase.h and ole32.lib in the workspace
In the workplace? Have you included the headers into the proper source files?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Yes I have...declarations are in stdafx.h and my applications cpp has this file included
|
|
|
|
|
koumodaki wrote: #define _WIN32_WINNT = 0x0500
The first problem is you need to remove the equals sign from the second #define .
|
|
|
|
|
Hi
I'm working on a program which connects to a machine and then has to do provisionning. For the moment the connection works. I work with an API which operates with requests and confirmations. Each composant of the API implements 3 interfaces : an interface for the request Ixxx, an interface for the events IxxxEvents and the IUnknown interface (COM/DCOM).
I can do all the requests I want. But my problem is, I have never a confirmation. The confirmations are fontions which have to be implemented but, if i do right understand, that I don't have to call.
I saw in COM/DCOM documentation that I had to create connection points in order to receive automatically the confirmations corresponding to the requests. I think my error is in the Advise() function. I don't know what I have to pass for the first parameter in this function.
I saw on internet that the first parameter is a pointer on the IUnknow interface of the sink object. But I don't really understand what is the sink object here. Do I have to create a class ? A class that inherits from something ?
I don’t understand also how I have to implement the QueryInterface method() in the case of the IID is the IUnknown identifier.
Here is a portion of my code for the connection points, the 2 interfaces are ITCSUser and ITCSUserEvents.
HRESULT hres;
IConnectionPoint* m_pITCSUserCP;
DWORD m_UserEventsCookie;
IUnknown * pIUnknown = NULL;
hres = pITCSUser->QueryInterface(IID_IUnknown, (void**)&pIUnknown);
hres = GetConnectionPoint(__uuidof(ITCSUserEvents), pITCSUser,&m_pITCSUserCP);
if (SUCCEEDED(hres))
{
m_UserEventsCookie = 0;
hres = m_pITCSUserCP->Advise(pIUnknown, &m_UserEventsCookie );
}
// Finds a connection point (riid) from an interface.
HRESULT GetConnectionPoint(REFIID riid, IUnknown* pObj,
IConnectionPoint** pCP)
{
IConnectionPointContainer* pCPC = NULL;
HRESULT hRes = pObj->QueryInterface(IID_IConnectionPointContainer,
(void**)&pCPC);
if (SUCCEEDED(hRes))
{
hRes = pCPC->FindConnectionPoint(riid, pCP);
}
pCPC->Release();
return hRes;
}
STDMETHOD(QueryInterface)(REFIID iid, LPVOID* ppv)
{
if ( iid == __uuidof(ITCSUserEvents) )
{
*ppv = static_cast<itcsuserevents*>(this);
}
else if ( iid == __uuidof(ITCSDataEvents) )
{
*ppv = static_cast<itcsdataevents*>(this);
}
else if ( iid == __uuidof(ITCSRadioSubscriberManagerEvents) )
{
*ppv = static_cast<itcsradiosubscribermanagerevents*>(this);
}
else if ( iid == __uuidof(ITCSGroupManagerEvents) )
{
*ppv = static_cast<itcsgroupmanagerevents*>(this);
}
else if ( iid == __uuidof(ITCSSystemManagerEvents) )
{
*ppv = static_cast<itcssystemmanagerevents*>(this);
}
else if ( iid == __uuidof(IUnknown) )
{
*ppv = static_cast<itcsuserevents*>(this);
}
else
{
*ppv = 0;
return E_NOINTERFACE;
}
return S_OK;
}
Thanx in advance !!
|
|
|
|
|
Nath9999 wrote: But my problem is, I have never a confirmation. The confirmations are fontions which have to be implemented but, if i do right understand, that I don't have to call.
You need to add the function declration in the component for the dispatch Interface and Click "Implement Connection Points" by right clicking on the coclass.Then you will get the Fire event for the method which calls the client function.
Nath9999 wrote: Do I have to create a class ? A class that inherits from something ?
Yes ,you need to derive a class from CCmdTarget and call the Advise and Unadvise Member functions.This class is known as sink class.You write the Fire Method implementation in the sink class(This will be called by Component).
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
I resolved the problem for reading registry (see last entry for that problem) and now I have the following error when trying to run the COM. This error occurs in main() method for my .exe project as follows:
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
****HERE**** Application.Run(new FormXXXXXCS());
}
The runtime has encountered a fatal error. The address of the error
was at 0x7f5dd68b, on thread 0xdf4. The error code is 0xc0000005.
This error may be a bug in the CLR or in the unsafe or non-verifiable
portions of user code. Common sources of this bug include user
marshaling errors for COM-interop or PInvoke, which may corrupt the
stack.
Does anyone know what is causing this and how to solve.
Michael
|
|
|
|
|
0xc0000005 is access violation. Possibly in the COM component being accessed.
If you can post the call stack, we can find the cause. Do you have source code of COM compoent?
Also, are you using COM Events?
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
No I don't have the source code. The COM works fine if executed from an .exe project but not as a Library, why would that be.
Michael
|
|
|
|
|