|
I created 2 sliders in my dialog box. The problem now is that i can only set the range in whole number.eg (0-100). I need to set it in float .eg (0-1) Can anyone help me out?Below is part of my program.
BOOL GrowDialogBox::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_slider3.SetRange(0,1);
m_slider3.SetTicFreq(0.01);
m_slider4.SetRange(0,1);
m_slider4.SetTicFreq(0.01);
minnSliderPos = 0;
maxxSliderPos = 1;
// For displaying numbers on the box
s3.Format("%f",0); // Set it to 0 for min and 1 for max
m_EDIT3.SetWindowText(s3);
s4.Format("%f",1);
m_EDIT4.SetWindowText(s4);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
My warning received is
warning C4244: 'argument' : conversion from 'const double' to 'int', possible loss of data
|
|
|
|
|
First off, the control does not allow float parameter. Once this is known, you can stop trying to fit that square peg in that round hole.
What you will need to do, and I suspect other have done, is to scale your input to an appropriate integer range.
So lets say that you want your slider to show be in the range 0 - 0.1. Then what you can do is multiply all your values by 100, and set the slider range to be 0-100. Use the reverse technique when retrieving values from the slider (divide by 100, to get the true value).
Hope this helps
I Dream of Absolute Zero
|
|
|
|
|
Hi all!
Can you hepl me?
I have a problem When I compile my project.
my Project was written by MFC/Single Doc/View.
I use Window 2000 EN, and Visual C++ 6.0 EN.
My project was compiled to Release and Debug successfully.
In Window2000 EN,The Release version run very well. But it can't run In Window2000 JP.
However, The Debug version run in two the environments. Then I can use Break points.
Do you know the bug.
Thanhx you very much.
LiLiTrang
|
|
|
|
|
|
Have you taken care of your language resources ?
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
When I use the WriteConsole method I always get a "First-chance exception in FileBinary.exe (KERNEL32.DLL): 0xC0000005: Access Violation." in the output window within Visual Studio, however the text that I sent in the WriteConsole method appears correctly on the console window.
Does anyone know what I am doing wrong (I've attatched some sample code below which just sends an end of line to the console, AllocConsole has already been called elsewhere in my program)?
LPDWORD s = 0 ;
CString myStr = "\n" ;
HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ) ;
WriteConsole ( h,
myStr ,
myStr.GetLength ( ),
s,
NULL ) ;
cheers,
Andy
|
|
|
|
|
LPDWORD is a pointer. You need to pass a valid memory location to the WriteConsole function, not just a random pointer. Also, cast the CString to a LPCTSTR manually, before turning it into a VOID*.
DWORD s = 0 ;
CString myStr = "\n";
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
WriteConsole(h, (LPCTSTR)myStr, myStr.GetLength(), &s, NULL);
|
|
|
|
|
thanks for your very quick reply, I'll give that a try.
Andy
|
|
|
|
|
I wants to crate Trial Version of My appliation.
Can anybody suggest a good way crate Trials.
storing information in registry is very unsafe.
please suggest any other option
Sudhir Mangla
http://Programmerworld.net
(Free books , articles , Source Code and Programming Tools and Utilities)
|
|
|
|
|
Have a look[^].
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
|
Hello,
You know what the problem is all the trial software (from a business point of view)? They get cracked way to often. Why? Because the trial is the complete program, that has all the functionality locked by some registration technique.
I create the trial version of my app by building different configurations. Use the preprocessor to exclude functionality that you don't wan't in your trial version.
When the user registers, you can always give access to the full version on your website of whatever..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
They get cracked way to often.
I'd say always.
"Go as far as you can see,and when you get there you'll see further" - Unknown
|
|
|
|
|
And for some people, this is actually a good thing..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
And for some people, this is actually a good thing..
Yes for people who don't want to pay and prefer using cracked software..
Anyway some software use internet for checking the validity of the registration,that would be good if not..
For example my friend had a cracked software but after cracking it in few days it asked to register again and again.But itried and restricted its access to internet via ZoneAlarm Firewall and then it worked.
"Go as far as you can see,and when you get there you'll see further" - Unknown
|
|
|
|
|
Giorgi Moniava wrote:
Yes for people who don't want to pay and prefer using cracked software..
I really want to pay for the software that I use, but my budget is not allowing it... If I didn't use all the stuff that I don't pay for, I wouldn't even be half the programmer I'm today. So I must thank the crackers for that...
Besides that, I don't even think that MS bothers that all their programs get cracked. I even think that MS is happy that so many people use their SW, cracked or not.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
I really want to pay for the software that I use, but my budget is not allowing it... If I didn't use all the stuff that I don't pay for, I wouldn't even be half the programmer I'm today.
Me too
Bob Stanneveld wrote:
Besides that, I don't even think that MS bothers that all their programs get cracked. I even think that MS is happy that so many people use their SW, cracked or not.
i agree, i don't think that they are trying too hard to prevent their programs from being cracked.
Because there are several softwares(Antivirus softwares,Firewalls,...) which havent been cracked because they use the registration via internet and some additional techniques using internet too.
"Go as far as you can see,and when you get there you'll see further" - Unknown
|
|
|
|
|
In the past (when a serial numper would work for any ms program that asked to tbe same number of digits) I would definitly say this. In my case we actually had licenses for the software but sometimes I forgot to bring my licence code list with me (to an offsite location) so this was a big time saver as I had 2 of the codes in the list memorized.
But now with the 25 digit codes that are tied to a specific product version I have to have my codes with me at all times. Being an educational institution we do not have any software that has product activation turned on so there is not much I can say about this.
John
|
|
|
|
|
I wanted to learn how to drive.
I went out on the street of the local neighborhood and hot wired cars at night and went on joyrides.
People did not seem to mind, they had another car in the garage, and they only needed the car I was borrowing for their day jobs anyway.
I would not be half the driver I am today, because I could not afford the car or car insurance or gasoline at the time I was learning to drive...
Well, every industry has an entry cost. Just because yours was too high to be met, does not make what you did/are doing any less illegal.
Glad you are here to help, all the same
|
|
|
|
|
Blake Miller wrote:
Well, every industry has an entry cost. Just because yours was too high to be met, does not make what you did/are doing any less illegal.
True, but I only use them for educational purposes (which doesn't make it any more legal). I think that college, the government and / or the business world should provide students with the tools they need so they can get to a professional level more easely. And it has benefit both ways..
But since the business community only cares about money, a free student license will never be available..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
wrote this code about the Matrix project here is a part of the code to input the matrix or a vector with a dynamic allocation:
double*vector ; int num ;
cout<<"enter the size of the vector"<<\n;
cin>>num;
vector=new double[num];
for(i=0;i<num;i++)
{
cout<<"enter the element"<<i+1<<"in the vector"<<\n;
cin>>*(vector+i)
}
this for input the vector but for input the matrix i made it in another function:
double*grade ; double**matrix ; int row ; int col;
cout<<"enter the number of rows then coloumns in the matrix"<<\n;
cin>>row>>col;
double**matrix=new double*[row];
for(int j=0;j<row;j++)
{
matrix[j]=new double[col]
for(int k=0; k<row;k++)
{
for( int l=0; l<col;l++)
{
cout<<"enter the element"<<l+1<<"in the row"<<k+1<<\n;
cin>>*(grade[k]+l)
}}}
iwant to ask if there is any missing in the followin part of the code
so may you answer these previous questions?
& is this pretag right?
|
|
|
|
|
kosamoza wrote:
cin>>*(grade[k]+l)
grade is a pointer that has not been properly initialized.
kosamoza wrote:
iwant to ask if there is any missing in the followin part of the code
Does the compiler/linker complain about syntax? If not, then you need to determine if any logic errors are present. Did you run the program? If not, that would be a good place to start.
kosamoza wrote:
& is this pretag right?
No. Did you use the Preview button like I suggested yesterday? Even if you forgot, did you go back and look at the post? It's obvious that the formatting is wrong. A lot of the questions you are asking can be answered, if not eliminated, by just taking a bit of initiative.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
what is meant by :
grade is a pointer that has not been properly initialized.
because when i compile the program every thing is right except at this part it gives me error at this part :
cin>>*(grade[k]+l)
so how can i initialize this grade ?
& what is meant by thses errors?
error C2100: illegal indirection
error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'double' (or there is no acceptable conversion)
|
|
|
|
|
The compiler is not going to know if you assigned a valid block of memory to the grade pointer or not. Consider:
int *pNumber = NULL;
*pNumber = 123;
...
int *pNumber = new int;
*pNumber = 123;
...
int x;
int *pNumber = &x;
*pNumber = 123;
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
i am sorry but i really dont understand
for exaple in this proplem i want the program to ask the uswer to input the elements of the matrix so how can i initialize the pointer ?? how can i do this??
sorry but i am really trying to understand
|
|
|
|