return how much of the string was successfully parsed.
- Try to create (parse) a *native* moniker. E.g., a File or URL Moniker ("http:...", "file:..."). See MSDN on the exact syntax.
- Try XPProEmulation image (
www.xpefiles.com, Development Utilities/Main folder). See if your test app work there.
- Use Regmon (and maybe Filemon too) to see why MkParseDisplayName/MkParseDisplayNameEx fails. You can get pretty clean log if
you break just before the API call and then stop logging right after the API call.
KM
--
Regards,
KM, BSquare Corp.
Thanks a lot for all your suggestions. Unfortunately it still does not
work.
- I have tested my app on XPPro and W2K. It works there.
- I do call CoInitialize()
- Primitive OLE32 is on the image
- COM+ services component is included
- ClassMoniker CLSID
[HKCR\CLSID\{0000031A-0000-0000-C000-000000000046}] does exist
- Added ole2disp.dll. Regsvr32 would not register it (16 bit app?).
Compared registry keys where this dll is referenced on XPPro and XPe.
Added following manually:
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{DF0B3D60-548F-101B-8E65-
08002B2BD119}]
@="PSSupportErrorInfo"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{DF0B3D60-548F-101B-8E65-
08002B2BD119}\InprocServer]
@="ole2disp.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{DF0B3D60-548F-101B-8E65-
08002B2BD119}\InprocServer32]
@="oleaut32.dll"
None of this helped.
I've created simple test client and replaced CoGetObject() with what
it does internally. Failure occures in MkParseDisplayName(). See
output and code below:
Step 1. Succeeded
Step 2. Succeeded
Step 3. COM error occured. HRESULT = 0x800401E4. Error: Invalid syntax
int main(int argc, char* argv[])
{
CHR(CoInitialize(0));
IBindCtx *pbc=NULL;
CHR(CreateBindCtx(0, &pbc));
ULONG cchEaten=0;
IMoniker *pmk=NULL;
CHR(MkParseDisplayName(pbc,
OLESTR("clsid:141D07D5-286D-4CD3-B41A-3428D9975C04:"), &cchEaten,
&pmk));
IUnknown *punk=NULL;
CHR(pmk->BindToObject(pbc, 0, IID_IUnknown, (void**)&punk));
_tprintf(_T("Test has succeeded\n"));
punk->Release();
pmk->Release();
pbc->Release();
CoUninitialize();
return 0;
}
void CHR(HRESULT hr)
{
static unsigned step = 0;
step++;
if (hr!=S_OK)
{
_tprintf(_T("Step %u. COM error occured. HRESULT = 0x%0X. Error:
%s\n"), step, hr, _com_error(hr).ErrorMessage());
}
else
{
_tprintf(_T("Step %u. Succeeded\n"), step);
}
if (FAILED(hr)) exit(0);
}
Any ideas?
Alex,
A couple of clarifications:
- Have you tested your app (and started it the same way you do on XPe) on XP Pro? Did it work there?
- Do you call to CoInitialize before CoGetObject ?
- I assumed "Primitive: Ole32" component is in your image (otherwise you would unlikely be able to use your other COM objects)
- Do you have "COM+ Services" component included?
- At run time check if ClassMoniker is registered (IIRC, [HKCR\CLSID\{0000031A-0000-0000-C000-000000000046}])
If not, include HIVECLS.INF file into your Configuration (there is no component that holds the file), re-build and deploy
it
again.
- manually add ole2disp.dll to your image (will bring in necessary PSSupportErrorInfo interface). Again, no component