|
Michael P Butler wrote:
You can clear out any variables in the Document by overriding DeleteContents
That's what I am doing now.
Michael P Butler wrote:
The destructor to the CDocument Class only gets called when the application exits.
Here is the puzzling bit. The destructor never gets called when the application exits. Extremely curious eh?
Nish
If I am awake and my eyes are closed, it does not necessarily mean that I am thinking of naked women.
|
|
|
|
|
Have you put a break point into it. I double checked this before I posted my answer and my SDI app calls the destructor.
I assume you have a standard class wizard generated app, so it should call the destructor.
The CDocument::OnCloseDocument() function in DOCCORE.CPP is what calls my destructor. The CDocument class has a m_bAutoDelete flag which needs to be TRUE to call the destructor. This is defaulted to TRUE when the class is created.
Michael
|
|
|
|
|
Michael P Butler wrote:
Have you put a break point into it. I double checked this before I posted my answer and my SDI app calls the destructor
Unbelievable. When I put a break point I found that it does indeed call the destructor on application exit. But the message box I had used never showed up.
CFormDesignerDoc::~CFormDesignerDoc()
{
MessageBox(0,"lll","lll",0);
}
I guess that the moment the message box is shown the main program exits and along with it, all it's threads.
Nish
If I am awake and my eyes are closed, it does not necessarily mean that I am thinking of naked women.
|
|
|
|
|
Nish [BusterBoy] wrote:
I guess that the moment the message box is shown the main program exits and along with it, all it's threads.
Yes,thats what I guess too.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Is there any way wherein I can list down the name of the class declared in a COM component. To extend this problem further I also want to list down the properties / methods declared in the class?
In other words I am trying to build my own object browser!
thanks and regards,
Mangesh Sardesai
|
|
|
|
|
I have embedded several dynamically created buttons into a CListCtrl subitem. I can make an event for when any of them are clicked by adding a ON_BN_CLICKED(BTN_ID, OnButtonClick) message handler to my list ctrl and creating all the buttons with the id BTN_ID... The problem is that I don't know which one was clicked with this method. I can't add multiple message handlers at design time because I don't know how many buttons will be added. Is there a way to have the message handler return the ID of which button was clicked to my function or something?
|
|
|
|
|
WM_COMMAND sends both the control's ID and window handle in its parameters.
--Mike--
"Jobs that don't allow you to visit the Lounge 25 times a day at the minimum are not worth having anyway."
-- Nish, 3/28/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
I have 2 bitmaps(a red and green stoplight) that I want to display only one at a time at the same screen position. I have a boolean condition for 'go' that is updated at random time intervals elsewhere. The problem is that the bitmaps do not change from whatever the 'go' condition initially sends it. How do I get it to refresh and display the right image when the condition is updated?
void CLightDlg::OnPaint()
{
CPaintDC dc( this );
CBitmap bmp, *poldbmp;
CDC memdc;
if( GO )
bmp.LoadBitmap( IDB_GREEN ); //Green light bitmap
else
bmp.LoadBitmap( IDB_RED ); //Red light bitmap
memdc.CreateCompatibleDC( &dc );
poldbmp = memdc.SelectObject( &bmp );
dc.BitBlt( 78, 20, 59, 61, &memdc, 0, 0, SRCCOPY );
memdc.SelectObject( poldbmp );
}
|
|
|
|
|
Call Invalidate(FALSE) when the condition changes.
That makes the window redraw itself, the FALSE stops an erase and will stop flicker.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
|
how do i get a single ASCII character from the user, useing a console window, without having to use the return key.
i want the user to use the arrow keys (and some others) to move pices of info around on the screen.
how would i go about doing this and what headers will i need.
|
|
|
|
|
To read one single ASCII character from the console stdin you can use
int getchar(void);
-Dominik
|
|
|
|
|
Previous:
Ok, im going to explain this vary carfully... with all the details and every thing "just to make sure im in the right place." My recent thread discused about rather i should use WTL, DirectX, or MFC. I ended up with me using DirectX.
Now:
The thing that i am going to program "in do time, after allot of study hours and practice" is program a 2D RPG "Two Dimensional Role Playing Game" Engine "The thing that i use to make the game."
This Engine will be entirly in a windows format, every little thing. I am not programming the game, i am just programming the tool that will program the game. "Now that every one knows that..."
Which device am i better off in using? WTL, Wich makes it easier to do windows stuff without the bulky MFC format. MFC "Which gives me a lot of extra things i dont need to deal with." Or DirectX, which doest do windows, yet does games?
The game is going to be "As i have told you" A RPG that will be played entirely on the .net. Any info on which way i should go would be helpful, and any place to find the tutorials from beginning to end that would teach me what i need to do would also help.
Thanks every one!
~SilverShalkin
The gate is opening
And light as warmth
And full of knowledge
Inrichest me
|
|
|
|
|
SilverShalkin wrote:
Which device am i better off in using? WTL, Wich makes it easier to do windows stuff without the bulky MFC format. MFC "Which gives me a lot of extra things i dont need to deal with." Or DirectX, which doest do windows, yet does games?
Why do you persist in putting DirectX in the list of options when it is a completely different part of your game ?
1/ If you want fast 2D graphics and more than one sound at once, you WILL use Direct
X. Simple as that. If you want to do it in 3D ( not as bad an idea as it sounds, you can fix the camera in a 2D style, which would give you a 3D type view without the 3D headaches, give you lighting, etc. ), then OpenGL might be a better option if you find another way to handle sound.
2/ If you want the game to run in a window, then the answer is probably MFC. You are clearly far out of your depth at this point, so using something that offers no documentation is going to be your own private hell. If you want the game to run full screen, as most games do, then the game should probably be Win32. If you're doing an engine, that is, a system that is called by other code to create the game, then still Win32, unless the engine has a GUI, in which case it's more of a games creation system than an engine. An engine to me is an SDK - it's something that gives me the bottom level code so I can write higher level code to achieve my goal, just like GDI stops me from having to find out the details of my graphics card and write each pixel as a byte in memory.
3/ There are no end to end tutorials, but I would *again* recommend you read www.flipcode.com if you're serious. It's full of people who are writing engines, or thought they could write an engine and gave up after a few months. www.gamedev.net is another one, it also hosts nehe.gamedev.net, the best set of OpenGL tutorials out there.
Overall I suggest you go to some gaming sites, write some code in the different systems you're considering so you know what it is you're asking, and what each bit will do, and stop asking the same question over & over again.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian Graus wrote:
and stop asking the same question over & over again.
I knew that was comming
Christian Graus wrote:
If you want fast 2D graphics and more than one sound at once, you WILL use DirectX.
I know that too. But will i use DirectX to build the engine? That was the question... "The engine to me is a map editor that puts your game together " I know that Direct Draw and Direct Sound and Music will make my game awesome, but, at the moment i am not make a game but the game engine.
So,... Base question... Will i or will i not use DirectX to build my Engine? If not, then what should i use. "Engine, not game"
But then, if i was to build my engine so that it would use DirectX, would i use DirectX with my engine?
Oi,... Me confused, ill get it sooner or later...
I also know about FlipCode but they are all in 3D stuff and stuff and they have no tutorials, there forum is half decent, yet no one responds to questions else you wait till the next day to get them. Ill try www.gamedev.net "i dont think ive bean there"
Thanks for your time, its always apprecited
~SilverShalkin
|
|
|
|
|
SilverShalkin wrote:
I know that too. But will i use DirectX to build the engine? That was the question... "The engine to me is a map editor that puts your game together " I know that Direct Draw and Direct Sound and Music will make my game awesome, but, at the moment i am not make a game but the game engine.
You're writing an editor, not an engine. You won't need to use DirectX. You should use MFC for the reasons I stated.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Ok, thanks... I have a book and ill start studying. If i have any other questions on this little subject, i have 3 other forums to post it
Thanks Again!
~SilverShalkin
|
|
|
|
|
SilverShalkin wrote:
Will i or will i not use DirectX to build my Engine? If not, then what should i use. "Engine, not game"
Will your 'Engine' need to display graphics, show animations or play sounds of any kind?
If the answer is yes, then you will need to use DirectX.
If your 'Engine' just needs to input data into a dialog box, then MFC will do the job fine.
And just to confuse the issue a little more, it is possible to write a DirectX application using MFC. There are plenty of books out there that teach you how to do it. It's not easy and doesn't produce fast games but if you are just doing a map editor then it might be a way forward. Do a search on Amazon for books on writing games, they contain all the information you need. A google search might also help.
Michael
|
|
|
|
|
Anyone knows how get the percent of System Resource, User Resource and GDI Resource ? Some class e functions ?
These information is the same showed by the Resource Meter Aplication of Windows 9x.
Thanks,
Cris ...
|
|
|
|
|
I don't think thats available to you under windows 9x.
GlobalMemoryStatus will return something of similar interest, but not exactly what you want.
As far as GDI USER and Process useage...theres not much you can do.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I am driven to the wall. Can anyone help me?
I have a server and a client both use TCP/IP socket. The server runs Vxworks while the client runs Windows 2000. the requrirement is that the server can have one client only at a time, so when I initialize the server socket, I say:
nRet = listen(ListenSocket, 1);
But still, when I run two clients to test it, both can connect()!!!
And when I check the messages received by the server,
if ( FD_ISSET(ListenSocket, &ReadSet) && ClientSocket == 0)
HandleNewConnection();
else
logMsg("don't accept\n", 1, 2, 3, 4, 5, 6);
I will see that: after the first client successfully connected to the server (ClientSocket != 0 then), I let the second client try to connect to the server. The client will tell me its connect() okay, while the server will say "don't accept\n" all the time until the second client close the connection.
What's the use of the MAX_CONNECTION = 1 in my listen() then??
Or if I over look something?
any help is highly appreciated!
|
|
|
|
|
Well, according to Beej in his "Beej's Guide to Network Programming", the MAX_CONNECTION in listen() is the number of connections allowed on the incoming queue. Incomding connections are going to wait in this queue until you accept() them and this is the limit on how many can queue up.
So, if I set it to 1, then the second client which tries to connect should get a failure. Why this doesn't happen in my program? any suggestion?
|
|
|
|
|
Hi there,
How can i register the MFC70.DLL and ATL70.DLL and ... in other computer ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
First:If you dynamicly link them to your project,you don't need to register them.
Second:regsvr32 do it.Type it in run command with file path.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Ehm, if I don't remember wrong you just move/copy them to the Windows directory of that computer you want the files in.
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|