|
Frank K wrote: To export a class from a dll is only possible from MFC-Class-DLL to MFC-Application.
Wrong. You can export a class from any type of DLL. Whether you can use that class or not, depends entirely on the compiler/linker you use to link to the DLL.
--
Mit viel Oktan und frei von Blei, eine Kraftstoff wie Benziiiiiiin!
|
|
|
|
|
Thanx Jörgen Sigvardsson, for clearing that one up....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi,
I asked this a few days before, but didn't get any answer, so maybe if I keep my question more compact someone will understand, what I want to do:
I'm using the PDH-library like it is known from the PerfMon system tool. We want to detect memory leaks and the first step is to see which tasks in our software consume how much memory. Which counters do I have to observe for finding out how much memory a specific process has allocated?
Greetings
Martin Dietz
|
|
|
|
|
See here.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi DavidCrow,
Sorry for not answering earlier (I worked on something else the last few days), but your link didn't help me in my question. The problem was not how to use the functions and procedures provided by the PDH library to get the counter information, but which counter to use to get the memory information.
Is \Process(..)\Page File Bytes significant enough to determine the memory usage and memory leak behaviour of the different subcomponents, or do I need more/better fitting counters?
Greetings
Martin Dietz
|
|
|
|
|
m.dietz wrote: but which counter to use to get the memory information.
I thought that's what that link would provide, but after looking at it, the post does indeed not match the subject. I'm not quite sure how that happened. Anyway, the three counters that I've used in the past are:
pdhCpe.szMachineName = TEXT("your machine");
pdhCpe.szObjectName = TEXT("Memory");
pdhCpe.szCounterName = TEXT("Available Bytes");
...
pdhCpe.szCounterName = TEXT("Cache Bytes");
...
pdhCpe.szObjectName = TEXT("Process");
pdhCpe.szInstanceName = TEXT("_Total");
pdhCpe.szCounterName = TEXT("Working Set");
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello comunity,
how to determine from which class is an dialog object derived?
So, i wand to copy data in to clipboard, but how to know which methods to use,
for example, if i have an CListCtrl a can use pListCtrl->GetItemText(iIndex, iSubItem);
to read text and copy them to clipborad, but how to know the base class when i want to copy from
CEdit field??
Is there any method or macro to use for this?
regards
break;
|
|
|
|
|
break; wrote: how to determine from which class is an dialog object derived?
dialog controls, you mean to say I think.
What about CObject::IsKindOf
|
|
|
|
|
break; wrote: how to know the base class...
typeid( type-id )
The typeid operator allows the type of an object to be determined at run time.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
"but how to know the base class when i want to copy from
CEdit field??"
What is the need for knowing base class to get the data from CEdit field ?
Why you not using GetWindow text ?
|
|
|
|
|
Hello,
because i dont know from whicht control the user maybe want to copy to clipboard?
Some controls dont works propertly with GetWindowText!
What when nomeone want to copy from CListCtrl? GetWindowText give me only the caption, not the item text!
i try with
<br />
CRuntimeClass* cRuntime = NULL;<br />
CWnd* pWnd = this->GetMainWnd()->GetFocus();<br />
<br />
cRuntime = pWnd->GetRuntimeClass();<br />
if("CSortListCtrl" == cRuntime->m_lpszClassName)<br />
{<br />
<br />
pList = (CSortListCtrl*) pWnd;<br />
<br />
csData = pList->GetItemText(pList->GetSelectionMark(), 1);<br />
<br />
}<br />
else if("CButton")<br />
{<br />
pWnd->GetWindowText(csData);<br />
}<br />
else if(..)<br />
else<br />
...<br />
that is my problem...
sorry when i write to much, but how to explain my problem?? :->
regards
break;
|
|
|
|
|
Hi, i have problem
i have four item and tab oder of this is 1,2,3,4
i have button "Change Tab Order"
i want, when i pust button "Change Tab Order", my item's tab order changed to 3,1,4,1.
How to change? help me!
thank for read.
Huynhnb
.: Your success is also mine :.
|
|
|
|
|
Do you want to change Tab Order in your program ?
|
|
|
|
|
Hey, i have solved my problem.
I use:
MyItem->SetWindowPos(GetDlgItem(Previous Item), 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE);
After that: MyItem after Previous Item when Tab
Huynhnb
.: Your success is also mine :.
|
|
|
|
|
111100001
1 1100000
111100010
00000000111
00000000111
00000000111
ok, now i change the - to 0, to try to explain this example more clear, this file will be print out in txt format, require the c++ to read from the txt file and also, it is the birnary format, and now can see that
the void V is the whole among the group of 1,
1111
1 11
1111
the two exceptional 1 E is locate at:
00001
00000
00010
which consider at not inside the group of 1
and like this
111
111
111
will consider as a group of 1
and so S = (A-E)/(A+V)
is this help to explain the problem? thanks
sorry to have to post this question again?
|
|
|
|
|
have you considered ask this in the Mathematic forum ?
|
|
|
|
|
|
I think you asked this question yesterday is it homework?
|
|
|
|
|
Are you able to solve this problem on paper? Remember that a computer can't do anything you didn't tell it to do. If a 'space' surrounded by 1 s means something, that can easily be searched for. If a series of four (or five) 0 s is special, that too can be searched for. Work this out on paper and the code will (almost) fall into place.
sinbear wrote: ...this file will be print out in txt format...
How is this important (to the problem)?
sinbear wrote: ...it is the birnary format...
Which means what exactly?
sinbear wrote: the two exceptional 1 E is locate at:
This is all but meaningless. Please clarify.
sinbear wrote: ...the group of 1...
What is a "group of 1?"
Plenty of questions have been asked of you but I've yet to see you respond with any clarification. People are willing to help, but only if you can present them with a good understanding of what you want.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Are you really trying to get some help on this? From the way you present the problem I would guess not... :-P
Rilhas
|
|
|
|
|
no, i really need a help on this problem, but just because quite hard to describe here, as it is a Genetic algorithm problem...,in the format i type, i try to make yours understand, but look like quite hard to do so, so no choice, i have to give up le..
|
|
|
|
|
I would like to check whether the file exists before reading it, however the ios::good flag and ios::bad do not seem to flag the expected values and the program is crashing...
bool CSentenceList::readFile(const char strFileToRead[MAX_FILENAME_LENGTH + 1])
{
char strLine[MAX_SENTENCE_LENGTH];
fstream fileToRead(strFileToRead,ios::in);
if (ios::good != false) // what does this check?
{while (!fileToRead.eof() && Size < MAX_LINES)
{ fileToRead.getline(strLine, MAX_SENTENCE_LENGTH);
if (strlen(strLine) > 0)
{ Sentences.push_back(strLine);
Size++;
}
}
return true;
}
else
{ throw "File cannot be read!";
return false;
}
fileToRead.close();
}
Jon
|
|
|
|
|
ios::good is always "good".
You need to check "if(fileToRead)" at that point.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
strFileToRead holds a valid value at that point, the problem seems to be that ios::good validates to 'true', even though the file does not exist for example. This problem only happened with this program (one-off), so I was wondering what was wrong with the code.
Jon
-- modified at 7:55 Friday 8th September, 2006
|
|
|
|
|
Hi,
anyone know how to detect mouse click in the child window created using CHTMLEDITVIEW (base class) MFC VC++.NET 2003
I can only detect mouse click in the client area but not the child window.
seek help urgently.
tks,
terr
|
|
|
|