Solved

How to create directory in wide character ?

Posted on 2001-07-24
7
278 Views
Last Modified: 2010-05-18
Hi !

I want to create a directory with wide characters (wstring or wchar_t).

The "_wmakepath" function don't let me to create network dir because I have to specify the drive letter and the "_wcreat" function don't let me to create directory (just file).

Can someone help me plz ?

tk

PS: I'm Ms Visual C++ 6.0
0
Comment
Question by:yota1998
7 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 6314487
Did you try _wfullpath() function?
0
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 6314490
>>PS: I'm Ms Visual C++ 6.0

Use

wchar_t* pwszDir = L"\\\\server\\share\\dir";

CreateDirectoryW ( pwszDir, NULL);

Feel free to ask if you need more information or encounter problems!
0
 
LVL 86

Expert Comment

by:jkr
ID: 6314498
Ooops, sorry Axter.

BTW: 'CreateDirectory()' is the 'official' Win32 API for that purpose. The version that takes a UNICODE string is called 'CreateDirectoryW()'
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 30

Expert Comment

by:Axter
ID: 6314506
jkr,
>>'CreateDirectory()' is the 'official' Win32 API
You're right
0
 
LVL 2

Expert Comment

by:antoinebf
ID: 6314548
Hi,
BTW _wfullpath() is to convert a relative path (with ..\..\) to an absolute path (\temp\blabla\). I don't think it will create a dir, just expand the path...

0
 
LVL 11

Expert Comment

by:griessh
ID: 7021839
Dear yota1998

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "jkr"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7040355
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question