|
You could use:
CWinApp * pApp = AfxGetApp ();
ASSERT_VALID ( pApp );
POSITION posTemplate = pApp->GetFirstDocTemplatePosition ();
while ( NULL != posTemplate ) {
CDocTemplate * pTemplate = pApp->GetNextDocTemplate ( posTemplate );
ASSERT_VALID ( pTemplate );
ASSERT_KINDOF ( CDocTemplate, pTemplate );
POSITION posDocument = pTemplate->GetFirstDocPosition ();
while ( NULL != posDocument ) {
CDocument * pDocument = pTemplate->GetNextDoc ( posDocument );
ASSERT_VALID ( pDocument );
pDocument->UpdateAllViews ( NULL );
}
}
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
c:\my documents\visual c++ work\lu\crc.cpp(165) : fatal error C1010: unexpected end of file while looking for precompiled header directive
I've never seen this one before, can't seem to figure it out. The following is a link to the error description on msdn:
http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/c1010.htm
It doesn't help me any, got and ideas?
|
|
|
|
|
#include <stdafx.h>
or
Project -> Settings -> C/C++ tab -> Category "Precompiled Headers" -> Select "Not using precompiled headers"
---
Multitasking: Screwing up several things at once.
|
|
|
|
|
Although it probably works as shown the stdafx.h should go in quotation marks.
|
|
|
|
|
If you use quotation marks you should lose the less than/greater than signs.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hi everyone,
I have an explorer like app in which File with their icons are displayed
using the system Image List. This works fine, however, for certain
files I want to display some CUSTOM ICONS. I had this working under WIn98
(because it returns the entire system image list when creating it, so I just made a copy of that and added the custom ones to the end) however, under win2K i can't get it to work! Any ideas on how I can achieve this?
I'd prefer to NOT 're-register' these filetypes in the registry.
and going through every possible file on the system to 'populate' the list
seems a bit 'slow'
Thanks!
Stefan
|
|
|
|
|
Hi,,
I like to write a help file for my application,,
does anyone know how can i go about that?
Thanks
Ehsan Behboudi
|
|
|
|
|
For creating help file, you must create file by RTF format, it have some rules for design ...
Then, in vc++ is the execute program for compile the RTF file to help file ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
salam hadi
thanks for your reply
I didn't really understand, what is RTF format,,
is there any website that i can check it out and learn more about it..
Ehsan
Ehsan Behboudi
|
|
|
|
|
You can find tons of info on MSDN
MSDN Web:
http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_help.3a_.context.2d.sensitive_help_overview.htm
MSDN CD:
mk:@MSITStore:F:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2001APR\1033\vccore.chm::/html/_core_help.3a_.context.2d.sensitive_help_overview.htm
Not sure if the CD link is the same on yours but the MS web site one will work.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
How do I make the enter key stay in the rich edit and and not cause the ok button from being activated and dissmising the properties sheet.
|
|
|
|
|
I would be interested in programming a simple game. However, beyond the basics I wouldnt know where to start with Graphics. I can add bitmaps to a dialog for instance, maybe move them around from place to place, show/hide them, but don't know where you would start for anything more complicated like animation, or detecting the state of game objects. Im talking something like a tetris clone, or maybe something like theme park, so im not thinking openGL or anything flash like that.
Can anyone give me a few pointers of where i would start, or any resources - there seems surprisingly little out there.
Thanks in advance,
Chris
|
|
|
|
|
Even for 2D, you would be better served to use DirectX - it simply gives you more options and control over things that GDI hides from you. I'd recommend the book 'Tricks of the Windows Game Programming Gurus' by Andre LaMothe as a tour of all aspects of writing a game using DirectX, but in 2D.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Does anyone have any opinions on using the STL... Is there any reason not to use it? I seem to spend a lot of time implementing things like linked lists, but have recently started using the STL. A lot of people take the view that there is no point reinventing the wheel and making things harder for yourself. Although I do like to know exactly how my programs work, am I really just creating more work for myself.
Secondly, should I be able to get at the STL in a console app. Im thinking maybe I need to include some header files, which ones might they be?
Finally, whilst Im here can I also ask whats the difference between including things with < and >, and in speech marks...
thanks
ben
|
|
|
|
|
It's great. However, you might want to check out http://www.stlport.org since there are some bugs etc. in M$'s impementation.
|
|
|
|
|
I too have recently started using the STL. To use it in a console app you include the appropriate header file(s) (e.g. vector, map, string, etc.) using the angled brackets. The .h is not used when naming STL header files.
The difference between using angled brackets and quotation marks is easy. If an include file is in quotation marks the compiler reads it from the current directory. If it is in angled brackets the compiler searchs the include path for the file.
>>>-----> MikeO
|
|
|
|
|
One correction - when #include'ing a file in quotes, if the file isn't in the current directory, the preprocessor then searches the INCLUDE path.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
I think you're right on the money. It's great that you've taken the time to understand how a linked list is implimented, but now you should go on to use the STL. It is an awesome set of tools, the more I learn about it, the more I wish I had time to learn about it.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I recommend Hewlett Packard implementation, it is free and - that's my opinion - better then Ms implementation.
Use STL and save money. Just like when writing 3d applications, use fe.: OpenGL or DirectX.
|
|
|
|
|
Hi.
> Finally, whilst Im here can I also ask whats the difference between including things
> with < and >, and in speech marks...
Easy:
#include <stdio.h> searches stdio.h in the defined include directories while
#include "stdio.h" searches the file first in the current directory and then in the standard include dirs.
Thus, use <> for standard files or standard modules you use often and "" for your own files the current project.
Karl
Pseudocode is code to demonstrate a concept, not designed to be run.
Like certain Microsoft software.
|
|
|
|
|
Hello,
I would like to stop a service programatically, do you know how to do it?
As always, thank you very much.
|
|
|
|
|
Use OpenService to obtain a service handle. Then, call ControlService with SERVICE_CONTROL_STOP control code.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
With
BOOL ControlService(
SC_HANDLE hService, // handle to service
DWORD dwControl, // control code
LPSERVICE_STATUS lpServiceStatus // status information
);
Good Luck!!!
Carlos Antollini.
|
|
|
|
|
Hello,
ENVIRONMENT:
Win2k
MVC++6 (sp.4)
simple WIN32 app: not MFC.
I would like to avoid the user to be able to press any "system key" (ALT+TAB, CTRL+SHIFT+ESC...).
I have a MFC application that does this very fine, but the problem I've found is that I get the keyboard controlled but I cannot ensure that the user won't use any of those keys while my application is being initialized. (it's slow because first I must wait for a service to start) (that app is an MFC one).
I've thought of trespassing the code that is now in my application to a service of my own in order to use the same but before the user has logged in.
The trouble is that I don't know how to avoid the error "undeclared identifier" with:
LPKBDLLHOOKSTRUCT and WH_KEYBOARD_LL (they are defined in winuser.h but I've added this header and nothing has changed)
could you give me an advice?
As always, thank you very much for your help.
|
|
|
|
|
The definitions you're trying to access are in the #if/#endif block:
#if (_WIN32_WINNT >= 0x0400)
#endif
Add the following line before #include <winuser.h> :
#define _WIN32_WINNT 0x0400
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|