|
|
Hi,
I'm using VC++ .NET 2003 with MFC and OpenGL to do some ghraphics programming and have come to a rather sticky mess with Splitter windows. No matter how many splitter windows i set up, the opengl graphics only every appear in the last "pane". currently i have assigned the same view with opengl drawing code to every pane, but its only the last pane which will display any graphics. the others never ever et updated, and dont even turn to a black colour. i.e. moving other windows over these panes leaves a mess behind.
has anybody had a similar problem and know of how to fix this?
any help would be much appreciated.
Thanks,
Paul
|
|
|
|
|
You need to make sure that your wglMakeCurrent stuff happens at the beginning and end of the draw function instead of at the beginning/end of the app. This is because openGL can only draw to the current rendering context - so at the moment thats probably the first view/dc that you set it up with.
Its probably better to use the forums at www.openg.org if you need any more help with this kind of stuff.
Hope that helps,
Kev.
|
|
|
|
|
|
i want to check if one field is left empty,
BYTE Field_1a, Field_1b, Field_1c, Field_1d;
updatedata()
cipaddress.getaddress(Field_1a, Field_1b, Field_1c, Field_1d)
if (Field_1a == NULL)
MessageBox("Error")
the problem is if the field is left empty the if statement is not run. what shoud i be checking to see if the field is empty?
thanks
|
|
|
|
|
viperlogic wrote: what shoud i be checking to see if the field is empty?
CIPAddressCtrl::GetAddress() returns the number of non-blank fields.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
i ve done a program where it can create a output file...now i want the same programe also can read frm a notepad..any idea on this...i paste my codes down..
-----------------------------------------------------------------------------<code>#include <iostream>
#include <string>
#include <algorithm>
#include <fstream>
using namespace std;
void DoStuff()
{
ofstream File("MyFile.txt");
cout << "Enter digit: ";
string s;
cin >> s;
cout << endl;
for (int i=0; i<5000000; ++i)
{
random_shuffle(s.begin(), s.end());
File << "Randomised: " << s << endl;
File << " : " << s << endl;
File << " : " << s << endl;
File << " : " << s << endl;
File << " "<< endl;
// File << "Single Row: " << s << " " << s << " " << s <<" " << s << endl;
File << " "<< endl;
}
}
int main(int argc, char* argv[])
{
DoStuff();
return 0;
}
</code> pls help me
|
|
|
|
|
use ifstream like that
ifstream fin;<br />
fin.open("MyFile.txt");
now use fin just like you use cin.
In case of any problem, let us know.
Good luck
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
thing how to change da string to fin!!
|
|
|
|
|
1. speak proper english
2. learn C/C++ before continuing asking questions like the ones you've been asking those days.
you seem to don't even understand what you do and what you want
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
can u u dont interupt....its like u r discouragin me..i m trying to learn ....if u dont like it....u no need to answer my doubts k...let other people who r willing to solve this problem help me..
|
|
|
|
|
He's not trying to discourage you. You will discourage yourself alone if you continue on this way. Learning a programing language is something long and hard. It takes a lot of time to get fluent with it.
The way you are learning it is not really good. In brief, you 'ask' people to do the job for you but you don't even understand what's going on.
I suggest you to find a good book (sorry, I don't know one) that explains everything with some examples. Then, start to do very simple programs that you FULLY understand (like asking the user for a value and displaying it back, opening a file and outputing its content in the console, ...)
If you try to go too fast, you'll be disgusted.
|
|
|
|
|
Bravo !!!
Maxwell Chen
|
|
|
|
|
yes like always
I see all posts in this forum and always Cedric is polite,
But toxcct is very good and he's very good programer.
|
|
|
|
|
thanks for your support Cedric.
i didn't want to offend (even if I knew while posting that it would), but it becomes boring to see that the best this guy can do to learn is reading a C++ book first.
and the other important point i quoted was his SMS'ed typing english, which is not very appropriate to an international forum like codeproject.
i appologize dude if you thought i wanted to discourage you (it's not the case), but consider taking my thoughts as good advices.
regards to all.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Smells like v2.5 beta
~RaGE();
|
|
|
|
|
|
makaveli_07 wrote: now i want the same programe also can read frm a notepad...
Use FindWindow() to get to get a handle to Notepad's top-level window. With that handle, call FindWindowEx() to get a handle to the edit control. Then you can send the edit control a WM_GETTEXT message to get the text contained within it.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
i did a program which randomize the numbers..i need to do time stamp..any idea to do this kind of thing....where i must calculate time taken to find the randomizes numbers...
|
|
|
|
|
GetLocalTime(...)
Maxwell Chen
|
|
|
|
|
makaveli_07 wrote: i need to...calculate time taken to find the randomizes numbers...
Are you wanting to know how long it took to generate a series of pseudo-random numbers?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
can we alter RAND_MAX constant for a rand() function and why is it so small 0x7FFF instead of getting random numbers from a whole range of unsigned int
9ine
|
|
|
|
|
9ine wrote: can we alter RAND_MAX constant for a rand() function
Why ? It is not really necessary. If you need lower values, you can use rand()%YourMaxValue;
9ine wrote: why is it so small 0x7FFF instead of getting random numbers from a whole range of unsigned int
Because it returns an integer
|
|
|
|
|
I'd like to get higher values and wonder if rand() does not return a value from 0...0xFFFFFFFF range. wonder how to get it
What's the reason to constrain MAX_RAND to 0x7FFF?
9ine
|
|
|
|
|
You can get the higher values just like the following...
long lVal = ( rand() << 16 ) | rand();
The following will be more accuarate, I think...
long lLow = (( rand() % 2 ) << 15 ) | rand();
long lHigh = (( rand() % 2 ) << 15 ) | rand();
long lVal = ( lHigh << 16 ) | lLow;
- NS -
|
|
|
|