|
I just put over 30 random characters in the item column and the problem is really on the first and last line. ONLY when the mouse is over the first character in the field it will get selected.
I give up.
Cheers
Vaclav
|
|
|
|
|
Here is a crazy update.
Now I cannot even select by "howering " over the first letter! But I can change / edit the item by moving the mouse to the left until I get "regular" focus. I deffinetly have an issue with my VC 6.0.
Case closed.
|
|
|
|
|
Question has been solved
Thanks everyone for those comments it helped me a lot, I am considering users here asthe most amazing users ever!
oky I have a list view (using MDI also) and I am drawing everything from scratch, everything works amazingly, but recently when i tried to print tons of data, i the list went crazy, and it seems the whole app went crazy not just the listview, I tried to disable all the features in my app and that bug still there
basically the program has a highlight row and that row in blue, that bug changes it to another color, and i cannot use the editing text method and when I minimize the list, it does not come back, as if the whole program got busted?
bty, its not form custom draw cuz i did check every single line...
http://oi43.tinypic.com/25zibrl.jpg[^]
what made it weird that even the menu went black? i am sure that if it a listview problem it wont change the menu color?? is the listview has a specific stack size or heap size in onwerdata? i dunno what i am saying but the list works fine in some cases except when i deal with more data,
any ideas why that happens?
edit1:
I tried update the whole list with the whole program and nothing happened (if it paints issues redrawing the whole app will help but did not work here?)
edit2:
some has almost same problem and he wrote (I am using a CListView in my application. When I run the application and it gets a lot of items in it's CListView (3 or 4 thousand at least) the application's windows go all stange. From then after all Menus in all applications (including taskbar and desktop menus) are displayed with black bars over most of their items, moving the mouse down over them removes most of the black bars.
Thanks for any help.)
but no one answered him?
modified 21-Aug-13 17:27pm.
|
|
|
|
|
Hi,
I'm not certain if this is the problem but you say that the problem started when you wanted to show a lots of data, you also mentioned that you draw the list yourself. (Custom draw)
It could be that you are running out of resources, GDI resources to be precises, this could explain why even other part of the application are getting problems drawing themselfes.
Its a wild guess, but its worth to check this. (this can be verified quickly with the task manager)
regards
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
i did not even think about that?!!! the thing is as soon as my program rich 10000 objects then that bug appears so, and if i am not wrong i remember that win7 it's 10000 as default so, by increasing that it will fix it 100%, which can be done from the registry
thanks I really appreciate that, and i do like this site better than stackoverflow, since they think that they are the best and as soon as you ask question they consider you as a jerk (down vote)
anyway thanks a lot....
|
|
|
|
|
The only thing I can think of to check right now is GDI leaks.
When the system runs out of resources, all kinds of system-wide funkiness may be enjoyed.
Have you checked for them? If not, you can view them in the task-manager.
View->Select Columns->GDI Objects
If this number is not steady - i.e it increases, you've got a leak.
More info: here[^] and here[^].
"Science adjusts its views based on what's observed. Faith is the denial of observation, so that belief can be preserved." - Tim Minchin
|
|
|
|
|
Thanks A lot I did that...
|
|
|
|
|
|
I will check that Out,
thanks for those links
|
|
|
|
|
I think you must see something like this, for Cpp,
Virtual Mode ListView[^]
because, if you have 10000000 items, you can´t load all of them,
hope this helps,
Carlos
|
|
|
|
|
I am having a problem grasping the constructor initialization in MFC property sheet.
Original page definition with initialization
CMyPropertyPage11::CMyPropertyPage11() : CPropertyPage(CMyPropertyPage11::IDD)
Original declaration
class CMyPropertyPage11 : public CPropertyPage
New common BasePropertyPAge class for all CmyPropertyPagexx , inherited from CPropertyPage.
I need to have all CmyPropertyPagexx classes access to same class instance initialized in BasePropertyPage.
class CMyPropertyPage11 : public CBasePropertyPage
The inheritance hierarchy is now
CMyPropertyPagexx
CBasePropertyPage
CPropertyPage
Since CBasePropertyPage also inherits from CPropertyPage I need to apply virtual inheritance and should be able to figure that out myself.
<b><b></b>Mye main question - how do I initialize the CmyPropertyPage11?</b>
CMyPropertyPage11::CMyPropertyPage11() : ??
Thanks for you help.
Cheers
Vaclav
-- modified 22-Aug-13 13:11pm.
|
|
|
|
|
There are at least 3 ways you can handle this. Which way you choose depends on what you need.
If you only need one resource, you assign it to CBasePropertyPage. In this case you take CBasePropertyPage::IDD and pass it to CPropertyPage. For CMyPropertyPage11 you don't need an initializer in that case. You can use the controlls on the page directly.
If every derived property page class needs its own resource you need to decide whether you really want/need to derive CBasePropertyPage from CPropertyPage.
If you don't need access to the GUI from that class it will probably be easier to just define it as stand alone and derive your property pages from CPropertyPage and CBasePropertyPage. This way you can keep your original initialization.
If for some reason you need to have property page funtionality directly in CBasePropertyPage, you need to change CBasePropertyPage's constuctor to take an UINT. Then you initialize like that:
CMyPropertyPage11::CMyPropertyPage11() : CBasePropertyPage(CMyPropertyPage11::IDD)
{
}
CBasePropertyPage::CBasePropertyPage(UINT idd) : CPropertyPage(idd)
{
}
To access the controls on the page from CBasePropertyPage you need pure virtual functions that you override in the derived class(es).
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
Thanks,
I am still little confused, but I'll sleep on it.
I am sure my terminology was not too clear.
So in reality each ProperyPage ( dialog) adds a filter to a graph - DirectShow API's , hence the graph is common to all.
Thanks again for your help, appreciate it.
Vaclav
|
|
|
|
|
Got it (partially) working, actually thought making the "common " class "stand alone" but forgot about that.I do subscribe to KISS!
Now for the real stupid question - what is the syntax to access the common, base class?
Never mind, idiot forgot to delete the original instance of the common class!! Works great.
I have done very little inheritance , in MFC, and I am totally lost. But I'll hit the books.
Thanks again, you guys are big help for me.
Vaclav
-- modified 22-Aug-13 13:09pm.
|
|
|
|
|
The easy way to accomplish this is to use the PropertySheet and initialize the common class in there.
-- modified 24-Aug-13 22:38pm.
|
|
|
|
|
I currently have the following code -
gluLookAtf(player.position.getX(),player.position.getY() + 15,player.position.getZ() + 20,
player.position.getX() ,player.position.getY(),player.position.getZ() ,
0.0, 1.0, 0.0);
How can I make the player and the camera rotate together?
|
|
|
|
|
By keeping the position/rotation of your camera tied to that of your player with fixed delta rotation/movement maybe with some attenuation on some of the components of the world position of the camera if the movement of the player is ugly. Its a different story how to use this camera position/rotation in the renderer but that should be trivial if you have some basic knowledge in the area. You have just grabbed out an opengl call from somewhere, noone will be able to tell what is wrong in your code but it can be anything based on the kind of this question. Considering that you are mixing the update of your object positions with renderer code your software design isn't good for sure.
Your game code should look like the following:
- a set/graph of object that describe the state of your game at any given time. This can be for example a set of world object with position/rotation values and attributes like "dead", "visible".
- an infinite loop that does the following:
* updates the state of your game objects (for example by stepping their position/rotation using physics simulation, you have to update the state of dependent objects (like your camera) only after its dependency objects (player) are updated.
* OPTIONALLY render the state of your game (the world objects/entities with their position and other state variables) and draw the "hud"/score and other info on the screen as the result of rendering the state of your "game rules" object. Here you setup your renderer camera based on the world position/rotation of your camera object in your game state data that has already been updated based on its dependency object: the player object.
Note that your game should work even without calling the global "render" function in your game, the game should work without a renderer just by printing out the state of your objects to the console at any time if your game code design is good!
So what is the problem?
modified 21-Aug-13 16:03pm.
|
|
|
|
|
Hello sorry I wasn't very clear, basically at the moment I have a camera that following the player in the 4 direction i.e moving forward, backwards and strafing right and left, I was aiming to be able to rotate the camera around the player in order to me able to see the rest of the world around him.
yet when I tried adjusting the glrotate i got the camera to kinda rotate but the longer to hold either left or right the further away from the player the camera becomes.
//Bind Camera to Player
gluLookAtf(player.position.getX() + player.xrot ,player.position.getY() + 15, player.position.getZ() + 20,
player.position.getX() ,player.position.getY(),player.position.getZ() ,
0.0, 1.0, 0.0);
glPushMatrix();
glRotatef(xrot, 0.0, 0.1, 0.0);
glTranslatef(pos.getX(), pos.getY(), pos.getZ());
|
|
|
|
|
In a robotics context, at this point I'd ensure I was using a work (player) co-ordinate system rather than a global (the game area) coordinate system or a tool (camera) coordinate system. Is your coordinate system based on the player at this point to make rotation easier? or if not can you switch to one that is?
Also are you using a polar coordinate system, to rotate around the player?
|
|
|
|
|
|
Sounds like you need to apply two transformations then, one for the player to rotate them and one to rotate the camera position around the same point. That's about the limit of my gl recall I'm afraid.
|
|
|
|
|
Here is the description:
Consider lists of numbers from real-life data
sources, for example, a list containing the number of students enrolled in different
course sections, the number of comments posted for different Facebook status
updates, the number of books in different library holdings, the number of votes per
precinct, etc. It might seem like the leading digit of each number in the list should
be 1–9 with an equally likely probability. However, Benford’s Law states that the
leading digit is 1 about 30% of the time and drops with larger digits. The leading
digit is 9 only about 5% of the time. Write a program that tests Benford’s Law. Collect a list of at least one hundred numbers from some real-life data source and enter them into a text file.
Your program should loop through the list of numbers and count how many times 1 is the
first digit, 2 is the first digit, etc. For each digit, output the percentage it appears
as the first digit. If you read a number into the string variable named strNum then you can access
the first digit as a char by using strNum[0] .
And Here is how I got so far:
Programming Language C++ (I just take this class this F2013)
#include
#include
#include
#include
#include
#include
int main(int argc, char** [0])
{
std::string strNum
//this just a random # I put in here, I want digit 1-9 NOT ZERO
("15157,83049,1193049090,1289727392,9075,54984,5419981,231540,1498056");
std::map digit_frequency;
for(int i = 0; i < strNum.size(); ++i)
{
std::stringstream ss;
ss << strNum[i];
std::string str = ss.str();
if(isdigit(str[0]))
{
++digit_frequency[str[0]];
}
else if(isdigit(str[1]))
{
++digit_frequency[str[1]];
}
}
std::map::iterator it;
for(it = digit_frequency.begin(); it != digit_frequency.end(); it++)
{
std::cout << "Leading Digit " << it->first << ": repeated " << it->second << " time(s).\n";
}
return 0;
}
output:
click the link to see the output.
http://www.facebook.com/#!/photo.php?fbid=10200531325265379&set=a.1645092726942.2077529.1225598765&type=1&theater
KingLord
|
|
|
|
|
Very interesting; now do you have a question?
Use the best guess
|
|
|
|
|
Hi,
I suppose that you didn't expect the result you've got.
Your program doesn't check the frequency of the first digit of the number but all the digits in the stream.
You have to split your data set into numbers first and then take only the first digit of that number.
Now there are several ways to split a number but the easiest is probably to use the getline function of a stream. The get line default uses the endline to seperate the lines but you can provide your own delimiter.
std::string sNumber;
std::stringstream numberStream = std::stringstream(strNum);
while (std::getline(numberStream , sNumber, ','))
{
++digit_frequency[sNumber[0]];
}
This reduces the complexity of your program, which is good in industrial code but isn't when someone still needs to learn coding algorithms.
I think your aim should be to write your own string split function/algorithm.
regards
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
Create a "number box" that has 10 compartments, one for each digit 0-9.
For each number in your list
Check the first digit.
If it is a 0, increment the "0" compartment in the above-mentioned box.
If it is a 1, increment the "1" compartment in the above-mentioned box.
If it is a 2, increment the "2" compartment in the above-mentioned box.
...
Next
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|