|
Rage wrote:
somehow my French2English() thread got interrupted by a corrupted CEvent from my TalkFrench() function ... seems that intern synchronisation needs to be refined
Or maybe I need some vacation ...
Either you're a robot, or you need some serious vacation.
Or maybe both, I guess
Ryan "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"
|
|
|
|
|
My other name is C3PO.
~RaGE();
|
|
|
|
|
Rage wrote:
My other name is C3PO.
Now it all makes sense
Ryan "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"
|
|
|
|
|
I think you don't understand really the printf function. The sqrt is NOT a function, this is just text. So, when you see the first '%' that means that the second argument of the sprintf function (wich has a variable number of arguments) will be formated in a certain way, here: as a float!
Everything else that is not recognized as a formating string will be sent as TEXT characters to the output. You then have a second '%' wich take the third parameter (result) and format it as a float and send it as TEXT to the output. So, to answer your question: the square root is then taken from the argument list of the printf function!
Example:
if you enter 9 in your program, x will be 9. Then, in result you will have 3. Then your printf function can be "shown" as:
printf("sqrt(%lf) = %lf\n\",9,3); (I replaced x and result with their respective values.
So, this function will print the following STRING: sqrt(9.00000) = 3.00000
with 2 newlines (\n that are not formating string).
You can replace "sqrt" in the printf function by anything you want, it will work but print the other string instead of "sqrt"
|
|
|
|
|
Incredible how these three lines of code are not easy to explain Fortunately your two answers are far more consistant than mine, so I think it is clear now ...
~RaGE();
|
|
|
|
|
I remember the first time I tried to understand this function! That was horrible: the documentation is not really clear
|
|
|
|
|
Conventionally, %f would be a float value, while %lf (letter L not digit 1) would be a double value, so strictly speaking it would. I think auto-promotion is happening here, but wouldn't put any of my money on it.
Steve S
[This signature space available for rent]
|
|
|
|
|
Thanks everybody, I felt like a cow looking at a new gate when I saw this stuff...it's starting to make much more sense.
|
|
|
|
|
How can I open a URL with the POST command. I will Post some data from my application to my website.
|
|
|
|
|
While it wouldn't actually open an instance of explore, you could use the WinInet functions to
do the job.
e.g.
HttpSendRequest,
HttpOpenRequest,
etc.
This also has the advantage of being transparent to the user, so any visual feedback is as you
design.
Iain.
|
|
|
|
|
How to disable restore down button.
I need only maximizebox button in my application,the window shouldnot restore to its original state.
|
|
|
|
|
If you handle the WM_SYSCOMMAND / OnSysCommand message, and check the command type parameter for
SC_RESTORE, you can remove the standard behaviour. This will kill the restore function, but not
remove the button / system menu option.
You may want to change the initial window style to remove the button in the first place, and remove
the "restore" option from the system menu (hint: GetSystemMenu).
That would make it obvious to your users that the function has been removed. Otherwise, they may just
think your application is broken...
Iain.
|
|
|
|
|
please give me the example.
|
|
|
|
|
People come here to help & hint, not to do *all* the work!
Have you made a handler for WM_SYSCOMMAND? You can go into classwizard, and and the handler to
CMainFrame there.
Then, check the handler is called, by putting a breakpoint in it. Or making it pop up a MessageBox.
When you are confident it is called, start checking nID (one of its parameters) for when it =SC_RESTORE.
If so, don't can the base method, but return 0.
void CMainFrame::OnSysCommand (UINT nID, LPARAM lParam)
{
if (nID == SC_CLOSE)
return 0;
CMDIFrameWnd::OnSysCommand (nID, lParam);
}
Now try "restore" from the button on the top right, or the system menu on the top left.
To change the window style, look up:
CWnd::PreCreateWindow.
To remove menu items from the system menu, look up CMenu, CWnd::GetSystemMenu, and put them in
CMainFrame::OnCreate (....).
Good luck,
Iain.
|
|
|
|
|
I'm working on a project which is Single Document-MFC.
I'm learning database programing vith visual c++ 6.0.
I want to enter a numaric value into an EditBox.
Then this value should be stored in *.mdb table as long integer.
I chose catagory and value type as value/long from class wizard.
But I could not write any code for it.
When I enter a string,I could not have any problem.
I wrote
m_aciklamalar.GetWindowText (strAcikla);
set.m_aciklama = strAcikla;
then store Cstring into *.mdb.
please,help me !
emroz
|
|
|
|
|
Go to the properties of the Edit control, select the styles tab and check the Number check box. This should work.
The only problem: you can only enter unsigned integer. If you need floats or signed numbers, you have to override the control. If you need that, I already done this, so, if you want I can send you the source files.
|
|
|
|
|
if you send me,I'll be happy
emroz
|
|
|
|
|
Ok, no problem. Just give me your email adress !
|
|
|
|
|
emroz2003@hotmail.com
emroz
|
|
|
|
|
I' ve build some applications with VC++ .NET 2003 Enterprise Architect, and somebody told me he thought the compiler isn't really compiling, because you still need to install your .NET framework. He also thinks it's the reason of the slowness of my application.
Can somebody tell me how this all works?
PS: I've used the debug mode in my compiler and not release. the release mode gives a lot of errors!
|
|
|
|
|
BoudewijnEctor wrote:
I've used the debug mode in my compiler and not release
That's probably why it is slow.
BoudewijnEctor wrote:
the release mode gives a lot of errors!
That's the second reason why it is slow. This shows that your code needs to be corrected to get it work well.
~RaGE();
|
|
|
|
|
Thanks,
I've rebuild some parts of my program, now it works
|
|
|
|
|
Assuming you haven't enabled the /clr switch (Use Managed Extensions in the General category of your project's Properties), the compiler should be producing native code. If you're not sure, run dumpbin /clrheader exe-name from the VS.NET Command Prompt. If it's a native executable, you'll get output like:
Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file Work\Assorted Tests\RunTimeChecks\Debug\RunTimeChecks.exe
File Type: EXECUTABLE IMAGE
Summary
4000 .data
1000 .idata
3000 .rdata
13000 .text
10000 .textbss whereas if it does require the Framework, it will output something like:
Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file c:\winnt\Microsoft.NET\Framework\v1.1.4322\CasPol.exe
File Type: EXECUTABLE IMAGE
clr Header:
48 cb
2.00 runtime version
EB60 [ 6ED4] RVA [size] of MetaData Directory
9 flags
6000010 entry point token
96A4 [ 5464] RVA [size] of Resources Directory
2050 [ 80] RVA [size] of StrongNameSignature Directory
0 [ 0] RVA [size] of CodeManagerTable Directory
0 [ 0] RVA [size] of VTableFixups Directory
0 [ 0] RVA [size] of ExportAddressTableJumps Directory
Summary
2000 .reloc
2000 .rsrc
14000 .text Typically, release build optimisations can now allow a release build to perform up to around 4x faster than your debug build. Add in the fact that you have extra code in your debug build (you are using assert , aren't you?) and this can be 6 or 8 times faster.
However, if your program is really slow, compiler optimisations aren't going to cut it. You need to look at your algorithms: how you're storing and manipulating data. Perhaps you should swap a linked list for an array, or vice versa - if you're using a lot of data, and inserting into the middle of a structure frequently, maybe you should be using a linked list. Conversely, if you don't have a lot of data - perhaps a small lookup table - you should use an array and search linearly rather than use a map.
--
Mike Dimmick
|
|
|
|
|
When I try your idea, the command window gives the next error:
The expression cannot be evaluated while in design mode.
What can I do about this?
Thank you in advance
|
|
|
|
|
Sorry this was unclear.
I meant, select 'Visual Studio .NET 2003 Command Prompt' from the start menu - it's normally found in Microsoft Visual Studio .NET 2003 > Visual Studio .NET Tools. This is simply a standard command prompt window which runs the vsvars32.bat file, which sets up your path variable to point to the NET Framework and Platform SDK tools.
The reason I suggested this is that VS 6.0's tools, if installed, are normally in your path, but 7.x's aren't. The /CLRHEADER switch is only in VS.NET's version of dumpbin.exe .
--
Mike Dimmick
|
|
|
|