Click here to Skip to main content
15,908,675 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: computer name length issue Pin
George_George17-Dec-08 1:54
George_George17-Dec-08 1:54 
AnswerRe: computer name length issue Pin
CPallini16-Dec-08 1:51
mveCPallini16-Dec-08 1:51 
GeneralRe: computer name length issue Pin
George_George16-Dec-08 2:08
George_George16-Dec-08 2:08 
AnswerRe: computer name length issue Pin
Randor 16-Dec-08 2:02
professional Randor 16-Dec-08 2:02 
GeneralRe: computer name length issue Pin
George_George16-Dec-08 2:10
George_George16-Dec-08 2:10 
GeneralRe: computer name length issue Pin
Randor 16-Dec-08 2:34
professional Randor 16-Dec-08 2:34 
GeneralRe: computer name length issue Pin
George_George17-Dec-08 2:05
George_George17-Dec-08 2:05 
GeneralRe: computer name length issue Pin
Luc Pattyn16-Dec-08 2:45
sitebuilderLuc Pattyn16-Dec-08 2:45 
Hi George,

the answer is no; there is no macro/constant giving max length.
However there is a Win32 function that gives you the max length, it is called GetComputerNameEx; just give it a buffer=NULL and a size variable whose value is set to zero. Upon return, read that very same size value, then allocate a sufficiently large buffer, and call GetComputerNameEx again.

BTW: this is a common pattern in Win32: first ask for size, then allocate, then ask for data using the same function.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Fixturized forever. Confused | :confused:


GeneralRe: computer name length issue Pin
George_George17-Dec-08 1:55
George_George17-Dec-08 1:55 
GeneralRe: computer name length issue Pin
Luc Pattyn17-Dec-08 2:27
sitebuilderLuc Pattyn17-Dec-08 2:27 
GeneralRe: computer name length issue Pin
George_George17-Dec-08 2:30
George_George17-Dec-08 2:30 
GeneralRe: computer name length issue Pin
Luc Pattyn17-Dec-08 2:34
sitebuilderLuc Pattyn17-Dec-08 2:34 
GeneralRe: computer name length issue Pin
George_George17-Dec-08 2:43
George_George17-Dec-08 2:43 
AnswerRe: computer name length issue Pin
Mark Salsbery16-Dec-08 5:37
Mark Salsbery16-Dec-08 5:37 
GeneralRe: computer name length issue Pin
George_George17-Dec-08 1:59
George_George17-Dec-08 1:59 
GeneralRe: computer name length issue Pin
Mark Salsbery17-Dec-08 5:00
Mark Salsbery17-Dec-08 5:00 
GeneralRe: computer name length issue Pin
George_George17-Dec-08 19:36
George_George17-Dec-08 19:36 
QuestionVLCPlugin2 - Snapshot Pin
kutti16-Dec-08 0:44
kutti16-Dec-08 0:44 
JokeRe: VLCPlugin2 - Snapshot Pin
Eytukan16-Dec-08 6:29
Eytukan16-Dec-08 6:29 
GeneralRe: VLCPlugin2 - Snapshot Pin
kutti16-Dec-08 17:27
kutti16-Dec-08 17:27 
QuestionInheritance in C Pin
Chandrasekharan P15-Dec-08 23:39
Chandrasekharan P15-Dec-08 23:39 
AnswerRe: Inheritance in C Pin
Stuart Dootson15-Dec-08 23:50
professionalStuart Dootson15-Dec-08 23:50 
GeneralRe: Inheritance in C Pin
Chandrasekharan P15-Dec-08 23:54
Chandrasekharan P15-Dec-08 23:54 
GeneralRe: Inheritance in C Pin
David Crow16-Dec-08 2:40
David Crow16-Dec-08 2:40 
GeneralRe: Inheritance in C Pin
Chris Losinger16-Dec-08 6:37
professionalChris Losinger16-Dec-08 6:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.