|
Your conclusion is correct, that dwFileAttributes is a set of bit flags.
This is just of the top of my head.
if( !(dataFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
{
}
else
{
}
if( dataFind.dwFileAttributes & (FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_NORMAL) )
{
}
INTP
|
|
|
|
|
John R. Shaw wrote:
if( !(dataFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
{ // should be a file}
else
{ // should be a file}}
Off the top of your head that's quite reasonable - I understand the intent, despite the typo. Rob came up with much the same conclusion (see above). Thank you for your guidance - C++ is fairly new to me, but I'm finding that it's not really as bad as I'd expected.
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
You are welcome! I was wondering where that curley brace went to, but it is not a typo since it ended up as part of the comment. By the way, C++ is derived from C and what you are seeing is actualy C code (since no classes are invalved).
Have a great night, day, or whaterver!
INTP
|
|
|
|
|
y'know I had to stare at the code John posted quite a long time before I saw the typo Here I was scratching my head and wondering what Roger was on (and if I could have some ) before finally seeing that errant brace.
Rob Manderson
http://www.mindprobes.net
Paul Watson wrote:What sense would you most dislike loosing?
Ian Darling replied.
Telepathy
Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003
|
|
|
|
|
It was a little more than the curly brace:
if( !(dataFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
{ // should be a file directory}
else
{ // should be a file}}
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
I run an application(e.g. Test.exe) in Debug or Release mode,
without manifest file, the applcation will good.
But, I met a GDI Objects leak issue,
when I run the application with
a manifest file(e.g. Test.exe.manifest).
the follow is in the manifest file:
<br />
<dependency><br />
<dependentAssembly><br />
<assemblyIdentity<br />
type="win32"<br />
name="Microsoft.Windows.Common-Controls"<br />
version="6.0.0.0"<br />
publicKeyToken="6595b64144ccf1df"<br />
language="*"<br />
processorArchitecture="x86"<br />
/><br />
</dependentAssembly><br />
</dependency><br />
The leak will not issue, when I remove the codes from the manifest file,
or, the leak will not issue , I rename the application name(e.g. ATest.exe).
The GDI Objects leak due to manifest file?
Who can give me some comments, thanks in advance!
|
|
|
|
|
I have no idea, but the manifest from Microsoft doe not cause this problem:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestversion="1.0">
<assemblyidentity
="" version="1.0.0.0" processorarchitecture="X86" name="CompanyName.ProductName.YourApp" type="win32">
<description>Your application description here.
<dependency>
<dependentassembly>
<assemblyidentity
="" type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorarchitecture="X86" publickeytoken="6595b64144ccf1df" language="*">
INTP
|
|
|
|
|
Why doesn't VC++ recognize:
#include <string>
I see this in all the books that I am reading, but when I use it...I get:
'string': undeclared identifier
on the line where I try to declare my strings.
Incidentally, Bloodshed's C++ compiler (Dev-C++ 4.9.8.0) doesn't recognize it either.
I also tried
#include <string.h>
#include<string>
#include<string.h>
and every other configuration I could think of, include using "" around 'string'
I now this is incredibally dumb...but there it is.
thanks!
roger
|
|
|
|
|
<br />
Why doesn't VC++ recognize:<br />
#include <string><br />
<br />
I see this in all the books that I am reading, but when I use it...I get:<br />
'string': undeclared identifier<br />
on the line where I try to declare my strings.<br />
Incidentally, Bloodshed's C++ compiler (Dev-C++ 4.9.8.0) doesn't recognize it either.<br />
<br />
I also tried <br />
#include <string.h><br />
#include<string><br />
#include<string.h><br />
|
|
|
|
|
|
You figured out how to use namespace std then ?
For future reference, you need to check 'Do not treat <'s as HTML tags' when posting stuff that uses < >.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
My application compiles and builds properly. there is no error.
But when i get the application interface and click on the menu
to open a dialog boxes which has the controls in it, rather than opening
i get this message.
-------------------------------------------------------
Blah Blah .....
Please tell microsoft about this problem.
Blah Blah .....
We have created an error report that you can sedn to us.
We will treat this report as confidential and anonymous.
To see what this error report contains, CLICK HERE.
When i click on "CLICK HERE" i get this message
--------------------------------------------------------------
I get this error first:
--------------------------------------------------
Error Signature------------------------------------
AppName: Application App Ver 2.0.0.2 ModName ntdll.dll
ModVer: 5.1.2600.1217 Offset: 000096b5
Reporting details------------------------------
Blah Blah
To view technical information about the error report, click here
---------------------------------------------------------------
Then on seeing the error and exiting i get this messagebox at the end.
|--------------------------------------------------|
|Application: Application.exe Application Error |
|------------------------------------------------- |
|The instruction at "0x77f58dc5"referenced memory |
|at "0xfffffff8". The memory could not be read. |
|Click OK to terminate the program. |
| |
| ----- |
| |OK | |
| ----- |
|--------------------------------------------------|
What is wrong wi th my application ?
pleae help me out i have been battling this for the last one week
with no progress.
Thanks.
.iCe.
|
|
|
|
|
Odds are it means you passed an invalid pointer to something.
My immediate guess is that you have are using a dialog ID for which there is no control.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Ok here is a little history how i started getting errors.
I made some child dialogs boxes . After that attached them to the Parent Dialog Box. Everything is working fine. Then i added the control variables on the dialog boxes which are Check Boxes and Edit boxes only.
Now i am intialising them in the
DoDataExchange(CDataExchange* pDX)
Constructor.
e.g. setting control m_variable1 = 0.5
and so on.
After doing so it gives me error.
Any more suggestions.
Thankks for answering though.
============================================================================
A winner is not one who never fails, but one who NEVER QUITS!
============================================================================
7 days and i havent quit yet !
|
|
|
|
|
Just check the variables and step through the code. Make sure everything is being initialized properly and in the right order. Make sure you aren't using any of the controls before they are created.
Good luck.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
You may have passed an invalid pointer or you may be over writting memory in an earlier function call. The last time I saw this error I had to back track until I found a miscalulated value that was causing an over write. This error normaly appears after the cause of the error (some times long afer).
INTP
|
|
|
|
|
|
Hi,
In my sdi application I have 2 tree views selectable by tabs. If I minimize and maximize the application the tree view looks grayed, only the selected node being visible. Can anyone tell me why and how to fix this?
|
|
|
|
|
There can be a range of issues here. Here are some things you can try:
One, make sure when one is made visible, the other is made invisible.
Two, the tab or the dialog may be drawing it's background on top of the tree controls. Try setting the tab or dialogs properties to clip children.
Three, detect the WM_ACTIVATE and do a RedrawWindow on the visible tree.
--
Joel Lucsy
|
|
|
|
|
Thanks a lot!...Redrawwindow() worked.
|
|
|
|
|
Hi,
how do I achieve the following:
I want to right click on a file and go to Open with and select my SDI application and it would be opened in my application the way it gets opened by File | Open etc.
Please advise
|
|
|
|
|
shell extensions
see michael dunn's articles here on cp
they are awesome
"there is no spoon" biz stuff about me
|
|
|
|
|
How can i de style of single cells in the MFC grid so that they convert all input to uppercase.
Change the style of the InPlaceEditControl ??
Luc Devriendt
|
|
|
|
|
Hi, sorry that this might be a beginner question.
I know how to get a pointer form View class to doc class.
But how do you get a pointer from app class to doc class? is there a way? If not can you get a pointer to app class from doc class?
Thanks for your help
Q-Bus
|
|
|
|