Click here to Skip to main content
16,017,312 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFunction to check if “C:\\myFile.txt” exists Pin
anderslundsgard5-Sep-04 22:29
anderslundsgard5-Sep-04 22:29 
GeneralRe: Function to check if “C:\\myFile.txt” exists Pin
BAIJUMAX5-Sep-04 22:42
professionalBAIJUMAX5-Sep-04 22:42 
GeneralRe: Function to check if “C:\\myFile.txt” exists Pin
anderslundsgard5-Sep-04 23:24
anderslundsgard5-Sep-04 23:24 
GeneralRe: Function to check if “C:\\myFile.txt” exists Pin
BAIJUMAX6-Sep-04 2:43
professionalBAIJUMAX6-Sep-04 2:43 
GeneralRe: Function to check if “C:\\myFile.txt” exists Pin
Arsalan Malik5-Sep-04 22:54
Arsalan Malik5-Sep-04 22:54 
GeneralRe: Function to check if “C:\\myFile.txt” exists Pin
jmkhael5-Sep-04 23:17
jmkhael5-Sep-04 23:17 
GeneralRe: Function to check if “C:\\myFile.txt” exists Pin
caoquanghanh7-Sep-04 17:37
caoquanghanh7-Sep-04 17:37 
GeneralVariable argument list functions Pin
Jon Hulatt5-Sep-04 21:20
Jon Hulatt5-Sep-04 21:20 
Hi All,

I'm trying to make a debug function, which will be fairly multiple use in my app, dependant on Command line arguments.

The functon will always TRACE(), and if optionally specified, will write debug info to STDERR, or to a log file. All in one.

I'd like to be able to implement a variable argument list function to do this.

However, I can't find a way to pass the argument list to another variable argument list function.

I'd like to have something like this:-

void MyDebug(char * psFormat, ...)
{
    va_list al; 
    va_start(al, psFormat);


and then format a string based on the variable arg list, something like this (which does not work).

char szDbgMessage[4096];
sscanf(szDbgMessage,pszFormat, al);


because, after that, I could do whatever I wanted with the string... TRACE0() it, cout it, chuck it out to a file, or even make a cup of tea with it?

I managed to do more or less exactly this with gcc with the Gameboy as a target, but no compiler implementor does this the same. Has anyone ever managed this in VC++.

Thanks

JOn


TRACE0(szDbgMessage);

va_end(ptr);

using System.Beer;

GeneralRe: Variable argument list functions Pin
francois brondel5-Sep-04 21:38
francois brondel5-Sep-04 21:38 
GeneralRe: Variable argument list functions Pin
Jon Hulatt6-Sep-04 2:21
Jon Hulatt6-Sep-04 2:21 
QuestionInitializing an Array inside a Class? Pin
CreepingFeature5-Sep-04 21:07
CreepingFeature5-Sep-04 21:07 
AnswerRe: Initializing an Array inside a Class? Pin
Arsalan Malik5-Sep-04 21:40
Arsalan Malik5-Sep-04 21:40 
GeneralRe: Initializing an Array inside a Class? Pin
Rory Solley5-Sep-04 21:52
Rory Solley5-Sep-04 21:52 
GeneralRe: Initializing an Array inside a Class? Pin
Arsalan Malik5-Sep-04 23:00
Arsalan Malik5-Sep-04 23:00 
GeneralRe: Initializing an Array inside a Class? Pin
CreepingFeature6-Sep-04 21:15
CreepingFeature6-Sep-04 21:15 
GeneralSizeToRect Trouble Pin
Dan Neilsen5-Sep-04 20:52
Dan Neilsen5-Sep-04 20:52 
GeneralRe: SizeToRect Trouble Pin
Bob Stanneveld6-Sep-04 9:38
Bob Stanneveld6-Sep-04 9:38 
GeneralRe: SizeToRect Trouble Pin
Dan Neilsen6-Sep-04 13:50
Dan Neilsen6-Sep-04 13:50 
GeneralDiffernce between ATL DLL, ATL Service and ATL EXE and WebService in ASP.NET Pin
zahid_ash5-Sep-04 20:23
zahid_ash5-Sep-04 20:23 
GeneralCreateService: passing a parameter Pin
Imtiaz Murtaza5-Sep-04 19:19
Imtiaz Murtaza5-Sep-04 19:19 
GeneralRe: CreateService: passing a parameter Pin
Michael Dunn5-Sep-04 20:12
sitebuilderMichael Dunn5-Sep-04 20:12 
GeneralRe: CreateService: passing a parameter Pin
cmk6-Sep-04 0:02
cmk6-Sep-04 0:02 
QuestionHow to link menu and dialog box? Pin
anuchelvi5-Sep-04 19:11
anuchelvi5-Sep-04 19:11 
AnswerRe: How to link menu and dialog box? Pin
Arsalan Malik5-Sep-04 19:58
Arsalan Malik5-Sep-04 19:58 
GeneralRe: How to link menu and dialog box? Pin
anuchelvi5-Sep-04 22:16
anuchelvi5-Sep-04 22:16 

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.