Solved

How to create directory in wide character ?

Posted on 2001-07-24
7
291 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
Independent Software Vendors: 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!

 
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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

733 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