|
There is a requirement to hide the vertical scrollbar of listbox .
|
|
|
|
|
There is a requirement to hide the vertical scrollbar of listbox when items exceed the display area. There is no option to hide vertical scrollbar but there is a option for to hide horizontal scroolbar.
|
|
|
|
|
Can't you remove the 'Verical scroll' style from the list box property, or remove WS_VSCROLL window style?
|
|
|
|
|
Hi im haveing CPtrList and im adding this list by gettign data from xlsheet.What happened after adding details to list,the list having the same last data.suppose the list count is 3,then 3 listitems are same data.Here the code
CPtrList GrPageList;
void CGraphConfig::OnImportgraph()
{
CString TempString,TempInfo,sExt;
int PointCount=0,iRow=0;
CString sFileName = _T("");
SGrPgConf *pDetl = new SGrPgConf;
if(pDetl == NULL)
{
AfxMessageBox("Memory Allocation Failure ");
return;
}
GrPageList.RemoveAll();
CFileDialog oFileOpen(1,"xls",0,0,"MicroSoft Excel Files(*.xls)|*.xls|Tag Detail Grid File(*.tdl)|*.tdl||");
oFileOpen.m_ofn.lpstrTitle="Import From...";
if(oFileOpen.DoModal() == IDOK)
sFileName=oFileOpen.GetPathName();
sExt=sFileName.Right(3);
sExt.MakeLower();
if(!strcmp(sExt,"xls"))
{
CExcelSheet TagDet(sFileName,"Sheet1",FALSE);
for(iRow=2;iRow <= TagDet.GetTotalRows();iRow++)
{
TagDet.ReadCell(TempString,1,iRow);
pDetl->iPageNo = atoi(TempString);
TagDet.ReadCell(TempString,2,iRow);
sprintf(pDetl->sPageTitle ,"%s",TempString);
TagDet.ReadCell(TempString,3,iRow);
sprintf(pDetl->sPanelDetail[0] ,"%s",TempString);
TagDet.ReadCell(TempString,4,iRow);
sprintf(pDetl->sPanelDetail[1] ,"%s",TempString);
GrPageList.AddTail(pDetl);
POSITION hPos = GrPageList.GetHeadPosition();
while(hPos)
{
SGrPgConf *pData = (SGrPgConf *)GrPageList.GetAt(hPos);
GrPageList.GetNext(hPos);
}
}
TagDet.Commit();
}
}
When i check the list the pData shows the same data(last row - pageno-3.0) three times,GrPageList count is 3.
My XLSheet shows like
PageNo PageTitle FirstKey SecKey
1.0 graph1 Group01 Group02
2.0 graph2 TREND01 TREND02
3.0 graph3 Group01 Group02
Pls help me..
Anu
modified on Thursday, February 24, 2011 1:17 AM
|
|
|
|
|
you are updating the value at the same pointer and adding the same pointer to the CPtrList every time. So all the entries point to same data.
Do SGrPgConf *pDetl = new SGrPgConf; inside the for loop. Remember to delete all entries in list when they are no longer needed.
for(iRow=2;iRow <= TagDet.GetTotalRows();iRow++)
{
SGrPgConf *pDetl = new SGrPgConf;
TagDet.ReadCell(TempString,1,iRow);
pDetl->iPageNo = atoi(TempString);
GrPageList.AddTail(pDetl);
}
|
|
|
|
|
It Works.Thank u so much.
Anu
|
|
|
|
|
In the following function replacing "number - 1" does not yield the same correct result as "--number"? Why is that so? Am I'm missing something?
int sum( int number )
{
int result;
if (number == 1)
return number;
else
{
result = sum(number - 1) + number;
return result;
}
}
|
|
|
|
|
--number changes the value of number, number - 1 does not.
say number is 10:
sum(number - 1) + number; is sum(9) + 10;
and
sum(--number) + number; is sum(9) + 9;
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
The first line was enough! Thank you very much! Sometimes, well maybe most of the time I'm so stupid. That's so obvious!
|
|
|
|
|
Being a bit pedantic here (but it's necessary!)...
Since the order of evaluation is not defined by the language spec, the compiler writer is free to choose, so your second example
sum(--number) + number; could come out either way (but number will always wind up decremented). There are lots of examples of confusion over this.
Cheers,
Peter
[edit]formatting[/edit]
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
I concur, at least for C. I just don't know for recent versions of C++.
And I would never write a statement like that.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
|
Hello
i am currently facing this problem, i am doing a kind of game where when the user presses a key like the 'a' key it makes jump the object, but how to detect key press in a way to know how much jump, if you press the key for a tiny time do a little jump or if you got pressed the button too much jump only a maximum.
Thanks
|
|
|
|
|
Check out the WM_KEYUP and WM_KEYDOWN messages.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
i know about this ones but how to get the time or do the logic for doing what i asked?
|
|
|
|
|
Did you read the documentation, specifically about bits 0-15 of the LPARAM parameter?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Oh i see, i wasn't reading the MSDN documentation :p
|
|
|
|
|
I am new at c++, and ;I am trying to use existing library that contains .c and .h files.This library also contain one test program.I have included all .c and .h files to my project. When i try to build my project I get the about 10 different "LNK2019: unresolved external symbol errors". maybe some one can help me figure this out.I have checked that .c and .h files contain these function i-e mzd_copy,mzd_echelonize_m4ri etc. I am using visual studio C++ .net 2008. I have uploaded my project at mediafire
http://www.mediafire.com/?6bcuo1tmg3smysc
the error i received are as follows:
Error 7 error LNK2019: unresolved external symbol _mzd_copy referenced in function "int __cdecl elim_test_equality(int,int)" (?elim_test_equality@@YAHHH@Z) test_elimination.obj
Error 6 error LNK2019: unresolved external symbol _mzd_echelonize_m4ri referenced in function "int __cdecl elim_test_equality(int,int)" (?elim_test_equality@@YAHHH@Z) test_elimination.obj
Error 4 error LNK2019: unresolved external symbol _mzd_echelonize_naive referenced in function "int __cdecl elim_test_equality(int,int)" (?elim_test_equality@@YAHHH@Z) test_elimination.obj
Error 3 error LNK2019: unresolved external symbol _mzd_echelonize_pluq referenced in function "int __cdecl elim_test_equality(int,int)" (?elim_test_equality@@YAHHH@Z) test_elimination.obj
Error 2 error LNK2019: unresolved external symbol _mzd_equal referenced in function "int __cdecl elim_test_equality(int,int)" (?elim_test_equality@@YAHHH@Z) test_elimination.obj
Error 1 error LNK2019: unresolved external symbol _mzd_free referenced in function "int __cdecl elim_test_equality(int,int)" (?elim_test_equality@@YAHHH@Z) test_elimination.obj
Error 9 error LNK2019: unresolved external symbol _mzd_init referenced in function "int __cdecl elim_test_equality(int,int)" (?elim_test_equality@@YAHHH@Z) test_elimination.obj
Error 8 error LNK2019: unresolved external symbol _mzd_randomize referenced in function "int __cdecl elim_test_equality(int,int)" (?elim_test_equality@@YAHHH@Z) test_elimination.obj
Error 5 error LNK2019: unresolved external symbol _mzd_top_echelonize_m4ri referenced in function "int __cdecl elim_test_equality(int,int)" (?elim_test_equality@@YAHHH@Z) test_elimination.obj
Error 10 fatal error LNK1120: 9 unresolved externals C:\Users\Ishtiaq\Documents\Visual Studio 2008\Projects\test333\Debug\test333.exe
|
|
|
|
|
Your function definition might be a mismatch with the function declaration. Make sure you are using the correct prototype.
The linker error indicates that your code is unable to find a matching function.
I am a HUMAN. I have that keyword in my name........
<marquee> _AnsHUMAN_</marquee>
|
|
|
|
|
Check the source file that contains all the functions with the _mzd_ prefix is being correctly compiled and included in the project.
I must get a clever new signature for 2011.
|
|
|
|
|
hello,
i am not able to download your project from the link you gave. anyway, is there any lib file and if so, did you include that in project settings->linker....
Regards,
A. Gopinath.
|
|
|
|
|
Hi,
Thank you everybody for the quick feedbacks.
Here is the link again. Its working.
http://www.mediafire.com/file/6bcuo1tmg3smysc/test333.rar[^]
I have confirmed that all of the implementations used in my test project are available in the source and their corresponding header files.
I have added all the required files to to my source and header folders of my project.
There are no pre-compiled .lib or .dll files. I have got all the necessary files in .c and .h format. The library also has extern C symbols added so that it can be compiled as a C++ code.
I can easily jump to function implementation in header file using "Go to definition" in VC++ editor from my test .cpp source file. But still nonetheless i am getting linking errors.
Kindly please have a look at the project source.
Thanks a million
Regards,
|
|
|
|
|
Please see my previous message. Your project has not included the files in the m4ri folder so the mzd functions are not being compiled. You should either add all these source files to your project, or create a project that compiles them into a .lib file (static library), and add that to your main project.
I must get a clever new signature for 2011.
|
|
|
|
|
Hi,
Thanks a lot for your quick reply.All of my .c and .h files are available in m4ri folder.
Will you please tell me that how I can create project that compiles them into a .lib file(static library), and how can I can add that to my main project.
Thanks a lot.
Regards,
Ishtiaq
|
|
|
|
|
Yes, I know they are available in the folder but unless you compile them into object code your program will never be built successfully. If you do not know how to create such a project then I suggest you go to the Visual Studio help pages and read up on the compiler and linker options for building different project types.
I must get a clever new signature for 2011.
|
|
|
|