|
I wonder if getchar() or _getche() would be better suited for this.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
use the command "getch()"(conio.h) to input characters from the keyboard(this function goes not display them on the screen),then when u take in a character using getch() command,write a code in such a way that it simultaneously displays a charcter that u want to be displayed using a character display command(use any display command)
hope that helpz.....
happy programmin.....
cheerz.....
|
|
|
|
|
by the way.....u have to change the cin code coz the the cin command is basically used to get it a string of data and it keeps on taking in the data till and enter key is pressed(not to mention,if there r spaces between the string that u have written then only till where the space is encountered is passed to the variable).....moreover the cin command "echoes" the characters on the screen.....
use the getch() command.....it takes in only one character.....so if u want to keep getting in data like cin command then u have to make a loop in such a way that it keeps on accepting characters till and enter character is encountered.....why i say to use getch() is becoz it doesnt display the characters on the screen and therefore u can use an another command along with this (in the loop) to keep displaying the characters(cout<
|
|
|
|
|
Hello,
I have made a Visual C++ 6 application that runs under Windows 2000 Professional.
The fact is that this app runs smooth, but after two days of continuous working it appears the typical message: "not enough virtual memory..." (or something like that (I can read it in spanish)).
I cannot stop the computer each day because the software is part of a machine that must work 24 hours per day.
Any idea?
Thank you in advance.
PS:
I've tried rational purify plus, but it shows me some leakages that are not real leaks. It seems that it cannot go through intelligent pointers and other kind of VC++ stuff.
|
|
|
|
|
try using _CrtMemDifference() and its helper functions to determine if memory is different before and after a function call. If so, write it out to a text file, with name of function (I think you can use __function__ or something like that). maybe that will not be the best course of action, but it might get you closer. The best way I can think of would be to have a debug version running, and whenever it reports a memdifference, have the program break, so that you can see where this memory allocation is occurring at.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
This is a typical Handles consume.
Try to free handles for exmaple if you are using FindFirstFile and FindNextFile You need to call a FindClose after finish your process.
Also, search for all the functions that produce handles direct or indirect and make the release function if necesary.
Watch in the Task Manager to see the Handles consume and where they are not incremented You problem will be resolved.
|
|
|
|
|
Hello,
I’m looking for a slider that has the pointer invisible until the first time user clicks on it. Can anybody help me?
Thanks ahead.
teneff
|
|
|
|
|
If the pointer is initially invisible, how would the user know to click on it to make the pointer appear?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Well, it is just the pointer invisible, the rest of the slider is there. The user should evaluate some question, but if the pointer of the slider is showing anywhere in the slider range the user has an initial value to hold on witch is not so desired. I can send you a GUI jpg via email to give you a better view of the problem.
teneff
|
|
|
|
|
teneff wrote:
Well, it is just the pointer invisible, the rest of the slider is there.
I understand that part. But a slider control without the "pointer" no longer looks like a slider control. Correct? I'm curious how the user would know to click the slider control in order to get the "pointer" to display. That just seems counter-intuitive.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Need help please. Sorry for long and tedious introduction.
In Win32 API the OpenFileDialog runs by initializing the OPENFILENAME struct. (quote msdn) a buffer provided in the ofn.lpstrFile member holds all the file info including path. The ofn.lpstrFileTitle holds the name of the file and ofn.MaxFile member points to the offset in the string contained in lpstrFile where the filename is located.
If ofn.dwFlags is provided with the OFN_ALLOWMULTISELECT flag ,one is able to select multiple files at a time ,which all are contained-separated by '\0'- in the lpstrFile buffer. So this would look someting like
"C:\programs\myapp\0file1.txt\0file2.txt\0"
msdn states that if the multiselect-flag is NOT set,than the system takes the path info from the lpstrFile buffer. However,this seems not to be the case when the multiselect flag is set. It seems that in multi-mode directory information is no longer preserved. Sadly msdn doesn't touch this subject, does anyone know if ,and how the path info in case of multiselect is stored?
For processing more selected files, I read them out of the buffer one at a time and strcat them to the path,yielding a usable file-identifier. Problem however is that if I select files from directories that are further from the root,and with many characters in their name, these files seem to be invalid as the system doesn't process them any more.
As this smells of a buffer undersize,I tried enlarging sizes of various buffers and intermediate var's but however, with no success up to now. Maybe someone has a tip?
I.m currently ona Win2k system
thanx in advance
|
|
|
|
|
henry128 wrote:
However,this seems not to be the case when the multiselect flag is set. It seems that in multi-mode directory information is no longer preserved. Sadly msdn doesn't touch this subject, does anyone know if ,and how the path info in case of multiselect is stored?
This works for me:
OPENFILENAME ofn = {0};
char szBuffer[4096] = {0},
szPath[MAX_PATH];
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.lpstrFilter = "All Files (*.*)\0*.*\0";
ofn.lpstrFile = szBuffer;
ofn.nMaxFile = sizeof(szBuffer);
ofn.Flags = OFN_ALLOWMULTISELECT | OFN_EXPLORER;
if (GetOpenFileName(&ofn) != FALSE)
{
lstrcpy(szPath, ofn.lpstrFile);
ofn.lpstrFile += ofn.nFileOffset;
while (*(ofn.lpstrFile) != '\0')
{
TRACE("%s\\%s\n", szPath, ofn.lpstrFile);
ofn.lpstrFile += lstrlen(ofn.lpstrFile) + 1;
}
} However, without a code snippet showing what you have (tried), it's hard to suggest a solution.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I want to get the Security Options which are found in MMC snap in Group Policy.
What API function can i use.
Yuvaraj N
|
|
|
|
|
who has sourcecode-project SMTP in Mail? please give me
long
|
|
|
|
|
Try here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
P.J. Naughter has sample project here and at www.naughter.com
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|
|
I make a html view project. In the project, i want to edit it as WYCIWYG method and the problem comes when i want to save the file(html files) that i've edited.
Any algorithm or a simple source code that i can learn?
Anyway thanks.
Efendy_ma
|
|
|
|
|
Using a CFile object comes to mind. If you are not using MFC, there's also CreateFile() and WriteFile() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi all,
I am doing a MFC Application..There is a Button in the Dialog.(Button Name is "create Access Database")
When I click the Button ,I want to create a Access Database and make a link with that database..
How do I do that?
any one know this,please help me..
Thanks in advance..
|
|
|
|
|
1. Learn to be patient. You asked this earlier today.
2. Learn to use MSDN search engine.
Goto Microsoft's Developer Network[^] site, and in the "Search MSDN for" box, type in
Create access database c++
and press 'Go'. This will bring up at least one article explaining how to do this using DAO. If you want to use OLE DB instead, try
JET database c++ "OLE DB"
as your query.
MS are recommending OLE DB or ADO over JET/DAO and ODBC for "portability" reasons (JET won't be supported on Win64).
You could also try and get hold of either
Database Programming with Visual C++ 6 in 21 days (Sams)
or
Visual C++ 6 Database Programming Tutorial by Wendy Sarrett, although my copy is a Wrox Press book, and they don't do it any more. Amazon might have used ones though...
Steve S
Developer for hire
|
|
|
|
|
How do i get the User Names and other details of users in a Win 9x system. It seems NetUserEnum is not supported in 9x.
Yuvaraj N
|
|
|
|
|
I can Tell you the way to get every User account present in the computer but other details i can't.
actually Win9x treat Every user same, ie ADMIN as it has full control over computer.
this is way you can Find all theuser present in you computer ,but remember this is hack.
you have to enumerate the Key Under HKEY_USERS section ,is Key name is equivalent to Username.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi All,
When I am linking my one of the module i am getting the following error during link operation:
Copyright (C) Microsoft Corporation. All rights reserved.
/MAP /NODEFAULTLIB /OPT:NOREF /RELEASE /DEBUG:notmapped,full /SUBSYSTEM:CONSOLE /DLL -out:../wntmsci10.pro/bin/sal3.dll -map:../wntmsci10.pro/misc/sal3.map -def:../wntmsci10.pro/misc/sal3.def -implib:../wntmsci10.pro/lib/isal.lib ..\wntmsci10.pro\slo\sal3_version.obj ..\wntmsci10.pro\slo\sal3_description.obj ..\wntmsci10.pro\slo\dllentry.obj ..\wntmsci10.pro\slb\sal.lib uwinapi.lib advapi32.lib wsock32.lib mpr.lib shell32.lib comdlg32.lib user32.lib ole32.lib msvcrt.lib uwinapi.lib kernel32.lib user32.lib oldnames.lib ..\wntmsci10.pro\misc\sal3.res
LINK : warning LNK4224: /DEBUG:NOTMAPPED is no longer supported; ignored
../wntmsci10.pro/misc/sal3.def(2) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored
../wntmsci10.pro/misc/sal3.def(3) : warning LNK4017: DATA statement not supported for the target platform; ignored Creating library ../wntmsci10.pro/lib/isal.lib and object ../wntmsci10.pro/lib/isal.exp
sal.lib(unload.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl _STL::__stl_throw_length_error(char const *)" (__imp_?__stl_throw_length_error@_STL@@YAXPBD@Z) referenced in function "protected: void __thiscall _STL::_Vector_base<void *,s
truct MyAllocator<void *> >::_M_throw_length_error(void)const " (?_M_throw_length_error@?$_Vector_base@PAXU?$MyAllocator@PAX@@@_STL@@IBEXXZ)
sal.lib(macro.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl _STL::__stl_throw_length_error(char const *)" (__imp_?__stl_throw_length_error@_STL@@YAXPBD@Z)
sal.lib(unload.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned int const * const _STL::_Stl_prime<bool>::_M_list" (__imp_?_M_list@?$_Stl_prime@_N@_STL@@2QBIB) referenced in function "private: unsigned int __thiscall _STL::hashtable<struct _STL::pair<void * const,struct _STL::pair<unsigned long,unsigned char (__cdecl*)(struct TimeValue *)> >,void *,struct hashModule,struct _STL::_Select1st<struct _STL::pair<void * const,struct _STL::pair<unsigned long,unsigned char (__cdecl*)(struct TimeValue *)> > >,struct _STL::equal_to<void *>,struct MyAllocator<void *> >::_M_next_size(unsigned int)const " (?_M_next_size@?$hashtable@U?$pair@QAXU?$pair@KP6AEPAUTimeValue@@@Z@_STL@@@_STL@@PAXUhashModule@@U?$_Select1st@U?$pair@QAXU?$pair@KP6AEPAUTimeValue@@@Z@_STL@@@_STL@@@2@U?$equal_to@PAX@2@U?$MyAllocator@PAX@@@_STL@@ABEII@Z)
sal.lib(macro.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned int const * const _STL::_Stl_prime<bool>::_M_list" (__imp_?_M_list@?$_Stl_prime@_N@_STL@@2QBIB)../wntmsci10.pro/bin/sal3.dll : fatal error LNK1120: 2 unresolved externals
dmake: Error code 96, while making '../wntmsci10.pro/bin/sal3.dll'
echo: No match.
ERROR: Error 65280 occurred while making /cygdrive/c/oo/sal/util
dmake: Error code 1, while making 'build_all'
echo: No match.
Can anybody explain me that due to which function or member variable i am getting this linker error
Thanks In advance
Bye
Nitin Mahajan
|
|
|
|
|
Hi all,
I'm using tooltip in an MFC ActiveX Control Project. I have added Handler for TTN_NEEDTEXT Notification Message. But this Notification is not calling. I tried in an SDI Application. It works.. Could anyone tell the solution
BEGIN_MESSAGE_MAP(CEx1Ctrl, COleControl)
//{{AFX_MSG_MAP(CEx1Ctrl)
ON_WM_MOUSEMOVE()
ON_WM_PAINT()
ON_WM_SIZE()
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNeedText)
ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
END_MESSAGE_MAP()
regards
Rajesh
|
|
|
|
|
Does EnableToolTips() need to be called? Is their a group box surrounding the control?
Rajesh_Parameswaran wrote:
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNeedText)
Try this instead:
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNeedText)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNeedText)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|