|
Thanx
But isnt there another way to calculate it???
(* Please say there is *)
BTW:
Do you have by any chance the code of
double sqrt(double)
that defined in math.h???
|
|
|
|
|
I found this solution on the net...
<br />
double sqrt1(double x)<br />
{<br />
double a=0,b = x;<br />
<br />
while (a!=b)<br />
{<br />
a=b;<br />
b = 0.5 * (b + x/b);<br />
}<br />
return b;<br />
}
I did not quite understood how and\or it works...
But it does its job.
Looking to change it from sqrt to root y...
And the most perfect resault...;)
10q all
|
|
|
|
|
Yes I understood....
<br />
<big>b= (b+x/b)/2;
2b= b+x/b;
2b<small>^2</small>= b<small>^2</small> + x;
2b<small>^2</small>-b<small>^2</small>= x;
b<small>^2</small>(2-1)= x;
b<small>^2</small>=x;</big><br />
|
|
|
|
|
Hi
I have a SQL question that looks something like this:
"SELECT DISTINCTROW Table1.strDate AS strDateEx, Sum(Table1.dfValue) AS dfValueEx
FROM Table1
GROUP BY Table1.strDate;"
What i want to do is that i have a table with dates. And i want one row for each day
with the sum for that day in the dfValueEx column. I have no problem on getting the
question to work when i try it in Access.
My problem is that i don't know how i could make this work in a CRecordset. When i try
i get a "Invalid character value for cast specification on column number 1 (strDate)" error.
What does this error mean, and how can i get this to work?
|
|
|
|
|
Strange, a few minutes after i posted the question i got a step further.
As it is now i have all my dates as strings in the database, and tried
to use RFX_Text to bind a CString to that column to get the value.
It seems that the result of a Table1.strDate AS strDateEx is a Date/Time
column, at least i think it is. Becuase when i used RFX_Date i didn't get
the error that i got previous.
But instead i get "Error retrieving record.".
So i still have some problems and could really need som help.
|
|
|
|
|
I'm writing an application for Windows 98 and I've discovered that it doesn't work properly in Windows XP unless the program is set to run with Compatibility Mode set to Windows 98.
Is there way I can have my program check to see if the OS is XP and, if so, whether Compatibility Mode is set to Windows 98 so that it can warn the user if they forget to set the Compatibility Mode?
|
|
|
|
|
Use GetVersionEx() to tell the OS version. Compatibility mode fakes the return value from that API, so if your app is running in compat mode, it will receive v4.10 (the number for 98). If you get back v5.1 or higher, the app is being run on XP or a later OS and you can abort.
--Mike--
Looks like I picked the wrong week to stop sniffing glue.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
This doesn't sound right at all. Surely you are better off fixing the underlying problem.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Neville Franks wrote:
This doesn't sound right at all. Surely you are better off fixing the underlying problem.
Since I don't have Windows XP, I can't do much testing but, since you suggested it, I assume you know what you're talking about.
My program runs perfectly in Windows 95, 98, 2000, or NT (haven't tried ME yet). On Windows XP, it crashes on some machines at various points. On each individual Windows XP machine, it always crashes in the same place but that place will vary from machine to machine.
What is the underlying problem?
|
|
|
|
|
Dov Sherman wrote:
My program runs perfectly in Windows 95, 98, 2000, or NT (haven't tried ME yet).
If you say so.
Dov Sherman wrote:
What is the underlying problem?
I'm afraid without having access to your source code I can't answer that.
I can tell you that if this was my program I wouldn't sleep too well knowing that it crashed on XP and my only solution was to say "use compatibility mode" and it will probably work ok. I'd either say don't use it on XP, use it at your own risk knowing there is a problem and it may crash, or wait untill I get XP and fix the problem before using it.
If you can't afford or justify purchasing XP another option which may help is to add crash handling code which gives you a stack backtrace with symbols. This should assist in pinpointing the cause, and may help you to find a solution.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Dov Sherman wrote:
On each individual Windows XP machine, it always crashes in the same place but that place will vary from machine to machine.
Odd. My first thought would be your app is stomping on memory it doesn't own, and due to changes in the heap manager it only surface on XP. Have you verified correct memory behaviour using something like Purify?
Perhaps you're using multiple threads, and due to changes in the thread scheduler combined with some border case (or assumptions) in your code it only surface on XP?
Since you know where it crashes, have you tried to just create a debug-file (a PDB) even for the release build, get the crashing adress from the remote site, start the app in the debugger and using the "Combined assembly + Source Code" window see what actually could have gone wrong?
Anyway, without further information from you this can only be speculations.
++luck;
|
|
|
|
|
Mike Nordell wrote:
My first thought would be your app is stomping on memory it doesn't own, and due to changes in the heap manager it only surface on XP. Have you verified correct memory behaviour using something like Purify?
As far as I know, I've been very careful with memory. What is Purify?
Perhaps you're using multiple threads, and due to changes in the thread scheduler combined with some border case (or assumptions) in your code it only surface on XP?
I'm not using multiple threads but I did override the MainFrame::Run() function to do my own event handling. Would that cause trouble for XP?
|
|
|
|
|
I want to create a menu in a toolbar like in IE. I tried using a Dialog Bar but it wouldn't work. Is there any way I can create a dockable Menu Bar without using special custom classes? I use an Office XP class that I like and would rather not use another class.
-- Steve
|
|
|
|
|
SteveBob wrote:
Is there any way I can create a dockable Menu Bar without using special custom classes?
Not nicely, but you can fake it by creating a toolbar with buttons that have the TBSTYLE_DROPDOWN. Then just handle the TBN_DROPDOWN notification and display the appropriate menu.
cheers,
-B
|
|
|
|
|
Hi there!
I use a lot the "dependents" utility that vstudio offers. I'd like to have a funcionality in the About box, which wold list all the dll dependencies that an .exe (the current one) uses.
Does any one have a sugestion on how to do it, or where to look for info?
Many thanx in advance.
António Carvalho
|
|
|
|
|
you can do it reading the pe image header of the executable. The dependencies are in the import section of this header.
You can find documentation and source code here: http://www.msdn.microsoft.com/msdnmag/issues/02/02/PE/
I hope this can help you :P
|
|
|
|
|
|
Hi. I am trying to create a very basic basic non doc/view app that loads strings from a file into a list control. The file looks something like this:
2
Hello
Hello
I am trying to use DOS file functions to interpret the int on the top line to figure out how many strings it needs to load. The problem is, I am not very experienced with DOS file functions and wonder if a feat like this is even possible with DOS file functions. Is there a way?
-- Steve
|
|
|
|
|
Yep, just use the standard C stdio functions, open the file, read it into a buffer, and then parse the integer using atoi. If you get stuck, look on the net for examples - every C programming book should go through the above!
|
|
|
|
|
Is there anyway to use the fscanf function?
-- Steve
|
|
|
|
|
FILE *fp= fopen(file, "r");
int i;
if (fscanf(fp, "%d", &i)!=1)
{
}
...
fclose(fp);
A | B - it's not a choice.
|
|
|
|
|
I was just wondering what is used more in the world of C++ MFC or Win32 apps? I know it seems like most games that are made are in Win32 however what about MFC is it used very much and is there jobs that acutally need people that can do MFC? If so where could you get a job doing MFC?
- LiquidKnight
|
|
|
|
|
LiquidKnight wrote:
If so where could you get a job doing MFC?
5 years ago, they were everywhere. now, you need much more than just MFC. every job listing i see requires ASP, Javascript, ColdFusion as well as SQL Server, MFC and VB.
-c
A | B - it's not a choice.
|
|
|
|
|
i think that wenn your able to programm win32 the step to mfc is no problem, because win32 is closer to the api. its like programming basic when your already able to programm c++.
|
|
|
|
|
Hello - I'm an old timer with the Win32 API and MFC development environments. Have been writing code for sale in the windows environments for many years. Now thinking about the .NET C# environment and have a concern. So far as I can tell code developed within the .NET environment can ONLY be executed within a .NET environment, i.e., everyone you sell to must have installed a .NET environment. Is this in fact true?
|
|
|
|