|
I want check if a certain file is present at a certain location.
I am using the FileCreate function for this, but I have a problem in the creation of the filename parameter.
if I use the next line to create the filename everything works fine if the specified file is in the same directory as the source:
sprintf(FileName,"%s.txt",ProdBest[i]); //ProdBest is an array of strings containing the filename.
But I want a clear seperation between my Production files and the programm files, and store the Production files in a seperate directory (C:\ProdIn)
If I use the following line I always end up getting a INVALID_HANDLE_VALUE with GetLastError code = 2 (FILE_NOT_FOUND).
sprintf(FileName,"C:\ProdIn\%s.txt",ProdBest[i]);
So clearly I am making a mistake, but I don't know where or what
Can someone help me out?
|
|
|
|
|
Try using double back slash instead of single like this.
sprintf(FileName,"C:\\ProdIn\\%s.txt",ProdBest[i]);
|
|
|
|
|
|
You can use of FindFirstFile for see file exist or no.
|
|
|
|
|
I want to allow user for open my application only 1 time in one PC.
for avoid resource duplication problem.
How can I do?
|
|
|
|
|
If you are using MFC, take a look at this article[^].
BTW, searching before asking the qestion sometimes brings a lot of usefull results. There are plenty of nice articles on codeproject about a very broad range of subjects.
|
|
|
|
|
thank a lot
but that article doesn't work
|
|
|
|
|
Max++ wrote: but that article doesn't work
Which means ?
|
|
|
|
|
Cedric Moonen wrote: Which means ?
It is not giving the expected result.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
Hi all,
I m new in VC++, i m working on MFC-SDI document type application,
in my application i want to use MS-Acess 2007 Database,
but i dont have any knowledge about this.
please anyone can tell me at starting how an i use Access databse in my application.
thanks in advance.
|
|
|
|
|
|
There is number of article please tell me which one is suitable for me.
|
|
|
|
|
|
|
when i run this application then click of read button it gives an error that is::
"DataBase Error::Data source name not found and no default driver specified."
now how can i remove this error
tahnks in advance.
|
|
|
|
|
Did you set path for mdb file?
|
|
|
|
|
this error also occur in codeproject application.
|
|
|
|
|
I tested that program and its working.
|
|
|
|
|
Oh really I used of google for that search .
|
|
|
|
|
Hi Friends,
I want to develop a dll in .Net to send email (using namespace System.Web.Mail),then i want to call it in MFC application.
So i want to know whether is it possible to call .Net dll in MFC App??
If yes,let me know in detail.
Thanx in advance..
Reagards
Shiva
|
|
|
|
|
|
True, But I am using MS Visual Studio 6.0.
How to do it in that? any idea..?
Reagards
Shiva
|
|
|
|
|
Well you cannot create a managed dll in VC++ 6.0 so you have to use at least VC 2002 for that purpose. Once you create a managed dll it can consumed from any COM compatible language. So you can call it from VC++ 6.0.
-Saurabh
|
|
|
|
|
You can do this.
you just need to add a reference to the dll in the Proect\Property window under the COmmon Property\Refernece link.
Click to the add new reference button and browse to the you .net dll.
You can now use your dll in MFC. You should use gcnew insteasd of new for creating an object to a managed class.
Javed A Ansari
Software Developer
Hyderabad, India
|
|
|
|