views:

1011

answers:

1

I have an application that creates and edits documents. I need to integrate it with SharePoint, so that users can edit files on SharePoint servers using my application. My environment is Visual C++, non-MFC Windows application.

I'm trying out the Web Client service (webclnt.dll) to see if I can get my app to work with a minimum of code changes. This works brilliantly with notepad, etc (just giving it a URL to the sharepoint document, Web Client intercepts the file I/O request and redirects it out to the network)... but my application is failing calling CreateFile with "GetLastError" code of 123:

(ERROR_INVALID_NAME).

Anyone know why this is? I'm passing CreateFile a valid full URL to the file. I've looked through the options that can be passed to createFile and I don't see anything that looks like it would relax the filename validation.

+1  A: 

It looks like the problem is that you can't pass a URL to CreateFile. You have to use the GetOpenFileName dialog, and enter a URL into that. The WebDAV redirector then converts that into a URI that can be passed to CreateFile. It works then.

Steve