Click here to Skip to main content
15,918,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Debugging an ATL Dll using a manged application Pin
Rainer Mangold21-Oct-03 11:39
Rainer Mangold21-Oct-03 11:39 
GeneralDynamically creating variable length argument list Pin
Kentamanos21-Oct-03 9:47
Kentamanos21-Oct-03 9:47 
GeneralRe: Dynamically creating variable length argument list Pin
David Crow21-Oct-03 10:01
David Crow21-Oct-03 10:01 
GeneralRe: Dynamically creating variable length argument list Pin
21-Oct-03 10:12
suss21-Oct-03 10:12 
GeneralRe: Dynamically creating variable length argument list Pin
David Crow21-Oct-03 11:02
David Crow21-Oct-03 11:02 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos21-Oct-03 11:27
Kentamanos21-Oct-03 11:27 
GeneralRe: Dynamically creating variable length argument list Pin
David Crow21-Oct-03 17:06
David Crow21-Oct-03 17:06 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos22-Oct-03 6:38
Kentamanos22-Oct-03 6:38 
I created a Win32 Console App to test this approach, and it created garbage for me. Did you get this method to work? Here is the code I used:

#include <windows.h>
#include <tchar.h>
#include <stdio.h>

int MyWsprintf( LPTSTR lpOut, LPCTSTR lpFmt, ...) 
{	 
	va_list list;	  
	int	nReturn;	 
	va_start(list, lpFmt);	  
	nReturn	= wsprintf(lpOut, lpFmt, list);	   
	va_end(list);	  
	return nReturn;
}


int _tmain(int argc, _TCHAR* argv[])
{
	char buf[1024];

	MyWsprintf(buf, "%s %s %s", "test1", "test2", "test3");

	printf(buf);
}
</code>


If I change the call of MyWsprintf to the real wsprintf, it works great, indicating the problem is in the rewrite.
GeneralRe: Dynamically creating variable length argument list Pin
David Crow22-Oct-03 7:34
David Crow22-Oct-03 7:34 
GeneralRe: Dynamically creating variable length argument list Pin
WREY21-Oct-03 11:26
WREY21-Oct-03 11:26 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos21-Oct-03 11:47
Kentamanos21-Oct-03 11:47 
GeneralRe: Dynamically creating variable length argument list Pin
WREY21-Oct-03 12:58
WREY21-Oct-03 12:58 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos21-Oct-03 13:19
Kentamanos21-Oct-03 13:19 
GeneralRe: Dynamically creating variable length argument list Pin
WREY21-Oct-03 14:23
WREY21-Oct-03 14:23 
GeneralRe: Dynamically creating variable length argument list Pin
Kentamanos22-Oct-03 6:41
Kentamanos22-Oct-03 6:41 
GeneralRe: Dynamically creating variable length argument list Pin
John R. Shaw21-Oct-03 15:21
John R. Shaw21-Oct-03 15:21 
GeneralC++ Question. Pin
WREY21-Oct-03 9:41
WREY21-Oct-03 9:41 
GeneralRe: C++ Question. Pin
David Crow21-Oct-03 9:46
David Crow21-Oct-03 9:46 
GeneralRe: C++ Question. Pin
WREY21-Oct-03 10:30
WREY21-Oct-03 10:30 
GeneralRe: C++ Question. Pin
Andrew Walker21-Oct-03 14:05
Andrew Walker21-Oct-03 14:05 
GeneralRe: C++ Question. Pin
John R. Shaw21-Oct-03 15:55
John R. Shaw21-Oct-03 15:55 
GeneralRe: C++ Question. Pin
WREY21-Oct-03 23:35
WREY21-Oct-03 23:35 
GeneralSpecified the path with Cfiledialog Pin
sdfdsfa21-Oct-03 8:37
sdfdsfa21-Oct-03 8:37 
GeneralRe: Specified the path with Cfiledialog Pin
David Crow21-Oct-03 9:44
David Crow21-Oct-03 9:44 
GeneralRe: Specified the path with Cfiledialog Pin
Anonymous21-Oct-03 18:33
Anonymous21-Oct-03 18:33 

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.