|
In the dialog, add a handler for OnNCDestroy. Inside that, do
delete this;
This might work. It has been a while.
Tim Smith
"Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
Hoare - 1980 ACM Turing Award Lecture
|
|
|
|
|
I've tried doing the deletes and destroys, but it just doesn't work. I have the pointers defind under the OnMouseBtnClick and when I go to delete VC says that it is undefined.
I'm trying to find the cleanest and most modular way to do this, am I going to have to define these pointer ahead of the menu call making them global to the rest of the code?
|
|
|
|
|
I have the handle of a window and i want to add it a menu, how can i do it, i didn`t create the window could be any, how can i add it a menu and detect when the menu is selected, is a way besides hooks?, i dont want to add the menu to all windows.
|
|
|
|
|
Hi,
I am working on FTP project and it is already pretty large and complicated. It is written in MFC. And now, I have to add support for installing/uninstalling/running/pausing/stopping NT service. (myproject->NT service). I read some articles about it in MSDN, but I still dont know how to use it. I dont know, in which of my existing functions should I call these "services API function", such as StartService, ServiceMain function, Handler and so on...Can you help me ? Thanks Standa.
Celebrate Mr. Cesilko!
|
|
|
|
|
there are a few articles here on services and how to do them ... if they dont help ive written one that might be of some use in a squeeze
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I want to Know if are there a WebCam and a SoundBoard installed on my System ..
Anyone know a Api Function that can determine this?
Tks a lot
|
|
|
|
|
UINT waveInGetNumDevs(VOID); and capCaptureXXXX macros!
|
|
|
|
|
Hi, I am working on FTP server and I need to manage IP Access. How can I get IP address from client socket which I accepted ??
And second question: dont you have/know any reliable and tested mechanism for providing IP Access restriction (eg. IP 200.100.50.25 cant access our server between 21.8.2002 23:00 and 22.8.2002 12:30) ??? I chiefly mean the format for saving these rules and for reading them (from textfile or whatever)...
Any help will be appreciated !!! Thanks, Standa.
Celebrate Mr. Cesilko!
|
|
|
|
|
s_k wrote:
How can I get IP address from client socket which I accepted ??
With Berkeley sockets you need to pass a sockaddr_in struct to your accept() call like so:
<br />
struct sockaddr_in their_addr; <br />
<br />
<br />
<br />
sin_size = sizeof(struct sockaddr_in);<br />
new_fd = accept(sockfd, &their_addr, &sin_size);<br />
Upon connection you can read the values from the their_addr struct and get what you need.
As for your other question I personally can't answer it in the context of a forum post. I would just look at how other programs handle rules like that for guidance. It's the kind of thing you can make as complex as you want, but I would really strive for simplicity to reduce logic errors.
|
|
|
|
|
I have an ATL(3.0) project that contains a composite control. I need to trap all the events that occur when the control has focus. I though I had accomplished this and then discovered the keyboard events( WM_KEYDOWN, etc) are missing. I investigated the problem and was advised to override the pretranslateaccelerator routine from the base class. I did so but found it never gets called with the keyboard events. Any help or examples would be appreciated. If you need to re-create the problem, create an ATL project with a composite control and then try to capture pressing and key on the keyboard. thanks in advance
|
|
|
|
|
i often see people in the forum write c#, what does it mean?
is it just c or c++?
if not, what is that? what is its main usage and advantage?
thx
includeh10
|
|
|
|
|
it is a new language from MS. it's similar to C++ and Java, but is somewhat more high-level.
it's main advantage is that it works well with the new .Net stuff.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
thx
do u know the name of its compiler and how to get it?
(i.e. Visual C++ if one of compiler of C++)
does c# close to c, c++ or java?
includeh10
|
|
|
|
|
You need Visual Studio .NET, which has a C# compiler and stuff.
Even if you win the rat race, you're still a rat.
|
|
|
|
|
why would a CListCtrl move an item without my permission? i don't have any sorting set. it's an Icon view, Auto-arrange list view and it hates me.
i do this:
lvi.iItem = 0;
int idx = GetListCtrl().InsertItem (&lvi);
TRACE("idx = %d\n", idx);
idx is, correctly, 0.
but where does the item end up? position #3.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Chris Losinger wrote:
i don't have any sorting set. it's an Icon view, Auto-arrange list view and it hates me.
Well, i can´t think of something that you could have missed, and if the returned index is ok, i have definitely to agree with you : it hates you
~RaGE();
|
|
|
|
|
Doesn't the icons in icon view always end up at the next free space?
Internaly it have index 0, it just looks like it is 3..??
/M
- Don't sweat the petty things, and don't pet the sweaty things.
|
|
|
|
|
yeah, that's what it seems like.
looks like i'll have to take out all the items, and insert them back, in the order i want. what a nice feature...
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
take off the Auto-Arrange feature?
|
|
|
|
|
nope. no effect.
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
I've been assigned to recode a large part of my company's application. Mainly to reduce the large amount of bloat and code in our dialog class. One of the main portions that I want to reduce is the code surrounding our CTreeCtrl class. I was planning on just creating a new class and directing all of the CTreeCtrl events to this class.
Here is where my problem comes in. I've tried creating the class from the class Wizard in VS however it wants me to create a class that inherits from an MFC class. What is the appropriate class to inherit from here?
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
|
Awesome. That's what I was hoping for. Because of the class wizard that popped up in the particular place I was crating a new class I wasn't sure if it had to be MFC for the Message Maps to work properly.
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
This is a strategy question to try to get me pointed in the right direction.
My application records several items of data held in a structure into a log file. It also is able to read those log files and process them. As the application evolves, the contents of the structure increases and decreases ... elements are added and removed, based on evolving need.
While the software and the log files matches for a particular version, I need to be able to have sw version 3 read data log version 2, and data log version 1. Backward compatibility. It seems to me that I need multipe structures and multiple classes to read and write the log files, each class meant to handle the log of a particular version. The structure should be contained in the class with accessor functions to provide the data elements.
If the document object handles the File/Open, and it gets the filename from the dialog, and then opens the file and reads the first 4 bytes (an int) to determine which data log version is required, the doc would then instantiate an object of that log version class to handle reading the log file records into the structure. But, this seems to separate the file opening from the file reading, and it seems like that ought to be contained fully in a class meant to handle the data log files. If I don't open the file first, how else could I know which version class is needed?
Does this approach make sense? Is there a better way to keep software versions and data log versions compatible? What do others do to handle data files of different structures based on evolving formats?
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
David Chamberlain wrote:
then opens the file and reads the first 4 bytes (an int) to determine which data log version is required
That´s exactly what i do for my app. In fact, I have only _one_ type of structure, containing _all_ the stuff, and i only fill what is necessary given the version number. BUT i can do that only because i know there won´t be any further version (so the struct size won´t be larger) ... i guess that´s not the good solution anyway
~RaGE();
|
|
|
|