|
Never mind. It was a simple solution once I thought about it for a moment. LOL. Thanks anyways.
Dan Willis
|
|
|
|
|
Hi all,
does anyone know a tool to create a Class-Graph out of the Source-Code of a VC++ 6 project? I need to show up all the references to a class.
It also would help a lot if it lists all references in a textfile. Then I can draw the Class-Graph myself.
Thanks.
--
karl
|
|
|
|
|
have a look at Doxygen, it does not offer a graphical graph, but it shows you this;
maybe with the DOT (GraphViz extension) it can do it. I was about to try it this week.
Max.
|
|
|
|
|
Hi, everyone!
I want to know where does the precomplier directive
__Win32__ defined? Defined in the compiler?
Another question, is it C/C++ standard or is it
only defined in Microsoft Visual C++ compiler?
Thanks in advance,
George
|
|
|
|
|
As far as I know __Win32__ is not standard define. I think it is specific to your project. WIN32 on another hand usually defined through compiler settings, or like in case of "ole2.h" in some header. As for the second part - Windows unfortunately is not part of C++ standard, so there is no way WIN32 could be there.
|
|
|
|
|
Thanks, AlexO pal!
Is there a C/C++ standard precompile directive that
can be used to identify on which OS the project is
compiled.
Thanks in advance,
George
|
|
|
|
|
Correction _WIN32 (according to MSDN) is the macro defined by VC compiler. It could be used to id the compiler/target for portable code
|
|
|
|
|
Thanks, AlexO pal!
George
|
|
|
|
|
_WIN32 is defined by the compiler automatically when you do a compile for a WIN32 application.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thanks, Smith.
Do you mean _WIN32 or __Win32__?
Thanks in advance,
George
|
|
|
|
|
I can find no reference to a __Win32__. However, looking at STLPort, _WIN32, __WIN32, WIN32, and __WIN32__ were generated at different points by different compilers.
Currenty, only _WIN32 is defined by the compiler.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thanks, Tim pal!
Where can I find the table of all the C/C++ standard
precompiler directives and their related meanings?
Where can I find the table of all the Windows/MFC standard
precompiler directives and their related meanings?
Thanks in advance,
George
|
|
|
|
|
Can anyone give me a simple explanation?
Thanks in advance,
George
|
|
|
|
|
It is setting the contents of memory location zero, to zero. Seems a pretty good way to crash the machine...
|
|
|
|
|
Thanks, though I do not know who are you.
Have a nice day,
George
|
|
|
|
|
You can read this as:
long *p = NULL;
*p = 0;
This will give you an access violation (aka GPF). This kind of thing is good only for testing exception handling mechanism, or making your customer pay for fixes
I see dumb people
|
|
|
|
|
|
Hello,
The question looks stupid, but I can't figure how to do that.
The structure of my application is an MFC SDI.
In CMainFrame::OnCreate(...) I create a toolbar which contains some dialogs (see http://www.codeproject.com/miscctrl/rollupctrl.asp)
and I want to control the state of some buttons of the dialogs depending on the content of my active document.
So my question is when are all the dialogs, the document etc... built into the memory so I can access them and change the states?
Thank you for your help,
loic
|
|
|
|
|
Look at OnInitialUpdate to set up the views or PreCreateWindow for the child and mainframe.
~RaGE();
|
|
|
|
|
Thank you, I figured out to do what I was looking for with OnInitialUpdate and OnUpdate!
loic
|
|
|
|
|
I need to improve the way I am reading from a .csv file. The files could get very large > 2MB. When new information needs to be stored, it needs to be placed at the end of the file. The problem is that I need to check if I am placing duplicated information in.
The information that cannot be duplicated is always in the second to last, and last positions of each line. For example:
154,56.0,12,57,409956,10976634
55,408.5,505,246,409957,10976637
708,8894.6,13,8074,8945,409958,10976639
The last two numbers on each line are the numbers I need to get. The line lengths are not going to be the same, so I can't read backward the same amount to get to the next previous line.
There are some tricks I can do to prevent me from reading back through the entire file, but I don't want to flood you with details.
Is there a better way to read backward - line by line? I am currently reading one byte at a time until I see the \n character. Once I'm there, I keep reading until I see 2 comma characters.
I did some testing, and some lines are taking up to 250ms each! This will never work for what I need this for.
Thank you for any help you may be able to provide.
|
|
|
|
|
Dave_ wrote:
Is there a better way to read backward - line by line? I am currently reading one byte at a time until I see the \n character. Once I'm there, I keep reading until I see 2 comma characters.
You need to use buffering, then reading will be block by block, then searching for the last \n will be faster, but it will still be slow. See the tac unix implementation (hey, it's GPL'ed it should be easy to find it) for a sample good performing implementation. If you don't know, cat is the unix command like the "type" on DOS, and tac is the command that do it backwards.
Approach 2: Since (it seems) you are only appending to the file it's easy to keep a (binary) index file with the position of the lines.
I see dumb people
|
|
|
|
|
Without knowing the details of what you are doing, here a few things that you might be able to put together to achieve your goal:
1) Use a memory-mapped file, which lets the OS control the blocking and reading and lets you access the file contents as a large array. See http://www.codeproject.com/win32/cmemmap.asp[^]
1a) You could then try the reverse string/char search (strrchr?) in the array looking for the '\n' end-of-lines.
2) Use strtok to break a given line into tokens, to isolate the last two numbers, using the comma as the field delimeter.
3) When reading from files (without the memory-mapping), you can read an entire line by specifying in the format string to 'read until I find a specified character'. This is done by specifying "%[^'\n']s" which is the "%s" format with the allowable characters in square brackets, but specified "everything until" by using the caret and the single char "newline" in single quotes.
The memory-mapping seems to me to be your best bet.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
This is probably a very newbieish question:
In a MFC application, if CString sPathname is the full path for a valid file (i.e. sPathname = "C:\My Documents\image.bmp"), what is the simplest way to find out the size of that file?
|
|
|
|
|