|
How to restrict the user to collapse the items in a tree control, it should always be expanded mode.
|
|
|
|
|
You can handle TVN_ITEMEXPANDING and return TRUE if the node is one you don't want to collapse
|
|
|
|
|
|
Hi everyone, I am working on a project for a C++ course, and I am running into a compile error that I can't figure out how to fix. It seems to be telling me that I am using a class member that is an undeclared identifier. As far as I can tell, it has been declared.
Here is the class declaration:
class Student
{
public:
/* Constructors and Destructor */
Student();
virtual ~Student();
Student(std::string first, std::string last, int SNum);
/* Getters and Setters */
std::string getFirstName(void);
void setFirstName(std::string newName);
std::string getLastName(void);
void setLastName(std::string newName);
int getStudentNum(void);
void setStudentNum(int newNum);
std::vector<std::string> getGradeList(void);
void setGradeList(std::vector<std::string> &GList);
private:
std::string FirstName;
std::string LastName;
int StudentNum;
std::vector<std::string> GradeList;
};
And this is the code that is giving the problems at compile-time:
void setGradeList(std::vector<std::string> &GList)
{
GradeList = GList;
}
Build error:
students.cpp(62) : error C2065: 'GradeList' : undeclared identifier
So, this is driving me crazy, and any help would be greatly appreciated!
Thanks in advance!
|
|
|
|
|
all_in_flames wrote:
students.cpp(62) : error C2065: 'GradeList' : undeclared identifier
Because GradeList() is not a member of class Student .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You left out the class name in the function header:
void <font color=red>Student::</font>setGradeList(std::vector<std::string>& GList)
|
|
|
|
|
You are a C++ gawd. Thanks again Mike!
|
|
|
|
|
Hello.
I am trying to write a program that stores a LOT of bitblits (a lot of images) in memory for later processing. I want to capture some motion on the screen so I'm bitblitting 30 times a second to an array of HBITMAPS. Before blitting I'm doing a CreateCompatibleBitmap on every HBITMAP, but it returns error code 8 ERROR_NOT_ENOUGH_MEMORY when it reaches the 145 element in the HBITMAP array. How can this be?
I'm not trying to display motion, I'm trying to capture motion. Imagine you have a game running; I want to capture 5 minutes of "screenshots", let's say 30 screenshots pr second; 30 bitblits pr second. I want to do some processing on those images - example do some edge detection. I can't do it in real-time because I would have to do the edge detection between each image capture, which delays the next image (we need 30 pr second). And I can't save them on disk since writing 30 bmps pr second is way too slow. So naturally I have to capture all the images in memory, then process them afterwards. Get where I am going?
I don't know if bitblt is the most optimal way of doing this. The game I want to capture from is OpenGL, and I want to capture the game action without hooking anything in the game (so naturally I can't hook the opengl functions and get images directly from the buffers, right?) - Do you know other ways of capturing 30 images per second and storing them than using bitblt etc?
I'm still wondering why windows limits me to a certain amount of HBITMAPS at a time though - My program only uses 1,448kb memory when the 145 HBITMAPS are Created so I'm definitely not out of memory. Perhaps it's a number restriction?
Any help would be greatly appreciated!
|
|
|
|
|
pnok wrote: My program only uses 1,448kb memory when the 145 HBITMAPS are Created
Must be really small bitmaps.
You may want to check the math...
Let's say your screen resolution is 640x480, 24-bit
640 * 480 * 3 = 921600 bytes per frame
921600 * 30 = 27648000 bytes per second (do the math from here for 5 minutes )
921600 * 145 = 133632000 bytes for 145 frames
You'll need to manage memory yourself for this much data. GDI resources aren't infinite.
I would recommend preallocating buffers as much as possible since most of the time is spent in
allocation. Keep raw screen data in your memory buffers and you can do what you wish with the
data when the capture is finished.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Is it just me or are the posts today are particularly dreary?
led mike
|
|
|
|
|
I thought it was just me!
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
It's ugly... check out the C# forum
led mike
|
|
|
|
|
to avoid using up all your GDI memory, you should be able to convert each frame to a DIB fairly quickly (use GetDIBits), then delete the HBITMAP. the DIBs will live in non-GDI memory, so you won't hit the out of memory limit (well, maybe eventually, but it should be a lot larger than 145 frames).
|
|
|
|
|
I wanted to display a sequence of numbers in an Edit box just like a timer or a stop watch.Below is my code
void CEditDlg::OnButtonOK()
{ UpdateData();
for(double i=0;i<=25;i++){
m_d1=i; //m_d1 is the name of the variable of edit box
UpdateData(false);
Sleep(10);
}
}
the above code gives me an output of 25 whereas i want a sequence of numbers to be displayed b/w 0-25.how do i go abt it???
Sam
|
|
|
|
|
You can use GetDlgItem(IDC_OF_TEXTBOX)->SetWindowText(m_putStringHere); instead...
-Houari
|
|
|
|
|
SamPrem wrote: Sleep(10);
You have ket delay of 10 ms. Thats the reson, you are able to recognize last character displayed. Your code is setting text 0-25 to edit box. But, you are not able to see i, because it happens in very short time. May be, you can try setting dealy of 2 sec(2000ms).
|
|
|
|
|
SamPrem wrote: how do i go abt it???
No need to call UpdateData() .
Change your for loop variable to an int , as a double makes no sense for what you are doing.
Change m_d1 from a CString to CEdit instead.
Update the edit control with m_d1.ReplaceSel() instead.
Using a different 'sleep' value is irrelevant.
SamPrem wrote: the above code gives me an output of 25
Of course it does, since you are overwriting the contents of the edit control each time through the for loop.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In your for loop, you use the UpdataData (and that's OK), then sleep, but stay in the loop.
The UpdateData actually updates the data, and posts a message for the window to update, however, the message can't be processed until you leave this loop - that's why you only see the last number.
You can modify your code as follows to see each value. (and as noted, your loop control variable should be an int instead of a double).
void CEditDlg::OnButtonOK()
{ UpdateData();
for(int i=0;i<=25;i++){
m_d1=i;
UpdateData(false);
GetDlgItem(IDC_YOUR_EDIT_BOX_ID)->UpdateWindow();
Sleep(10);
}
}
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
|
IMediaSeeking is a COM interface. You can query the filter graph manager to obtain a pointer
to the interface (saves you the trouble of finding a certain pin to get the interface on!):
IMediaSeeking *pSeeking = 0;
hr = pGraphMgr->QueryInterface(IID_IMediaSeeking, reinterpret_cast<void**>(&pSeeking));
Note that not all filters support seeking. See Seeking the Filter Graph[^]
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Actually I found out that I can not use seeking for the AVC decoder (by using GetCapabilities). So, I think maybe it is possible to use seeking directly to the demux filter. Is it possible?
-Houari
|
|
|
|
|
houari_id wrote: I think maybe it is possible to use seeking directly to the demux filter. Is it possible?
Have you tried to obtain the IMediaSeeking interface from the filter?
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi
Could any one please tell what api I should call to display chm help files ?
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Zainu wrote: Could any one please tell what api I should call to display chm help files ?
Have you tried ShellExecute() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|