Click here to Skip to main content
15,889,909 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWTL and Splitters Pin
Alpesh30-Jun-01 0:53
Alpesh30-Jun-01 0:53 
GeneralProgrammatically sending mails Pin
Vikash Dubey30-Jun-01 0:17
Vikash Dubey30-Jun-01 0:17 
GeneralRe: Programmatically sending mails Pin
Alpesh30-Jun-01 0:57
Alpesh30-Jun-01 0:57 
GeneralRe: Programmatically sending mails Pin
NullStream30-Jun-01 21:52
NullStream30-Jun-01 21:52 
GeneralCStatusBar member function problem! Pin
Rickard Andersson2029-Jun-01 23:25
Rickard Andersson2029-Jun-01 23:25 
GeneralRe: CStatusBar member function problem! Pin
Michael Martin30-Jun-01 0:14
professionalMichael Martin30-Jun-01 0:14 
QuestionHow can I use LockWorkStation? Pin
29-Jun-01 22:28
suss29-Jun-01 22:28 
AnswerRe: How can I use LockWorkStation? Pin
29-Jun-01 23:28
suss29-Jun-01 23:28 
I used this and it works. Most probably the first 3 lines are missing from your code (the 'defines" Smile | :) )...

//	Windows 2000 required for LockWorkStation
#define _WINVER			0x0500
#define _WIN32_WINNT	0x0500

#include <Windows.h>
#ifdef _DEBUG
	#include <ConIO.h>
#endif
#include <StdIO.h>

VOID Error_DisplayLastW(
	IN LPCWSTR pwszMsg
);

int
main(
	IN int	argc,
	IN char **argv
)
{
	__try
	{
		puts("Preparing to lock workstation...\n");
		if(!LockWorkStation())
		{
			Error_DisplayLastW(L"LockWorkStation");
			__leave;
		}
		puts("Workstation unlocked.\n");
	}
	__finally
	{
		puts("Finally.\n");
	}

	puts("Exiting.\n");

	return 
#ifdef _DEBUG
	!_getch()
#else
	0
#endif
	;

	argc;
	argv;
}

VOID
Error_DisplayLastW(
	IN LPCWSTR pwszMsg
)
{
	LPWSTR pwszMessage;

	if(FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL,
		GetLastError(), 0, (LPWSTR)&pwszMessage, 0, NULL))
	{
		fprintf(stdout, "%S %S\n", pwszMsg ? pwszMsg : L"", pwszMessage);
		LocalFree(pwszMessage);
	}
}

GeneralAn edit problem... Pin
29-Jun-01 23:31
suss29-Jun-01 23:31 
GeneralBut I am really stupid Pin
29-Jun-01 23:32
suss29-Jun-01 23:32 
GeneralAbout ActiveX Print! Pin
29-Jun-01 17:59
suss29-Jun-01 17:59 
GeneralRe: About ActiveX Print! Pin
Hadi Rezaee30-Jun-01 2:23
Hadi Rezaee30-Jun-01 2:23 
GeneralRe: About ActiveX Print! Pin
2-Jul-01 23:13
suss2-Jul-01 23:13 
GeneralProblem adding new caption button to title bar! HELP!!! Pin
29-Jun-01 14:28
suss29-Jun-01 14:28 
GeneralRe: Problem adding new caption button to title bar! HELP!!! Pin
Ben Burnett29-Jun-01 16:53
Ben Burnett29-Jun-01 16:53 
GeneralMFC DLL and Dialogs Pin
Peter Marino29-Jun-01 13:53
Peter Marino29-Jun-01 13:53 
GeneralRe: MFC DLL and Dialogs Pin
29-Jun-01 15:40
suss29-Jun-01 15:40 
GeneralRe: MFC DLL and Dialogs Pin
29-Jun-01 16:26
suss29-Jun-01 16:26 
GeneralRe: MFC DLL and Dialogs Pin
Peter Marino29-Jun-01 20:38
Peter Marino29-Jun-01 20:38 
GeneralRe: MFC DLL and Dialogs Pin
Peter Marino29-Jun-01 20:37
Peter Marino29-Jun-01 20:37 
GeneralRe: MFC DLL and Dialogs Pin
D.D. de Kerf1-Jul-01 20:32
D.D. de Kerf1-Jul-01 20:32 
QuestionPassing ADO Conn Thru' interface?? Pin
Popsy29-Jun-01 12:21
Popsy29-Jun-01 12:21 
GeneralComunication Between Programs Pin
Anders Molin29-Jun-01 11:51
professionalAnders Molin29-Jun-01 11:51 
GeneralRe: Comunication Between Programs Pin
Ben Burnett29-Jun-01 17:23
Ben Burnett29-Jun-01 17:23 
GeneralPushing Buttons Pin
RobJones29-Jun-01 11:36
RobJones29-Jun-01 11:36 

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.