|
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 -
|
|
|
|
|
its to bulky calling rand() several times
9ine
|
|
|
|
|
See here.
"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
|
|
|
|
|
Hi All,
Can anyone suggest me the way to implement audio tuner UI. I mean the graph which identifies the intesity of the sound and varies...
Basically I am trying to record from microphone, I need to display the audio tuner waves in my UI when it is recording.
Thanks in Advance,
Poornima
|
|
|
|
|
atimpoo wrote: I mean the graph which identifies the intesity of the sound and varies...
Some chart controls are available on this website (go in the "miscellaneous controls" section of this website). I don't know if they can be used for your application because in general they display 'static' data (you plot your complete series like on a excell chart).
I developped also my own chart control that can display 'dynamic' data (you can add new points to the control) and it's quite fast. Unfortunately, the article is not finished yet (I started to write it) and it will be available soon. If you need it now, I can send you what I have yet (the documentation is not complete).
|
|
|
|