Error C2664: 'GetVolumeInformationW' : cannot convert parameter 1 from 'const char [4]' to 'LPCWSTR'
-
Try this code:
TCHAR volumeName\[MAX\_PATH\]; DWORD volumeSerialNumber; DWORD maxNameLength; DWORD fileSystemFlags; TCHAR systemName\[MAX\_PATH\]; // get the volume information for drive C GetHDDserialNo = GetVolumeInformation(\_T("c:\\\\"), volumeName, MAX\_PATH, &volumeSerialNumber, &maxNameLength, &fileSystemFlags, systemName, MAX\_PATH);
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Because you have UNICODE enabled, so a lot of functions from the Win32 API expect strings in UNICODE and not in ANSI. I suggest you search for articles on that subject here on codeproject, it is a bit broad to explain in one single post.
Cédric Moonen Software developer
Charting control [v1.3] -
Hontesly no genius. Trust me, it is a simple thing. Read on Generic text mappings.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Hontesly no genius. Trust me, it is a simple thing. Read on Generic text mappings.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
Rajesh R Subramanian wrote:
Hontesly no genius.
Actually, you are a genius. Only geniuses swap not adjacent characters in a word the way you did. :laugh:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Rajesh R Subramanian wrote:
Hontesly no genius.
Actually, you are a genius. Only geniuses swap not adjacent characters in a word the way you did. :laugh:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeYuo wlil nto msis oen signle cahnce to mcok at me, wlil oyu? :laugh:
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Yuo wlil nto msis oen signle cahnce to mcok at me, wlil oyu? :laugh:
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
Oh no, you reverted to common-man adjacent characters swapping! :sigh: :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Oh no, you reverted to common-man adjacent characters swapping! :sigh: :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeProbably this[^] would give you an idea why such swapping happens while I type. :)
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Hontesly no genius. Trust me, it is a simple thing. Read on Generic text mappings.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Start here: The Complete Guide to C++ Strings, Part I - Win32 Character Encodings[^]
--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze
-
Start here: The Complete Guide to C++ Strings, Part I - Win32 Character Encodings[^]
--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ I work for Keyser Söze