|
SilverShalkin wrote:
Like int, the amount of bits used up by them, how fast it is to declare them, how fast it is to change them or recall them, everything.
The size of int is implimentation specific, but most of what you're after here is pretty useless. The time it takes your computer to initialise an int is NEVER going to be where you need to optimise your game.
SilverShalkin wrote:
If you move that line of code out of that for loop, your program wll run so n so faster"
The truth is that while I recognise that, for example, ++i is faster than i++, in the end, it's not a difference a human could notice in pretty much every case.
SilverShalkin wrote:
when will i feal like i have a little bit of knowledge into somthing that i have spent every day after school to study till my bedtime?
I've been going for years, and I'm still not there yet
SilverShalkin wrote:
Thanks agian for the responses...
Ill start some little projects... "I was on makeing a tetris game, then go to a block out game, pacman, and then mario bro's" But i think ill start slightly below all that, and make some text games, and try to bring some image's into it.
So long as you know all the stuff I mentioned, and for games, especially the std library stuff. You'll find the STL invaluable for game programming. I'd also suggest that you learn DirectDraw maybe, and do these 2D games in 2D ( maybe with DirectDraw ?). I'd suggest the jump to 3D programming will be the hardest learning curve of the lot for you.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
Hi there,
I have to dig into the pleasent toppic of establishing connection between computer and some external device of the industrial automation area.
Problem: an adapter from 4-20mA to RS232 would be needed.
Do you know where to get them (or at least where to get info on them)?
Thanks for your kind help.
Bunburry
The well-bred contradict other people, the wise contradict themselves.
|
|
|
|
|
RaGe, thankx for your reply.
Example:
a remote pressure sensor, which has an output current signal 4-20 mA (4mA refers to 0 pressure, 20 mA refers to maximum pressure, 10 barg).
I have have to display the pressure as a function of time.
4-20mA is a 2-wire cable which I cannot connect to the serial port, as a result of which I will need an adapter which would convert a 2-wire current output of pressure sensor to an understandable signal for the serial port.
I am interested in any kind of equipment which can directly be connected to the computer over serial port.
Thankx
Bunburry
|
|
|
|
|
just wondering if anybody could help me with a little project I'm at.
Basically I'm trying to extract text [and info] from a pdf file. Anybody have any ideas? [in general C++, not MFC]
Can't seem to find any articals on this.
<centre>
Now taking suggestions for a new sig. please email me all suggestions.
|
|
|
|
|
Have you looked here yet?
http://partners.adobe.com/asn/developer/acrosdk/docs.html
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
You might want to check out CLIBPDF from www.fastio.com.
|
|
|
|
|
In my program I need to test if the Selected Item in a tree control is at the end of a root. I'm guessing that I can get the info out of an HTREEITEM but I dont konw how to get the info. How can I get it?
Thanks in advance.
-Raffi
|
|
|
|
|
Hi Raffi,
Do you mean testing if an item is at the end of a branch ? In that case, you
could simply test to see if it has any child items with GetChildItem(hItemSelected),
which will return NULL if no children exist.
Alwin
|
|
|
|
|
Thanks alot
-Raffi
|
|
|
|
|
Dear all,
Anybody knows a fastest file read/write method?
It is because i am doing a program and need to read/write a same file many many times, using CFile to read/write is very very slow.
Any suggest method?
Andy
|
|
|
|
|
There is also FILE structure for doing that but I don't know if it is faster than CFile.
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
|
|
|
|
|
An alternative is to use memory-mapped files, for which
some examples can be found on the Microsoft knowledge base. There
also exists a sample called ProcessWalker.
The downside is that it only works on NT or higher (I believe).
Alwin
|
|
|
|
|
Memory mapped files work for all Win32 operating systems.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
why don't you try this in pure c?
e.g.:
FILE *fp1;
char word[100];
char c;
fp1 = fopen("yourfile.txt", "r");
do
{
c = fscanf(fp1, "%s", word);
DoSomethingWith(word);
}while (c != EOF);
fclose(fp1);
Bunburry
|
|
|
|
|
A memory mapped file will still be faster because you will be accessing the file directly in memory.
You will have a pointer that points directly to the buffer that contains the file.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I believe the multi-media IO functions provide the fastest file read/write performance on windows. Check out the mmioOpen function and all of its associated functions.
In an app I developed a couple of years ago, my tests showed that mmio outperformed every other method. I don't have the stats for just how much, but it was enough to make a difference.
My 2 cents.
Matt Gullett
|
|
|
|
|
Please some body explain me why is this coming
warning LNK4089: all references to "OLEAUT32.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "comdlg32.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "ole32.dll" discarded by /OPT:REF
Thank
Gaurika.;P
Gaurika Wijeratne , www.gaurika.com
|
|
|
|
|
The linker discarded the dll:s, as it found them unneccisary (probably the functions were packaged into COMDATs). If you want to link them in regardless, use /OPT:NOREF instead - or use /VERBOSE to see what was removed.
/moliate
|
|
|
|
|
How can I use /OPT:NOREF instead - or use /VERBOSE
I mean were to put it.
Thanks
Gaurika..
Gaurika Wijerante
|
|
|
|
|
Project -> Settings -> [Settings for Win32 Release*] -> Link -> Add to project options (add /verbose here)
* I assume you are doing a release build here, as the default for a debug build is /OPT:NOREF
You should now get a lot of information from the linker what is done in each pass.
An introduction to some optimizations the linker does can be found at: http://www.iecc.com/linker/linker11.html
/moliate
|
|
|
|
|
Dear moliate
Thanks I will Try it.
Gaurika..
|
|
|
|
|
Why in the world would you want to link in DLLs that you aren't using. If you want to get rid of the errors, then remove those DLLs from the link list. Or add them to the exclude list.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hi.
I am stuck in the design process of a small program I am working on. Here is the scenario.
-----
- user select an option in the menu
- main thread creates a dialog box w/ process bar
- dialog box's OnInitDialog() sends a message to main frame
- main frame redirects to view
- view creates a worker thread
- worker thread goes through a for loop // (i = 0, 1 < 10000; ++i);
- worker thread posts a message to main frame on every iteration
- main frame redirects message to view
- view calls a function in dialog box to update process bar
-----
Okay. The design above works fine. Here is one drawback. Even though the worker thread does all the processing (for loop), the main thread is *inaccessible* as it calls the function in the dialog box to update the process bar.
I would like to redesign that part of the program so that even as the worker thread is processing the for loop and as *some thread* updates the process bar, the user can still navigate the program.
Do I need to create a worker thread to update the progress bar? Do I need a UI thread? The reason I kept the dialog box as part of main thread is because according to Prosise, it is best to keep UI related objects in main thread.
Thanks,
Kuphryn
|
|
|
|
|
How long does it take your dialog box to update the progress bar? Is that a long complicated process? Is your dialog box modeless?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Okay. First, I will answer questions.
1) The interval of the progress bar varies from data to data. Consider, for example, the process of zipping data. Zipping varies from data to data.
2) The dialog box is modeless. The dialog box is a private member in view.
-----
I want to clarify the actual problem. I saw a response from a member that implied that my description was not easy to understand.
The design works fine.
- worker thread handles data processing
- main thread (view) sends messages to dialog box
- dialog box updates the progress bar
The problem is that I believe the process of updating the progress bar is *considered* as part of the main thread. I think the reason is because the dialog box itself is declared in view (main thread).
I need three *independent* processes.
1) data processing
2) dialog box/progress bar updating
3) main thread is idling thus keeps the program from "locking."
Problem: Program seems to "lock" even though the data processing is done in the worker thread.
Question: I believe the reason it seems to "lock" is because as main thread sends message to dialog box to update the progress bar and as the dialog box update the progress bar, the frame considers the entire process (message + updating) as being in the main thread. I need to know a way to make everything separate.
Kuphryn
|
|
|
|