|
it is
BOOL == 0 is FALSE
BOOL != 0 is TRUE
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi Everybody,
I have a question regarding "Using MFC in Win32 Application". I am using Visual Studio6.0. I want to use MFC in my Win32 Application. I started File->New->Win32 Application->A Simple Win32 Application. And I get the following code pasted below. Now I want to use MFC, say, CString, How do I do it? I tried to use as "CString str" and included the header file <afx.h> but of no use. It gives compile errors as "CString undeclared identifier" Can anybody help? Can anybody tell me which header files and .lib files to use, or any other settings to be made to the editor???
----------------------------------------------------------
// FirstSample.cpp : Defines the entry point
// for the application.
//
#include "stdafx.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
CString str;
return 0;
}
-----------------------------------------------------------
Regards
VYJU
|
|
|
|
|
after:
am using Visual Studio6.0. I want to use MFC in my Win32 Application. I started File->New->Win32 Application->A Simple Win32 Application. And I get the following code pasted below.
click the "Project" menu
then choose Settings.
In the "General" tab you will see that you project ins't currrently using MFC. You can choose to use MFC in a static LIBRARY or in a DLL. I f you choose to have it in a library you'll have to include these files in stdafx.h
:
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 #include #include <afxcmn.h> // MFC support for Windows Common
I haven't used MFC in a dll and I don't know if you have to include them there but i know that you won't have to carry all those DLL's if you want to check your app on a computer without VC++ installed
gabby
|
|
|
|
|
Hi,
File->New->Projects->MFC AppWizard(exe)
In the following dialogs you can choose some options.
HTH
Frank
|
|
|
|
|
here is a relevent snippets:
TCHAR buf[20];
fdwMode = ENABLE_LINE_INPUT |
ENABLE_ECHO_INPUT |
ENABLE_PROCESSED_INPUT;
SetConsoleMode(hStdin, fdwMode) ;
fdwMode = ENABLE_PROCESSED_OUTPUT;
SetConsoleMode(hStdout, fdwMode);
while (1)
{
WriteConsole(hStdout, "\npress [1] for codepage: ", 25, &ch, NULL);
ReadConsole(hStdin,buf,1,&ch,NULL);
buf[ch]='\0';
FlushConsoleInputBuffer(hStdin);
WriteConsole(hStdout, buf, 3, &ch, NULL);
}
the problem is that the first time while executes everything is ok:
i get on screen:
press [1] for codepage:
i enter 1 and press enter then it prints the character.
from this point something strange happens...
while loop continue to execute two more times despite the fact that ReadConsole() should wait for input...
anyone understand where is the problem?
|
|
|
|
|
cpeed wrote:
anyone understand where is the problem?
Considering you only request one char, and '1' + CR + LF is three chars...
|
|
|
|
|
but i using FlushConsoleInputBuffer() after call to ReadConsole()
and i using also ENABLE_PROCESSED_INPUT flag. the documantation says that in this case system processes the control keys and doesn't put them to input buffer
link
|
|
|
|
|
TO: Michael Dunn.
Thank you for your answer.
Eng. Menahem Menasheroff
|
|
|
|
|
please keep such replies in the thread of your question (i.e. reply directly to the helpful answer, do not create a new thread for this). Thank you.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
TO: Johan Rosengren
Thank you for your answer.
Eng. Menahem Menasheroff
|
|
|
|
|
Hi.
I am trying, unsuccessing, to operate the outp command in C++ (Visual Studio
Ver 6.0) through the address of the printer.
I have an OS windows XP.
I wrote: "outp(0x378,0x24);" trying to operate the LPT1 address, and nothing
happened.
Please, show me how to do it rigth.
Thank you.
Eng. Menahem Menasheroff
|
|
|
|
|
|
|
Hi all,
I would like to open a dialog box from a console application. Basically, I have an app that looks for new processes and if certain processes appear I want to pop up a dialog box.
Any pointers to tutorials, articles, sample code would be appreciated.
-bacon
|
|
|
|
|
You may want to instead consider building a standard Windows app that runs in the system tray a la anti-virus, firewall and similar daemon apps.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
Check my article about the Simple fireawall that's monitoring processes.
gabby
|
|
|
|
|
Hi,
Look for the article below.
Enumerating processes : A practical approach
http://www.codeproject.com/threads/processes.asp
It can list all the running processes. From the list search for the process you are looking for.
Regards
|
|
|
|
|
Hi,
I'd like to use a XML parsing library (http://www.codeproject.com/soap/markupclass.asp) that uses CString (I guess that's the only MFC thing it uses). I'd like to use it in a pure WinAPI app, is there a way to add CString there ? (which files/libs to link, never worked with MFC really). An alternate solution would be another XML library.
Thanks for your answers
|
|
|
|
|
CString w/o MFC? No!
I Thought I saw CString equivalent here at CP some where, or you could write your own.
INTP
|
|
|
|
|
Thanks... I found it at http://www.codeproject.com/string/stdstring.asp... seems nice, unfortunately it also uses CArray (I'm currently looking if I might replace it somehow myself). Still if you new a way to add MFCs CArray (and CString eventauly) to a non-mfc project (I guess I'll have to link to the MFC dll anyway... All I need it to do is to be a WinAPI app that makes use of MFC... sounds weird, doesn't it... )
|
|
|
|
|
John R. Shaw wrote:
CString w/o MFC? No!
IIRC, CString is nowadays (also) under the CPL - MS made it part of the WTL library which they made free software.
|
|
|
|
|
In VC7.x CString is a shared class that is shared between MFC and ATL. AFAIK all you have to do is #include <atlstr.h> and you can use CString in non MFC apps. If you are using VC6 you are SOL.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
|
Could you also, please please please, tell me if it has this CArray? Before I download and install it... Thanks
|
|
|
|