|
I assume you've already included <map> which then means that you should either add
using namespace std; there somewere or use
typedef std::map< string, CEO* > ceoMap;
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Did you remember your #include and using directive?
<br />
#include<map><br />
<br />
using namespace std;
|
|
|
|
|
|
Well ,there is another error that I am unable to resolve
Consider the code:
#ifndef __EVENT_H__
#define __EVENT_H__
using namespace std ;
#pragma warning(disable : 4786)
class Simulation ;
class Event
{
public:
...
..
. I get the following compliler error:
error C2871: 'std' : does not exist or is not a namespace.
What am doing wrong. I was unable to deduce somthing from MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcce/htm/err26xx_28.asp[^]
|
|
|
|
|
Silly me
Please disregard.
|
|
|
|
|
Hi I have a problem with sorting dates in a Listcontrol. When I add some dates they are sorted by day but I want to sort them by day AND month AND year of course. How do I do that? (sorry for the probably stupid question)
now I get
e.g.
1. 13 May 2003
2. 14 February 2005
3. 15 August 2001
4. 16 May 2003
And I want
1. 15 August 2001
2. 13 May 2003
3. 16 May 2003
4. 14 February 2005
please help me!
|
|
|
|
|
The sorting that is being performed is a string sort - i.e. they are in alphanumeric order. What you need to do in the sorting function is convert the textual representation of the date to say, a CTime, then determine the order from that.
The other option is to display the date in the format YYYY/MM/DD; when you do this the string sort operation correctly sorts the dates!
|
|
|
|
|
Whats the problem with this code:
HANDLE f = CreateFile(sFilename,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_HIDDEN,NULL);
DWORD count = GetFileSize(f,NULL);
char *pszIn;
pszIn = (char *)malloc(count);
DWORD rec;
ReadFile(f,pszIn,count,&rec,NULL);
but psIn receice nothing and no byte read from file,and last error is : 998:Invalid access to memory location
Any idea?
Mazy
No sig. available now.
|
|
|
|
|
Interesting. Use C++ new instead of malloc.
char *pData = new char[count+1];
pData[count] = '\0';
Kuphryn
|
|
|
|
|
I have cut/pasted your code into a Mickey Mouse test prog, it works fine, have you tried doing that?
So if the code works, your fault is "probably" somewhere else in your program, unless ot course you are opening a "special" file, or a very large one?
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Well the first thing I would do is test if CreateFile() succeeded. If it didn't, you are up the creek without any paddles. You should also test that the malloc was successfull etc.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I'm trying to create a vertical rebar.
I write something like this:
my_rebar.Create(this,RBS_BANDBORDERS|CCS_VERT,WS_CHILD|WS_VISIBLE|<br />
WS_CLIPSIBLINGS|WS_CLIPCHILDREN|CBRS_LEFT);<br />
my_rebar.AddBar(&my_toolbar);
But my rebar looks very strange.
Could you help me?
Please!!!
|
|
|
|
|
I've seen many examples of people using
while (pointer->nContinue) Sleep(0);
in a CWinthread function to keep a thread going, as opposed to
while (pointer->nContinue) { }
I noticed that the former works well, whilst the latter sucks up your CPU and prevents your ui from being repainted in a timely fashion.
So my question is, what's the ideal Sleep(ms) to keep your thread in a loop. The reason this particular thread doesn't return is because it manipulates a class generated by the original thread, and starts another thread as
hey
|
|
|
|
|
Sleep(0) releases the rest of your time-slice, and the O/S switches execution to another thread.
Software Zen: delete this;
|
|
|
|
|
|
while(sleep(0)
{
} solves all
[ It is possible to represent everything in this universe by using 0 and 1 ]
|
|
|
|
|
If the thread has noting to do, you are better of putting into a wait state and using an Event to get it going again.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi,
I created a dialog with the mfc app creator, then created a non modal dialog from within that dialog class with the extended style WS_EX_APPWINDOW applied on the initdialog like hmmm...
ModifyStyleEx(0, WS_EX_APPWINDOW);
This gives me a taskbar space for the new non-modal window.
BUT, when I minimize the main modal app dialog, it also minimizes the non-modal window. I tried catching the window messages to the non-modal with pretranslate message, but there is no message when it's minimized, or when it's restored. No WM_SIZE or nothing.
It's almost like MFC magic. I'm guessing this is some kind of wierd undocumented message mapping we can't see in the source SRC files???
So, how do i stop MFC from taking control of non-modal dialogs with the main dialog window in a dialog based app?
PS- I also tried setting the parent to null, but it did nothing.
hey
|
|
|
|
|
alternatively, does anybody out there have a doc with the internal message mapping of MFC dialogs i could take a look at?
I can't get why it doesn't so much as send a message to the 2nd dialog when it's magically minimized and the taskbar space is removed. It seems wrong.
hey
|
|
|
|
|
|
Try settings the parent to the desktop window, this should fix it
use GetDesktopWindow();
Ralph Varjabedian
Software Engineer
|
|
|
|
|
ModifyStyleEx(0, WS_EX_APPWINDOW);
SetParent(GetDesktopWindow());
Tried it this way in the non-modal initdialog.
No Go Senior! Thanks for the suggestion, but I knew it wasn't going to work because i had previously tried setting it to NULL.
The maindlg window of my dlg app is still minimizing it and removing the taskbar spot on minimization. And all the while sending No messages to the WndProc of the modeless dialog.
I have a feeling that this is some powerful MFC voodoo that can only be resolved deep within the cavernous realms of the microsoft building.
In other words unless somebody just knows, i don't know if it can be "figured out", since it's depriving any Wnd after the initial dialog of any type of messages about the altered window state
hey
|
|
|
|
|
Hi, I'm trying to create a dialogbox that popsup when a certan timer has run out. But, I want my dialog to be ontop of every window, and it should even popup when one is playing a Direct3D or OpenGL game. The problem i'm facing is when the window showsup, the game minimizes or the game loses keyboard focus. I think it's because the Window gains focus, so I was wondering, is there anyway to stop the window from getting focus?
thank you very much
|
|
|
|
|
hello
i want to create a slider but i meet a problem with const RECT& rect ,i have declared it at follow
<br />
<br />
typedef struct _RECT { <br />
LONG left; <br />
LONG top; <br />
LONG right; <br />
LONG bottom; <br />
} RECT; <br />
RECT Slider_position;<br />
<br />
Create( isible | TBS_ENABLESELRANGE,Slider_position, this, 1 );<br />
and it give this message error:
error C2664: 'Create' : cannot convert parameter 2 from 'struct CMainFrame::OnCreate::RECT' to 'const struct tagRECT &'
|
|
|
|
|
You don't need to redefine the RECT struct. Remove that definition and you should be all set.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|