|
thank you Hopefully vcplusplus is reading
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
it is a dll
cannot be debug
anyway, i believe it will be cause memory leakage as the friendly guys who are replying me ^^.
|
|
|
|
|
Visual misses a lot of memory leaks.. especially if they are in a DLL loaded by the process being debugged.
An expert is somebody who learns more and more about less and less, until he knows absolutely everything about nothing.
|
|
|
|
|
As written, it will not be a memory leak. String literals are more like constants - not dynamically allocated memory.
General rule: if you allocate memory with "new" (or "malloc" for old-school C code), and do not deallocate it with "delete" (or "free" for old-school C code), you will get a memory leak. Otherwise, the memory will be allocated on the stack and you won't get a memory leak.
There is an emperical way to try it... take the code you have written, and put it in an infinite loop. Do no optimisations. Run it for a while, and see if your memory usage slowly and gradually goes up in Task Manager. If it then goes back down when you quit the program, then you have a memory leak.
An expert is somebody who learns more and more about less and less, until he knows absolutely everything about nothing.
|
|
|
|
|
Hello,
I have some Edit controls layed out on a dialog, which are created automatically when the dialog loads up. Now I have a class which is derived from CEdit and I need to subclass it from the precreated Edit controls. I've tried subclassing them but all I got was message (AND NOT COMMAND) notification through DefWindowProc .
My question is: do I have to downcast it? And if so, how do I do that?
|
|
|
|
|
dNimrod#X wrote:
My question is: do I have to downcast it?
My guess would be no, that you have problems elsewhere. I am only guessing because i don't completely understand your post.
For instance:
dNimrod#X wrote:
which are created automatically when the dialog loads up
I don't know what you mean by that or this either:
dNimrod#X wrote:
I need to subclass it from the precreated Edit controls
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I have some CEdit controls layed out on a dialog template resource. They are created automatically when the dialog box is (dynamically) created.
What I need to do is force my CEdit-derived class to attach itself to the already created control(s).
Consider this:
class CMyEdit : public CEdit
{
protected:
virtual LRESULT DefWindowProc(...);
.
:
.
};
Example of implementation:
int CMyDialog::OnInitDialog()
{
CMyEdit *pEdit;
pEdit = new CMyEdit;
pEdit -> SubclassDlgItem(IDC_VAL, this);
.
:
.
}
Subclassing seems to not solve my problem because, although I still receive OnPaint, ... notifications, I can't seem to receive the EN_CHANGE command nor the WM_UNDO, to just name a few.
How do I do about solving this?
|
|
|
|
|
If I understand your problem correctly, you won't need to downcast.
All you need to do in order for MFC to automatically subclass your edit control for you is:
1) Right click on edit control
2) Select class wizard
3) Click "Member variables" tab
4) Find control ID for edit control you wish to subclass
5) Double click on it
6) Under category pick control
7) fill in details as required and if your edit control isn't available and only a generic CEdit is displayed you can:
I believe remove your *.clw file and regenerate it when VC as you to selecting all your project files (including CEdit derived (h and cpp files).
OR
Go with a generic CEdit and later just modify it changing it to CPhoneEdit (or whatever)
Cheers
How do I print my voice mail?
|
|
|
|
|
Thanks I just didn't have it in me on a Monday morning to type all that up.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hockey wrote:
How do I print my voice mail?
Easy, blow it out your arse
Sorry if that is a repost
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hi there! and thanks for your reply.
I am sorry but I can't use ClassWizard as I am using a Static Lib.
In this case, what is my best option?
As a mentioned earlier, I tryied Subclass ing the control and all I could get from it was receiving [generic] message notification from CWnd, but NOT command notifications from CEdit (like EN_CHANGE ; WM_UNDO ; ...).
Furthermore and to provide you with some more info on the question, I have derived a class (lets call it CMyEdit ) from CEdit .
What I would really like to know is the steps I have to take in order to fully "subclass" the control?
Thanks again for the reply.
David
By the way:
Quote (from Hockey):
How do I print my voice mail?
That's simple, I guess! Record your voice mail using any WaveEditor and simply print out the graph it generates!!
|
|
|
|
|
dNimrod#X wrote:
I am sorry but I can't use ClassWizard as I am using a Static Lib.
I'm not sure I understand why this is creating a problem
When you derive an class using from CEdit using classwizard it automatically subclasses CEdit for you. You can then use VS to add and remove message handlers as required.
Did you derive your class from CEdit manually???
I can't remember how you said you subclassed your control...and i'm too lazy to go look...
I don't think SubclassWindow() is the way you want to do it...you'd probably have better luck using SetWindowLong replacing the original window procedure all togather.
Cheers
How do I print my voice mail?
|
|
|
|
|
PJ Arends has given me the information I needed!
I was Subclass ing the control well, no problem with that. The problem was that the notifications I needed to receive (EN_CHANGE ; EN_UPDATE ; and others) were being sent to the parent window thus not being routed in to my derived class. And in this case, I have to use message reflection techniques in order for my CEdit -derived class to be notified.
One of Windows' many oddities, I guess.
Anyway, thanks for the replies.
David
|
|
|
|
|
Hi,
I have an SDI application with a CView client area containing some text and lines.
I'd like to add simple, standard, vertical scrolling and I thought I'd get that by OR-ing in the WS_VSCROLL style. That made the vertical scroll bar appear but it did not make it operational.
Please may I have a few kick-start clues or a link to a tutorial/intro for the actual coding of a vertical scroll utility.
Thanks in advance.
|
|
|
|
|
Check out CScrollView
How do I print my voice mail?
|
|
|
|
|
Hi,
I'm implementing a TCP server that should delimit tpkt paquets on a TCP stream, change their headers and resend them. I don't know how to catch each paquet and how to know his length. Anybody has a code or an example that shows how to delimit paquets on a TCP stream ?
Thank you
Imad
|
|
|
|
|
hi! i've created a dialog based MFC program..now i need to add just 1 additional feature to complete the proj..
is there anyway i can set up the user interface on multiple users, and when 1 user enter text input to the user interface, he can just press a button & send the text over to the a chosen user?
it's something like a msn/icq that i'm thinking of implementing...
|
|
|
|
|
pork chop wrote:
is there anyway i can set up the user interface on multiple users
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hi,
I want to add something so that my dll is called with the windows startup. I don't want to use the default registry entries under the HKEY_LOCAL_MACHINE & HKEY_CURRENT_USER.
Thanks
|
|
|
|
|
|
amahmoud81 wrote:
I don't want to use the default registry entries under the HKEY_LOCAL_MACHINE & HKEY_CURRENT_USER.
Why?
Don't forget that you'll need an actual application (e.g., rundll32.exe) to start your DLL.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
(also sent to Dundas Tech this morning; but maybe some other CPian already tried that )
I have a grid ( row selection ) with multiple columns, one is a checkbox cell type; I select a range of cells and when clicking on one checkbox in the selected range, I want to update all checkbox cells with the state of that one cell.
I was wondering if it's possible to select a range of checkbox cells (CUGCheckBoxType) , and click on the checkbox to affect all the selected cells ?
now, in the CUGGrid::OnLButtonDown method, there's m_ctrl->GotoCell(col,row) that resets the selection.
Seems that I have to "hack" a couple of methods here and there to achieve what I want, and I don't really want to do it, and mess with the Dundas code.
I could use a contextual menu to do it, but it seems unelegant ... and not what Boss wants...
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Please try the recommendations Dundas Support has emailed to you earlier today and let us know if it something you can use.
Peter Zajac
Dundas Software
|
|
|
|
|
Hello, I've tried to do modal listbox like the member list in VisualStudio. I used class CDialog with listbox (without border and caption). But there is a terrible BEEP when mouse is clicked outside the dialog. I can't find the mechanism which do the BEEP. Do you have any idea how to do that. Thanks.
|
|
|
|
|
I have no idea what your asking, but...
Maybe:
MessageBeep
or
You have created a modal dialog box for an editor your working on which pops up when member functions/variables for an object are available and you want it to NOT beep when some clicks outside the box and instead have it dissappear like VS???
In that case try creating a modeless dialog box
Cheers
How do I print my voice mail?
|
|
|
|