Solved

How to create directory in wide character ?

Posted on 2001-07-24
7
259 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now