Solved

How to create directory in wide character ?

Posted on 2001-07-24
7
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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 learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

635 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