|
feng.dl wrote: If anyone has a technological plan to help to resolve the technological problem...
No, but I am now technologically confused.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
what do I need to get this working? I get 'PPERF_DATA_BLOCK' undeclared and I have already included
#include <atlapp.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include <atlctrlw.h>
#include <atlwin.h>
#include <iostream>
#include <atlmisc.h>
#include <malloc.h>
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#include <Winreg.h>
Sorry for the semi-repost if ever
|
|
|
|
|
And did you include Winperf.h?
|
|
|
|
|
Hamid,
Thanks a lot thats all i need for now.
Jj
|
|
|
|
|
You're welcome.
|
|
|
|
|
Thanks,
Also I solved the problem.
|
|
|
|
|
I have a list control CListCtrl with report view and the extend style of LVS_EX_CHECKBOXES.
Then I try to change the back ground color of the list control, to black color for example. It's done by overriding OnNMCustomdraw() method.
Everything works well except the background color of all checkboxes.
Now I don't know how to fix this problem.
Any suggestion should be appreciated.
|
|
|
|
|
|
Thank you for your reply, Hamid.
I'll have a look at it now
|
|
|
|
|
it's quite complicated, so I still not success,
but anyway, thanks for your help. I will look at this later
|
|
|
|
|
Did you see it I guess your problem is solved.
|
|
|
|
|
Not yet, Hamid,
If I success, I will notify it here. And if you find something, plz let me know,
|
|
|
|
|
I did it, not very well but it works.
Actually, I try to do similarly to XListCtrl
All I did here:
I have a class MyListCtr direved from CListCtrl. Then I override OnNMCustomdraw, try to draw the rectangualar with specificed color (black in my case).
The problem is how to catch event mouse click, determine checkbox state and change the drawing. I cannot understand the way XListCtrl do, it seems to register a defined event WM_XLISTCTRL_CHECKBOX_CLICKED, but I'm not sure. And TRACE, what is TRACE macro? hehe
So I did like this: use event NM_CLICK
void CMyDlg::OnNMClickListData(NMHDR *pNMHDR, LRESULT *pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
*pResult = 0;
if (pNMListView->uOldState == 0 && pNMListView->uNewState == 0)
return;
BOOL bPrevState = (BOOL)(((pNMListView->uOldState &
LVIS_STATEIMAGEMASK)>>12)-1);
if (bPrevState < 0)
bPrevState = 0;
BOOL bChecked=(BOOL)(((pNMListView->uNewState & LVIS_STATEIMAGEMASK)>>12)-1);
if (bChecked < 0)
bChecked = 0;
if (bPrevState == bChecked)
return;
}
I'd tried some ways but not success until this. Actually, I found it somewhere else.
|
|
|
|
|
Hi All,
I'm primarily a windows developer , just came across Qt library recently and I need to decide Qt over MFC for a simple GUI implementation on top of real time huge application.I looked around some samples and still confused about how to use Qt. I have real time application (you can imagine as telephony system) where I need to maintain display status of all lines and a common logs (in general display area) separate like Dock Widget. For line display I think it should be like QTableView but data is not coming from DB rather from a thread inside. So, for 100 lines there will be 100 threads sending status and a global thread will be sending status(log) for general display area. You can imagine as left half screen showing just global general logs going on and right half screen will show all line status from top to down ( 1 to 100).
Can anyone please suggest me the best way to handle it.
thanks very much.
|
|
|
|
|
Hello.
I'm working on a XPCOM component (so I can't just use std::string) and I need to pass an array of characters into an array which is a member of a class.
(Please ignore that this code is out of context)
class MyClass {
char val[100][50];
public:
void drop(char v) { val[0] = v; }
};
MyClass Obj;
void SomeFunction() {
char myString[] = "Hello";
Obj.drop(myString);
}
I get this error: cannot convert parameter 1 from 'char [7]' to 'char'
All I want to do is pass myString to my member function which I want to store the value in the first index of the member array.
Any help would be greatly appreciated, thanks.
|
|
|
|
|
Samjiman wrote: I get this error: cannot convert parameter 1 from 'char [7]' to 'char'
drop() is expecting a char , yet you are sending it a char[] .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks. I changed to
void drop(char v[]) { val[0] = v; }
But now I get this error -> cannot convert from 'char []' to 'char [50]' .
What should I do?
|
|
|
|
|
you cannot copy array to another array just using assignment statement, you need to copy element by element using either memcpy, strcpy(if it is null terminated char string).
may be you can change prototype as
void drop(const char v[], int nSize )
{
memcpy(&val[0][0], v, nSize);
}
or if the array always has null terminated string
void drop(const char v[])
{
strcpy(&val[0][0], v);
}
|
|
|
|
|
Thanks.
void drop(const char v[]) { strcpy(&val[i][50], v); } seemed to have worked.
I can compile the component now. The left most index should be the index to store the string and the right index is the maximum characters (including null char), right?
|
|
|
|
|
Samjiman wrote: strcpy(&val[i][50],
where is this "i" declared.
Samjiman wrote: The left most index should be the index to store the string and the right index is the maximum characters (including null char), right?
strcpy() first parameter is the destination buffers start address, if you specify like "&val[i][50]" the address is ith row 50th element, it starts copying the string from v to end of the row, you need to set the start address as &val[i][0] beginning of the ith row. strcpy doesnot bother about the size of first parameter it copies all the element from second parameter upto the null terminator charater to the buffer whose start address is specified in first parameter. These are basics you may need to learn from C books about pointers, arrays
|
|
|
|
|
I see. Thanks for your help.
|
|
|
|
|
I can return a passed string with this:
const char *drop(const char *v) { return v; }
But how I can put the passed string into the first index of my array char val[100][50]; .
Thanks.
|
|
|
|
|
Hello,
Let's say I have a window created bu external application and I know handle to that window. I need to find control on the dialog with specified class name. So, I know the handle of the dialog which contains the control and I know class name of the control. How can I find it?
One possible way I'm thinking of is enumerating all controls on the form using GetNextWindow and checking control's class using GetClassName function.
Am I on the right track? Is there any better/easier way to do it?
Sorry if my question is stupid, I'm not experienced in Visual c++
Thanks.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
How about FindWindowEx() ?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks, I'll try it. As I have practically no experience in win api, I was not sure whether it would find control or not.
Thanks again.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|