|
Thanx! It works!
|
|
|
|
|
In xp prof window when we click start->Run then run window(with title Run) appears
is there any way in a program that this window appears programatically ?
if it is an exe file where is it?
so that i could start it like a process.
r00d0034@yahoo.com
|
|
|
|
|
It's a pretty simple thing, just use SHBrowseForFolder ( or whatever it is ) and ShellExecute and build your own.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I want to modify or set global printer setting.
1) Enter to Control_Panel -> Printer
2) right click on printer list and change setting
but I want to set from visual c++
How can I do that ?
Thank in advanced for your kindness
|
|
|
|
|
I don't remember the details, but I am sure MSDN has a code snippet that does this. msdn.microsoft.com[^]
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I can't find what exactly is this (I already search it)
Please tell me
Thanks a lot
|
|
|
|
|
I'm sorry, I'm not trying to be difficult, I really don't know. I did this stuff 2 years ago and am sure it was there now, but they've been removing a lot of the useful stuff for VB.NET and C# information lately....
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Perhaps EnumPrinters() and SetPrinter() may help. (This is just a guess). Good luck!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
It's application default setting. I had try it before
Anyway. Is there set global printer setting ?
Thanks a lot
|
|
|
|
|
Hi,
I'm using Tahoma font ( well I've tried with Arial as well and...), I have realized when I display the text rotated (90º) it is not stretched at all ( in the normal way, sometimes I see that some letters have no space between them).
The problem is that GetTextExtentPoint doesn't calculate that extra space, so when I show the text rotated some times it doesn't fit to that space .
Is there a way to apply the same spacing for normal and rotated font layout ?, Or a way to calc the extra space needed for rotated fonts ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
Hi,
I have a slider control if i click on the slider,
thumb doesn't move the exact position where i had clicked.
How can i make to move to exact position where i had clicked?
Regards
Neha
|
|
|
|
|
Increasing the resolution of the range should do it.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I am trying to write a simple Mandelbrot set Visual C++ program.
I assume that I am not handeling the setting the color of a pixel
correctly.
Here's some of my code ...
<br />
...<br />
void CMand_View::OnDraw(CDC* pDC)<br />
{<br />
...<br />
for( int i=0; i<320; i++ ) {<br />
for( int j=0; j<200; j++ ) {<br />
int c = CMand_View::Mandel_calcColor( i, j );<br />
pDC->SetPixel(i,j, PALETTEINDEX(c));<br />
}<br />
}<br />
}<br />
...<br />
double CManel_View::Mandel_Abs ( double real, double img ) {<br />
double rc = real * real + img * img;<br />
return sqrt( rc );<br />
}<br />
<br />
int CMand_View::Mandel_calcColor( int X, int Y ) {<br />
<br />
int N;
double XPos, YPos;
double RealPart;
double ImagPart;
int AbsZ;
double Temp;<br />
<br />
double width = 320.0;<br />
double height = 200.0;<br />
<br />
N = 0;<br />
AbsZ = TRUE;<br />
RealPart = 0;<br />
ImagPart = 0;<br />
XPos = X / width * (XMax - XMin) + XMin;<br />
YPos = Y / height * (YMax - YMin) + YMin;<br />
<br />
while ( (N < Iterations) && (AbsZ == TRUE) ) {<br />
N++;<br />
Temp = (RealPart*RealPart) - (ImagPart*ImagPart) + XPos;<br />
ImagPart = 2.0 * ImagPart * RealPart + YPos;<br />
RealPart = Temp;<br />
AbsZ = (( CMand_View::Mandel_Abs (ImagPart, RealPart) <= Bailout) ? TRUE : FALSE);<br />
}
<br />
if (AbsZ == 0 ) {<br />
return (N + sColor) % Colors;<br />
} else {<br />
return 0;<br />
}<br />
}
<br />
I think that this ...
<br />
pDC->SetPixel(i,j, PALETTEINDEX(c));<br />
... is not right.
|
|
|
|
|
Are you using 256 colours ? Try it in a higher res. The last paremeter as an RGB value ( as returned by the RGB macro ) will work. It will be slow though. A DIBSection would give you a pixel array to set directly instead.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi Christian,
Yes I want to use 256 colors.
How could I use the RGB macro when
<br />
int CMand_View::Mandel_calcColor( int X, int Y ) <br />
returns an int and not 3 ints?
Should I some how derieve the 3 ints (r, g, b) from c?
Where c = CMand_View::Mandel_calcColor( X, Y );
|
|
|
|
|
It looks like you're header for 24 bit colour and Chris has sorted it all out for you. Good luck !!!
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
|
That's a good question!
How do I use a palette?
I thought just using the marco ...
<br />
PALETTEINDEX(c));<br />
... would handle all that for me
Something is going on as my program shows
the mandelbrot set all in green!
|
|
|
|
|
the simplest way is to just come up with an array of COLORREF values:
COLORREF pal[MAXITERATIONS];
pal[0] = RGB(0,0,0);
pal[1] = RGB(64,64,0);
pal[2] = RGB(128,128,0);
...etc
then, in your loop, just use "pal[c]" instead of that PALETTEINDEX macro.
an 8-bit display is pretty rare these days. you might as well just aim for 24-bit color.
-c
Please stand by
|
|
|
|
|
How should I set pal[3] through pal[255]?
Am I using a 8-bit display?
How do I use a 24-bit color?
|
|
|
|
|
rbc wrote:
How should I set pal[3] through pal[255]?
pick a set of colors that looks good. in my opinion: 1. fractals work best when the palette fades between two or three colors and 2. generating the palette is as important as picking the right region to render: http://www.smalleranimals.com/thumbfrax/thumbs/_index.htm[^]
rbc wrote:
Am I using a 8-bit display?
i don't know.
rbc wrote:
How do I use a 24-bit color?
don't do anything. just render the pixels by using their COLORREF values.
-c
Please stand by
|
|
|
|
|
Cool web page. You are obviously no stranger to generating
fractals! Yet I am. How would you write a mandelbrot program
in Visual C++?
|
|
|
|
|
rbc wrote:
How would you write a mandelbrot program
in Visual C++?
i would start by doing exactly what you're doing just to get a feel for how things work. then i would add controls to move around (zoom in/out, pan, etc.). then i would add palette creation UI (no idea what i'd do for that). then i'd add a bunch of other fractal types.
a tiny mandelbrot program[^]
#include "stdio.h"
main()
{
int b=0,c=0,q=60,_=q;for(float i=-20,o,O=0,l=0,j,p;j=O*O,p=l*l,
(!_--|(j+p>4)?fputc(b?q+(_/3):10,(i+=!b,p=j=O=l=0,c++,stdout)),
_=q:l=2*O*l+i/20,O=j-p+o),b=c%q,c<2400;o=-2+b*.05);
}
-c
Please stand by
|
|
|
|
|
|
I need to program a code in which I have to return the execution time of a function in lowest time unit possible(like in millisec. or even lower) by the operating system. Can someone tell me what library call I can use in WindowsXp environment.
Thanks
Matthew
|
|
|
|