|
I'm not sure I understand exactly what symptom you are describing. When you "grab" the vertical line between the column headings and drag it left or right, the data in the columns should adjust automatically. Are you saying that if a column was too small, and you then widened it, the data in the column would still not be totally visible? If so, I've never seen a list control behave in this fashion.
|
|
|
|
|
before resize
after resize
after resize
how can i detect when I finish resizing column of listview?
I mean: when I finish resize colummns of listview... i will send a message to instruct listview repaint immediately
thanks
|
|
|
|
|
|
Your code compiled fine but when I ran it, clicking OK on the login box caused it to crash.
Have you tried creating just a small, plain project with nothing in it but a list control? Weeding out all the superfluous stuff usually helps!
|
|
|
|
|
crash?????
can you tell me what kind of errors?
I am using WinXPpro
when i login, i dont encounter any error
|
|
|
|
|
The instruction at 0x00400038 referenced memory at 0x00000001. The memory could not be written.
I'm curious why all of the ODBCxxx() functions return TRUE even though I have no SQL stuff on my machine.
|
|
|
|
|
sorry, I am a beginner of Visual C++
I have learnt for about 6 months
I should to do what when return of ODBCxxx function()
thank you
and list view ....can you tell me the way to auto redraw client area of listview???
|
|
|
|
|
ODBCConnectToSource() looks good as it only returns TRUE if all of the SQLxxx() functions succeeded.
ODBCCheckPassword() looks good as it returns FALSE if the passwords do not match.
ODBCSelectDateInCalendar() has many opportunities for failure, yet it always returns TRUE. Same for ODBCAddDateToWndCombo(), ODBCDeleteDiary(), ODBCAddUserNameToDlgCombo(), ODBCInsertToListTable(), ODBCInsertToListTable(), ODBCDeleteRecordInListTable(), ODBCSelectContentFromListTable(), ODBCSelectContentToEdit(), and ODBCUpdateListRecord(). If you are just assuming that all of these functions will always be successful, you are in for a rude awakening.
|
|
|
|
|
thank you very much
and My ListView ??????? how can i fix it to REDRAW auto ?
|
|
|
|
|
Like I already mentioned here, since I've never experienced this problem, I can't offer any solution.
|
|
|
|
|
ODBCConnectToSource() and ODBCCheckPassword() MUST be return FALSE or TRUE and other functions.......First at all, I planed to declare those function as VOID because I dont want return a value, but after that I changed all those function to BOOL and so........I return all to TRUE
so that, there is a difference between VOID function and BOOL function which return TRUE? >> I think it's similar because I dont need results of BOOL function which always return TRUE (expect ODBCConnectToSource() and ODBCCheckPassword())
...... And what you mean when you said
"I'm curious why all of the ODBCxxx() functions return TRUE even though I have no SQL stuff on my machine."
you mean : "you Windows doesn't have ODBC drivers to run My App" ?
Can you give me any your code to learn about Visual C++ ???
thank a lot ?
|
|
|
|
|
_skidrow_vn_ wrote:
there is a difference between VOID function and BOOL function which return TRUE?
In this particular instance, no. If the BOOL functions are all returning TRUE, but you are doing nothing with this value, the effect is the same as a VOID function.
_skidrow_vn_ wrote:
...... And what you mean when you said
"I'm curious why all of the ODBCxxx() functions return TRUE even though I have no SQL stuff on my machine."
you mean : "you Windows doesn't have ODBC drivers to run My App" ?
I do have ODBC drivers, but I have no DSNs. Therefore, when your ODBCxxx() functions are trying to connect to a data source, I would expect an error message of some sort. Instead, those functions all return TRUE and the rest of the code assumes everything is fine.
|
|
|
|
|
Well,I saw my errors when I run my App in Window98
err msg look like this: (when I push OK or CANCEL button)
Error1
Error2
Error3
Error4
but when I ran it in my Window XP professional. It login OKAY
"but I have no DSNs" >> what does you mean
|
|
|
|
|
I am writing an MDI application with MFC in VC++ 6.0. I have a (scroll)view class which plots some graphs using data from the document. When I resize the view it flickers quite a lot. Is there any technique that I can use to avoid this? My code is farily standard, doing all its drawing in OnDraw(). I notice that certain apps e.g. VisualStudio and Excel don't seem to have this problem. Also if I resize the main frame, without maximizing the view, if happens flicker-free. How do I implement this in my view?
Thanks in advance for any help.
|
|
|
|
|
The best solution is to simply implement a class that someone has done which features non-flickering upon resize. Otherwise, one possible solution is to not draw the window until resize is complete.
SetRedraw()
Kuphryn
|
|
|
|
|
|
You need to handle OnEraseBkgnd(), because by default if fills the whole client area before OnDraw() is called (flicker flicker). One solution is to disable background erasing and handle all you drawing in OnDraw().
Note: Even if you use a memory DC to try prevent flickering it will still occur if you do not over-ride OnEraseBkgnd().
Trust in the code Luke. Yea right!
|
|
|
|
|
I'm trying to read the command line argument, if the user enters
/s, my program is supposed to do something.
I have:
if(m_lpCmdLine[0] == '/s')
but == does not work for this compare.
m_lpCmdLine[0] is of type LPTSTR. I don't know how to say if the command argument equals /s.
|
|
|
|
|
If your are in MFC,
do something like that in InitInstance():
CString str=GetCommandLine();
if (str.Find("/s")!=-1)
{
code for /s option
}
If not, and your command line is a LPTSTR,
use
if (strstr(m_lpCmdLine[0],"/s")!=NULL)
{
code for /s option
}
You can also use strcmp instead of strstr, but then your command line would be only "/s" to enter the if scope, whereas with this example, you could also have "/s /p -j 897" (it is a substring search, and no direct comparison)).
~RaGE();
|
|
|
|
|
You are almost correct. But remember that when dealing with LPTSTR and TCHAR (as is the case here) you need to use routines from TCHAR.H to avoid problems in Unicode, e.g., _tcsstr instead of strstr and _tcscmp instead of strcmp.
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
Use strcmp function to compare strings (or wcscmp for UNICODE). Also, the constant you compare to should be written as "/s" (or _T("/s") for UNICODE).
|
|
|
|
|
m_lpCmdLine[0] is a single character. '/s' is two characters. They are obviously not going to match!
|
|
|
|
|
To check if a string equals another one:
if(strcmp(m_lpCmdLine, "/s") == 0) <what-you-wanna-do-if-it-equals> But you shouldn't do it like this. I suggest you use a command line parser like http://www.codeproject.com/cpp/CmdLineParser.asp[^] (excellent one, try it!).
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
if(!strcmp(m_lpCmdLine[0], "/s"))
or
if(strcmp(m_lpCmdLine[0], "/s") == 0)
choose what you want
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You need to use TCHAR routines. Ther eis a corresponding TCHAR routine for each of the standard "str" functions. So to compare:
if(_tcscmp(m_lpCmdLine, _T("/s")) == 0)
{
}
Some of the previous comments about using strcmp are technically incorrect, since it would fail for Unicode builds (LPTSTR is an array of TCHARS, not chars!) But as also noted, this is probably not the best way to parse your command line - take a look at the documentation for ParseCommandLine.
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|