I did some quick searches of google and daniweb, but i cannot find anything on how i can do this.
instead of a long and probably misunderstood explanation i have this:
[img]http://matrixpeckham.googlepages.com/sandscreens.jpg/sandscreens-large.jpg[/img]

short explanation:
is a falling sand game.
list at right can change whenever a new text file is loaded.
text files can be loaded.
click button in menu and new window pops up that shows the text file, which can then be edited and saved, which will also change the list.
when text file is loaded the program re-organizes the list and completely changes the way that the sand(and whatever else is there) works.
the slider at the bottom controls the size of drawing.
clear button clears as the pause button pauses (name=function yay).
and finally my main point the top left box of black and colors is all drawn using pixels and text of the position of the mouse, and the stuff under it.

huh, not so short...

so i am basically trying to take the program i wrote in java, and rewrite it in VC++, to make it faster and to help me learn some stuff about VC++ :)

if you need more info about the program, including source it is hosted on my site (in my signature). the source is in my optimizing code thread in the java forum. man, i hope this stuff isn't snipped, it may help people solve my problem

thanks, if any of this stuff is already covered somewhere please point me to it.

thanks in advance

Recommended Answers

All 15 Replies

so i am basically trying to take the program i wrote in java, and rewrite it in VC++, to make it faster and to help me learn some stuff about VC++ :

I recently had to do just that and it wasn't pleasant, not in the least. Finishing it sure felt good though. Best of luck to you.

thanks, i'm doing it because of speed issues with java.

i spent a lot of time on this project, an i will spend just as much time converting it (i hope that's a lie).

If you want to convert that to c++ then you will also have to select a platform, such as MS-Windows, MAC, *nix, etc. Then you have to select a GUI library. wxWidgets and QT are pretty portable among platforms. You can use pure win32 api functions, but of course you loose portability.

i know i will loose portability, and it is not my concern. Microsoft Visual C++ is the win32 API, correct?

i thought VC++ was only for windows, is that incorrect?

>>Microsoft Visual C++ is the win32 API, correct?
No -- its a compiler. You get the win32 api by including windows.h, and most any compiler that runs under MS-Windows os can do it as long as the libraries are installed.

>>i thought VC++ was only for windows, is that incorrect?
Yes. But with special software (I forget its name) you can run it under *nix too.

ok, i really want to know how i can take a form and draw on it, or a component of it, with single pixels

But with special software (I forget its name) you can run it under *nix too.

I think you mean Wine.

@sciwizeh: you can make programs with Visual for other Operating systems, but for drawing you should use something like wxWidgets (as Ancient Dragon mentioned) instead of the win32-api

[edit] ah, you replied very fast. To draw a pixel, look at the function Setpixel()

Tutorial. It doesn't show you how to draw, but shows how to create a window. After that you using win32 api GDI functions to do the drawing. You might also check these out.

thanks for the links.

i saw somewhere someone was using a class called CDC to draw, but they didn't explain it at all, what is it?

CDC is a Microsoft MFC (Microsoft Foundation Class) c++ class. The only way to get it is to buy with your $$$ the Professional version of Visual C++.

i got Pro, from dreamspark through Stony Brook for free. yay :)

so how does it work?

Linky Also check the DVD because it probably has several example programs.

thanks for the link again.

i didn't get a DVD, i downloaded an iso file and had to burn it myself. using it just installed it. would that be the DVD i would look for samples in, wouldn't they be installed with the rest of the VS stuff?

again thanks for the link. is there a way to get a bitmap that represents what is currently on a panel, or picturebox, which can be altered?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.