
July 19th, 2005, 06:26 PM
| | | Member function with variables parameters
Would anyone have a hint of what's wrong with this
static char szLocalInternetAddress[16];
DWORD dwTest = 0x0002;
g_DmsLog.CreateEntry("Test with DWORD: %ld", dwTest);
g_DmsLog.CreateEntry("System IP: %s ", szLocalInternetAddress);
void CCreateEntry (const char *format, ...)
{
va_list arglist;
char szLine[100];
va_start(arglist, format);
sprintf(szLine, format, arglist);
va_end(arglist);
g_DmsLog.CreateEntry(szLine);
}
The arglist points to nowhere good.
Thanks | 
July 19th, 2005, 06:26 PM
| | | Re: Member function with variables parameters
Sorry, posted the function in C as I tested if it had something to do with
the code being a class member
void CDmsLog::CreateEntry (const char *format, ...)
{
va_list arglist;
char szLine[100];
EnterCriticalSection(pcsLog);
va_start(arglist, format);
sprintf(szLine, format, arglist);
va_end(arglist);
DoCreateEntry(szLine);
LeaveCriticalSection(pcsLog);
}
[color=blue]
> Would anyone have a hint of what's wrong with this
>
>
> static char szLocalInternetAddress[16];
> DWORD dwTest = 0x0002;
>
> g_DmsLog.CreateEntry("Test with DWORD: %ld", dwTest);
> g_DmsLog.CreateEntry("System IP: %s ", szLocalInternetAddress);
>
>
>
> void CCreateEntry (const char *format, ...)
> {
> va_list arglist;
> char szLine[100];
>
> va_start(arglist, format);
> sprintf(szLine, format, arglist);
> va_end(arglist);
>
> g_DmsLog.CreateEntry(szLine);
>
> }
>
> The arglist points to nowhere good.
>
> Thanks
>
>[/color] | 
July 19th, 2005, 06:27 PM
| | | Re: Member function with variables parameters
Make sure your function is not inline. Some compilers (older GCC) may have
problems with it.
--
A: People bitching about top posting
Q: What's the most annoying thing on USENET?
"Marc Leclerc" <mleclerc@signel.ca> wrote in message
news:s0o8b.6449$k81.621362@news20.bellglobal.com.. .[color=blue]
> Would anyone have a hint of what's wrong with this
>
>
> static char szLocalInternetAddress[16];
> DWORD dwTest = 0x0002;
>
> g_DmsLog.CreateEntry("Test with DWORD: %ld", dwTest);
> g_DmsLog.CreateEntry("System IP: %s ", szLocalInternetAddress);
>
>
>
> void CCreateEntry (const char *format, ...)
> {
> va_list arglist;
> char szLine[100];
>
> va_start(arglist, format);
> sprintf(szLine, format, arglist);
> va_end(arglist);
>
> g_DmsLog.CreateEntry(szLine);
>
> }
>
> The arglist points to nowhere good.
>
> Thanks
>
>[/color] | 
July 19th, 2005, 06:29 PM
| | | Re: Member function with variables parameters
"Alexander Grigoriev" <alegr@earthlink.net> wrote:[color=blue]
> --
> A: People bitching about top posting
> Q: What's the most annoying thing on USENET?[/color]
*PLONK* | 
July 19th, 2005, 06:29 PM
| | | Re: Member function with variables parameters
White Wolf wrote:[color=blue][color=green]
>>--
>>A: People bitching about top posting
>>Q: What's the most annoying thing on USENET?[/color]
>
> *PLONK*[/color]
I thought it was quite a good joke, for a sig. | 
July 19th, 2005, 06:29 PM
| | | Re: Member function with variables parameters
Buster Copley wrote:[color=blue]
> White Wolf wrote:[color=green][color=darkred]
>>> --
>>> A: People bitching about top posting
>>> Q: What's the most annoying thing on USENET?[/color]
>>
>> *PLONK*[/color]
> I thought it was quite a good joke, for a sig.[/color]
I have enough to read. This guy has just declared that he has no intention
to keep the common rules of posting here. He has just declared that he does
not give a d...ime. That sig is rather a flame-bait than any kind of good
joke. I may be unable to make one (good joke), but I know when I see one.
:-)
--
WW aka Attila | 
July 19th, 2005, 06:29 PM
| | | Re: Member function with variables parameters
White Wolf wrote:
[color=blue]
> "Alexander Grigoriev" <alegr@earthlink.net> wrote:
>[color=green]
>>--
>>A: People bitching about top posting
>>Q: What's the most annoying thing on USENET?[/color]
>
>
> *PLONK*
>
>[/color]
I didn't notice that before, or I wouldn't have bothered with my reply.
I'll also be adding him to my killfile now.
-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting. | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 205,338 network members.
|