FormatMessage and va_list args

  • Thread starter Thread starter Egbert Nierop \(MVP for IIS\)
  • Start date Start date
E

Egbert Nierop \(MVP for IIS\)

Hi,

I have a function that has a variable no of arguments


(note! function shortened)

myfunction(int someID, ...)

{
va_list args;
va_start args, someID;
FormatMessage(......, &args);
va_end(args);
}

PROBLEM: formatMessage wants a pointer thus, 'va_list *Arguments'.

How can I correctly pass this all since the code above does not work.
 
myfunction(int someID, ...)
{
va_list args;
va_start args, someID;
FormatMessage(......, &args);
va_end(args);
}

PROBLEM: formatMessage wants a pointer thus, 'va_list *Arguments'.
How can I correctly pass this all since the code above does not work.
What do you mean by "does not work".
What is the behavior? Does not compile? Crashes?
 
It works fine. But I think you may need to read FormatMessage's
documentation again.
 
Mihai N. said:
What do you mean by "does not work".
What is the behavior? Does not compile? Crashes?

OK,

Solved.

I assumed that %s would be recognized as well. It should be %1 :)
 
Back
Top