|
Great reply
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
OK... I'll bite how do you do this?
|
|
|
|
|
Sorry, I didn't mean to be cryptic. It's no different than using reference parameters in a method for a class that's local to your app. I hope I didn't misunderstand your original question.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
hello
i want to do an autorun for one CD , how i can do it?
|
|
|
|
|
Autoruns are controlled by the AUTORUN.INF file in the root of the CD. Search the web for references to that file (or more specifically, MSDN).
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
When I set the compiler to use dinamically linked MFC (DLLs), I've got no problem.
When I set MFC as statically linked library, I've got the following error:
--------------------Configuration: VHDrCoST05 - Win32 Debug--------------------
Compiling resources...
d:\Microsoft Visual Studio\VC98\MFC\INCLUDE/afxres.rc (120): error RC2151 : cannot reuse string constants, 61446(0xF006) - "%s - Slice #%d (%s) " already defined. Cannot add 61446(0xF006) - "an unnamed file".
Error executing rc.exe.
I need some urgent help, please!
Thanks
|
|
|
|
|
It sounds like you are using a resource id that MFC also uses. Resources in a DLL can have the same id's and not cause problems because they resources are accessed independantly to the .exe You will either need to change your .exe resource id's or better still use the MFC DLL's. BTW MFC documents the ranges of id's you should be using so you don't get these clashes.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
From the help of Robert, david and Jamie I was able to generate a random number.
I was only able to generate an int.
I need to generate a double.
the rand() function returns an int.
Does anyone know of a function or a way to generate random doubles or longs?
Here is the link to my earlier question if you were interested.
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&fr=26#xx534209xx
Thanks for all the help,
sj
|
|
|
|
|
|
I was trying to generate a random number between a min and max.
I would pass the double min and double max to the function and generate a number between the 2.
this is what I was trying to do:
thanks,
sj
I get an wrror though that says there is a double on either the right or left side.
<br />
double d = min + (double)rand() / RAND_MAX;
for(int i = 0; i < 100; i++){ <br />
<br />
}<br />
|
|
|
|
|
For a range of 0.0 to 1.0 use
double d = (double)rand() / (double)RAND_MAX;
You can then scale and offset the value to get it within the desired range.
The Ten Commandments For C Programmers
|
|
|
|
|
How's this for a hack?
#pragma pack (push, 1)
union
{
double d;
struct
{
short a;
short b;
short c;
short d;
} s;
} u;
#pragma pack (pop)
u.s.a = rand();
u.s.b = rand();
u.s.c = rand();
u.s.d = rand();
double Random = u.d;
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
That will generate crashes.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
care to explain why?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
scolinks, what you did requires a person to enter an integer and then press the enter key. this poses 2 problems:
1. the user has to enter a key, then hit enter, where as _getch() just requires a keypress
2. if the user enters something other than a number, say, the letter 'q' the program will screw up and yell at you.
|
|
|
|
|
I'm still having the same problem. I did try the _getch(); at the end of my simple program and it compiled ok, but the stand alone .exe flashes for a brief second and then vanishes. I created a simple console default "hello world" program. The final release version will not stay open. However, it works ok in VC++. What could be the problem? I didn't see any property options to choose from on this.
Thanks
|
|
|
|
|
Just try to compile this code:
<br />
#include <iostream><br />
#include <conio.h>
using namespace std;<br />
<br />
int main()<br />
{<br />
cout << "Test" << endl;<br />
<br />
cout << "Press any key to return to system..." << endl;<br />
<br />
int Test = _getch();<br />
<br />
return 0;<br />
}<br />
This works on my machine - and on yours?
|
|
|
|
|
Can someone tell me how to move the cursor to the bottom of a rich edit control please?
|
|
|
|
|
This should work:
int iLength = RichEditCtrl.GetTextLength();
CHARRANGE nRange = { iLength, iLength };
RichEditCtrl.SetSel( nRange );
This sets the selection to the end of the string. If you want it to scroll to that area, I'm not sure of the API.
Wrongway
|
|
|
|
|
|
Hi!
I am a beginner and I have a problem!
I am using the DHTML edit control to let the user enter his/her text. After that he or she clicks on a button and this calls a function. I managed to write a function which reads the text line by line, adds infront of and after each line a Document.write(' and ') and saves it on a file. Well my program works fine if the user writes only one line but if it writes more than one my code doesnt work fine any more because it adds the ') after making a new line!
The users entry just like on the control:
Hi! I am your user.
How are you?
And my program makes this (it can make it correctly if there is only one line to render!):
document.write('Hi! I am your user
')
document.write('How are you?
')
and a webpage with a javascript code like this gives an "undetermined string blabla error!".
Why does it puts the ') after making a newline? Does the dhtml control add something to the text to signal a newline or .....? very
Can someone help me?
please....
Thank you for your future answers!
|
|
|
|
|
What function are you using to read each line from the edit control?
|
|
|
|
|
for example, student is a struct, student *std is defined in class CApp. how can I use std in class CDlg?
thanks!;P
|
|
|
|
|
Have a third class which holds this information, and query it from both of your original classes.
Or, have a global instance of the structure, and reference it using EXTERN CAPP::STUDENT *std
|
|
|
|
|
thank you very much!! i solved it !
|
|
|
|