Click here to Skip to main content
15,891,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: message box..... Pin
Robert A. T. Káldy17-Feb-04 1:09
Robert A. T. Káldy17-Feb-04 1:09 
GeneralSocket problem... Pin
Prakash Nadar16-Feb-04 22:40
Prakash Nadar16-Feb-04 22:40 
GeneralRe: Socket problem... Pin
alex120516-Feb-04 23:11
alex120516-Feb-04 23:11 
GeneralRe: Socket problem... Pin
Prakash Nadar16-Feb-04 23:33
Prakash Nadar16-Feb-04 23:33 
QuestionHow to get good formatted text in Browser Control? Pin
vinjamsailendrachowdary16-Feb-04 22:35
vinjamsailendrachowdary16-Feb-04 22:35 
GeneralProblem with MessageBox Pin
JGStanier16-Feb-04 22:28
JGStanier16-Feb-04 22:28 
GeneralRe: Problem with MessageBox Pin
Prakash Nadar16-Feb-04 22:41
Prakash Nadar16-Feb-04 22:41 
GeneralRe: Problem with MessageBox Pin
JGStanier16-Feb-04 23:09
JGStanier16-Feb-04 23:09 
Its an implicitly loaded DLL. The DLL code is as follows (NB its not my code, I got it out of a book):
/*Module: MyLibFile1.cpp*/
#include <windows.h>

#define MYLIBAPI extern "C" __declspec(dllexport)

#include "MyLibFile.h"

int g_nResult;

int Add(int nLeft, int nRight)
{
	g_nResult = nLeft + nRight;
	return(g_nResult);
}

The header file is:
/*Module: MyLib.h*/
#ifndef MYLIBAPI

#define MYLIBAPI extern "C" __declspec(dllimport)

#endif

MYLIBAPI int g_nResult;

MYLIBAPI int Add(int nLeft, int nRight);

And the main code that includes the MessageBox() is as follows:
/*Module: MyExeFile1.cpp*/
#include <windows.h>
#include "..\MyLibFile\MyLibFile.h"

int WINAPI WinMain(HINSTANCE hinstExe, HINSTANCE, LPTSTR pszCmdLine, int)
{
	int nLeft = 10, nRight = 25;

	TCHAR sz[100];
	wsprintf(sz, TEXT("%d + %d = %d"), nLeft, nRight, Add(nLeft, nRight));
	MessageBox(GetActiveWindow(), sz, TEXT("Calculation"), MB_OK);
	DWORD Error = GetLastError();

	wsprintf(sz, TEXT("The result from the last Add is: %d"), g_nResult);
	MessageBox(NULL, sz, TEXT("Last Result"), MB_OK);
	return(0);
}
Smile | :)
GeneralRe: Problem with MessageBox Pin
JGStanier16-Feb-04 23:16
JGStanier16-Feb-04 23:16 
GeneralRe: Problem with MessageBox Pin
Selvam R16-Feb-04 23:45
professionalSelvam R16-Feb-04 23:45 
GeneralRe: Problem with MessageBox Pin
JGStanier16-Feb-04 23:50
JGStanier16-Feb-04 23:50 
GeneralRe: Problem with MessageBox Pin
Prakash Nadar16-Feb-04 23:37
Prakash Nadar16-Feb-04 23:37 
GeneralRe: Problem with MessageBox Pin
JGStanier16-Feb-04 23:44
JGStanier16-Feb-04 23:44 
GeneralGetting Output Parameter from _CommandPtr Pin
alex120516-Feb-04 21:50
alex120516-Feb-04 21:50 
GeneralRe: Getting Output Parameter from _CommandPtr Pin
RChin16-Feb-04 23:02
RChin16-Feb-04 23:02 
GeneralRe: Getting Output Parameter from _CommandPtr Pin
alex120517-Feb-04 16:38
alex120517-Feb-04 16:38 
GeneralCEdit focus problem Pin
Niko Tanghe16-Feb-04 21:20
Niko Tanghe16-Feb-04 21:20 
GeneralRe: CEdit focus problem Pin
Selvam R16-Feb-04 23:58
professionalSelvam R16-Feb-04 23:58 
GeneralRe: CEdit focus problem Pin
David Crow17-Feb-04 3:03
David Crow17-Feb-04 3:03 
GeneralRouting jobs to Multiple trays in a printer Pin
Member 64506716-Feb-04 21:10
Member 64506716-Feb-04 21:10 
QuestionWhat is the difference between Tab Control and Property Sheet?Is there any advantages and dis between these two? Pin
P_JAYAPRAKASH16-Feb-04 21:09
P_JAYAPRAKASH16-Feb-04 21:09 
AnswerRe: What is the difference between Tab Control and Property Sheet?Is there any advantages and dis between these two? Pin
Prakash Nadar16-Feb-04 22:07
Prakash Nadar16-Feb-04 22:07 
GeneralMFC Dialog app and ShellExecute() Pin
Steve Messer16-Feb-04 20:20
Steve Messer16-Feb-04 20:20 
GeneralRe: MFC Dialog app and ShellExecute() Pin
Prakash Nadar16-Feb-04 20:41
Prakash Nadar16-Feb-04 20:41 
GeneralRe: MFC Dialog app and ShellExecute() Pin
Steve Messer16-Feb-04 20:51
Steve Messer16-Feb-04 20:51 

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.