.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links


Posted By:      Posted Date: October 25, 2010    Points: 0   Category :Windows Application

MS Visual Studio 2008, Visual C++, CLR Windows Forms Application.

I am trying to create a file and get a compile error. My code is;





The compile error is;

error C2664: 'CreateFileW' : cannot convert parameter 1 from 'const char [12]' to 'LPCWSTR'


Why am I getting this error?  Thanks.


View Complete Post

More Related Resource Links

Restoring 2008 Database with FileStream - CreateFile Sharing Violation

I've previously posted this question and turning off the anti-virus scan helped fix it. But I'm having same issue on a machine that doesn't have anti virus scanning enabled. Back story: I'm trying to restore a copy of a database that has a filestream and am getting the error below. I've tried with move option to specify a new path and left it with default path, neither worked.  Also tried the with replace option. FileStream1 is a new folder that the restore process creates. I've deleted the folder, tried it with a new name, re-took the backup from the source machine, restarted SQL, rebooted the machine, drive permissions are open. Msg 3634, Level 16, State 1, Line 1 he operating system returned the error '32(The process cannot access the file because it is being used by another process.)' while attempting 'OpenFile' on 'R:\Data\FileStream1\4ecb2e48-0eee-4c99-a3f0-f1e6c7f00b24\f2efe374-9481-4c1b-a7f2-dcdcee350807\0000001b-00005fcf-005a'. RESTORE DATABASE is terminating abnormally. ' I found the file on filemon and below is the error, stack and processes running. Date & Time:    9/15/2010 6:33:48 PM Event Class:    File System Operation:    CreateFile Result:    SHARING VIOLATION Path:    R:\Data\FileStream1\4ecb2e48-0eee-4c99-a3f0-f1e6c7f00b24\f2efe374-9481-4c1b-a7f2-dcdcee350807\
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend