Thanks, It looks like my assert is failing in the call to SetRegistryKey? I don't rememeber writting this part of the code? How would my code cause this bug? Thanks
rbc
Posts
-
Debug information crashes my app :( -
How to size and move a view when it is createdHi, I want my MyView to appear at x,y = 1,20 and be 1280 pixels wide and 800 high when it initially appears. I believe this is the code to move and size it ...
CFrameWnd* pParentFrame = GetParentFrame(); ASSERT_VALID( pParentFrame ); pParentFrame->MoveWindow( 1, 20, 1280, 800 );
... but what method should I put this code in? If I put in MyView::OnDraw everytime the View needs to be re-drawn it moves and resizes. I just want it start and 1,20 initially. -
How should I set a pixels color?:wtf:
-
How should I set a pixels color?Cool web page. You are obviously no stranger to generating fractals! Yet I am. How would you write a mandelbrot program in Visual C++? :)
-
How should I set a pixels color?How should I set pal[3] through pal[255]? Am I using a 8-bit display? How do I use a 24-bit color?
-
How should I set a pixels color?Hi Christian, Yes I want to use 256 colors. How could I use the RGB macro when
int CMand_View::Mandel_calcColor( int X, int Y )
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 ); :) -
How should I set a pixels color?That's a good question! How do I use a palette? I thought just using the marco ...
PALETTEINDEX(c));
... would handle all that for me :laugh: Something is going on as my program shows the mandelbrot set all in green! :wtf: -
How should I set a pixels color?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 ...
... void CMand_View::OnDraw(CDC* pDC) { ... for( int i=0; i<320; i++ ) { for( int j=0; j<200; j++ ) { int c = CMand_View::Mandel_calcColor( i, j ); pDC->SetPixel(i,j, PALETTEINDEX(c)); } } } ... double CManel_View::Mandel_Abs ( double real, double img ) { double rc = real * real + img * img; return sqrt( rc ); } int CMand_View::Mandel_calcColor( int X, int Y ) { int N; // WHILE-loop control variable double XPos, YPos; // The real and imaginary parts of C double RealPart; // The real part of Z double ImagPart; // The imaginary part of Z int AbsZ; // BOOLEAN; double Temp; double width = 320.0; double height = 200.0; N = 0; AbsZ = TRUE; RealPart = 0; ImagPart = 0; XPos = X / width * (XMax - XMin) + XMin; YPos = Y / height * (YMax - YMin) + YMin; while ( (N < Iterations) && (AbsZ == TRUE) ) { N++; Temp = (RealPart*RealPart) - (ImagPart*ImagPart) + XPos; ImagPart = 2.0 * ImagPart * RealPart + YPos; RealPart = Temp; AbsZ = (( CMand_View::Mandel_Abs (ImagPart, RealPart) <= Bailout) ? TRUE : FALSE); } //end while if (AbsZ == 0 ) { return (N + sColor) % Colors; } else { return 0; } } //end calcColor
I think that this ...pDC->SetPixel(i,j, PALETTEINDEX(c));
... is not right. :confused: -
'sqrt' : undeclared identifierDOH!:-O Thanks!
-
Cvs on WindowsI use CVS on windows. It came with cygwin
-
'sqrt' : undeclared identifierI am including math.h but codeproject thinks le math.h ge is somekind of HTML tag! X| And WTF is this ... I suggest that it's a wise course of action when people answer your question to try the suggested solution before arguing about it. ... about? I am not arguing about anything :omg:
-
'sqrt' : undeclared identifierMy code looks kinda like this ...
#include "math.h"
#include "stdafx.h"
.
.
.
double BlahBlah::Blah_Abs ( double real, double img ) {
double rc = real * real + img * img;
return sqrt( rc );
}
.
.
.Yet the compiler does not complain about not be able to find math.h in the include path so I must assume that VC++ knows about math.h and since the compiler errors on
sqrt ( rc );
I guess thatsqrt( double )
is not declared in math.h :confused: -
'sqrt' : undeclared identifierWhy is that Visual C++'s GUI knows about
sqrt
yet the compiler doesn't? :confused: As I edit my source I typed in sqrt and as I start to type in the paramters the GUI presents me with 3 different prototypes ofsqrt
... I think cool Visual C++ knows aboutsqrt
... so I typedsqrt( myDouble );
as per the GUI. Yet I get a compiler error? X| -
Goodbye California, welcome GermanySEND BEER!:laugh:
-
Developing Programstry this link.
-
legacy Visual C++ code and .NETHi All, I have some old Visual C++ code that I think would work well as a "web service". Is it difficult to convert my existing VC++ code to .NET code? Does that even make sense? :confused: Please help!
-
MFC APLICATION AND MANAGED CODEHi Nish, I am new to programming and have never heard of a __gc wrapper? Could you tell how I can find out more about __gc wrappers? Thanks
-
Legacy Visual C++ and .NETHi All, I have some old Visual C++ code that I think would work well as a "web service". Is it difficult to convert my existing VC++ code to .NET code? Does that even make sense?:confused: Please help!
-
How can I see line numbers?I feel dumb asking this question ... but what the heck. You know how sometimes a program writes to the console stuff like ... main.cpp line 345 cannot open file blah.dat ... I want to open the file main.cpp and have to cursor go to line 345. How do you do that with the VC++ 6 editor? Thanks ;P
-
Questions of the Day wantedHere's one ... What is the icon next to VC++ 6 Build >> Rebuild All suppose to be? Why would anyone think that funny looking icon says "Rebuild All"? :wtf: