|
I'm sorry but how is that theory goin to help someone who doesn't know what code to use? OK, I'm learning the theory behind it, but that isn't goin to help me write the code. I never said that I have a good knowledge when it comes to C/C++. Actually it is kinda bad, that is why this function is goin to be called as a native one.
Just out of curiosity, have you ever thought that maybe there are some that understand better by seeing it in practice then reading about the theory behind certain things? And surely I'm not the only one, after all there is this saying "Practice makes perfect".
|
|
|
|
|
You apparently didn't look at the rest of the page, especially the navigation down the left side, and completely missed the link to "Reference", which gives you all of the functions involved with WCS and the documentation on each.
If you're looking for someone to write the code for you, or to copy, I can't help you there. I have no need of color correction at all and don't have the time to the someone's research for them.
|
|
|
|
|
Valentinor wrote: will affect certain people by at least demoralizing them. So are you saying it is demoralizing to be given a link to the documentation?
Valentinor wrote: Not everyone is good at searching on google for the answer I just Googled for the name of the API function that is in your question; why do you think that is difficult?
Valentinor wrote: As for what you said that, in that paragraph it says not to use it, yeah it is true, but it also says the following "Use of this API is subject to major limitations", so it's not like not to use it because it is bad, but because other reasons.
As for the other part, it is actually a good thing in that situation that it doesn't uses what you give it, and it actually is telling you why in documentation, because it may lead to an unusable screen. So you have the complete answer, why complain?
|
|
|
|
|
Quote: So are you saying it is demoralizing to be given a link to the documentation?
I wasn't talking about that answer. Giving a link to documentation is a good start when you don't really know the answer, in hopes that the person who asked the question didn't checked it before.
Quote: I just Googled for the name of the API function that is in your question; why do you think that is difficult?
So with that I wasn't talking about me, it was in general, everything in that statement beside the part at the end, was something I observed over the time.
Quote: So you have the complete answer, why complain?
I didn't said the problem is solved. In the above message in responds to what Dave Kreskowiak said, I went into more details about the problem, as no one even tried to ask more question to understand the problem better, in case maybe it wasn't explained properly, which the founder of this website actually encourages to do so.
Quote: If a question is poorly phrased then either ask for clarification...
I'm glad that you actually read the whole thing, even tho there were some misunderstandings about the message it was meant to deliver.
|
|
|
|
|
(C++ and Visual Studio 2019)
We have a 3rd party library that we want to use (we build from source and it generates many, many static libs).
I want to create an abstraction layer on top of this 3rd party library, as a static library.
And I want my client application to use my own abstraction layer so it does not have to directly include the 3rd party headers.
Can I "link" the 3rd party libraries (libs) in my own library so that I can just link we one library in my client application ?
Or I will need to link my application with the 3rd party libraries as well as my own library ?
I'd rather be phishing!
|
|
|
|
|
If you create a static library that links to other statics then the result should be a single static library. A simple test should confirm it for you.
|
|
|
|
|
Crikey
I did not even look at that (bad case of mondaying)
It seems to be working.
Thanks Richard.
I'd rather be phishing!
|
|
|
|
|
Yes, it's the sort of question that gets you overthinking in your head. 
|
|
|
|
|
You can create a "composite" that includes your modules and all modules from 3rd party libraries.
About including the 3rd party header files, it depends how good of a job you do at hiding the internals from your users.
Thing to keep in mind: remove any #pragma directives that reference the previous libraries. Place only one referring to your "composite" lib in one of your main include files.
Mircea
|
|
|
|
|
|
That line won't compile.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Hello
#include <iostream>
#include <arpa/inet.h>
#include <math.h>
#include <iomanip>
using namespace std;
double asDouble ( double price_numerator, double number_of_decimal )
{
return price_numerator / pow10(number_of_decimal);
}
int main()
{
bool someBool = true;
double x = asDouble(-2147483648 , 4) ;
double y = asDouble(5456 , 4) ;
cout<< (someBool ? std::setprecision(10) : std::setprecision(6)) << x<< endl;
cout<< (someBool ? std::setprecision(10) : std::setprecision(6) )<< y<< endl;
return 0;
}
so I want the precision to be set based on condition, but the output is :
-214748
0.5456
so I want this output :
-214748.3648
0.5456
|
|
|
|
|
I made the following change, and result is as expected:
double x = asDouble(-2147483648.0, 4);
Your code is not compiled for me, the error is:
error C4146: unary minus operator applied to unsigned type, result still unsigned
So, your conditional precision is OK, the problem is that 2147483648 is more than maximal unsigned int value, and applying unary minus operator to it gives compiler error in my case, and unexpected result in your case. Probably your compiler gives some warning for this line, don't ignore it.
Output:
-214748.3648
0.5456
Tested with VC++ 2015.
modified 28-Jan-21 7:33am.
|
|
|
|
|
Hello,
In a dialog, i have added picture control from resource. in this i am displaying an image accordingly at the runtime which is working fine.
I need to zoom in / zoom out the displayed image according to mouse wheel move. I thought of adding window procedure to that picture control, so that i can handle mouse command over there. in MFC, i can see options and examples, but in win32 api, i dont know how to do that.
Can anyone suggest me how to do.
Regards,
Gopi.
|
|
|
|
|
|
Thanks,
will check on this.
|
|
|
|
|
Just derive your own class from the CStatic (picture control is a static control), create the control member variable in the dialog for this picture control, and handle any Windows message you need in this derived class.
|
|
|
|
|
Thanks.
my application is in win32 and picture control created through toolbox. how to subclass this control to CStatic (MFC) derived class?
|
|
|
|
|
- Use MFC class Wizard to derive new MFC class from CStatic (say CMyPicture);
- Change the control ID of your picture control from IDC_STATIC to something more sensible (like IDC_MYPICTURE);
- Use MFC class Wizard to create the control member variable (of the new created type CMyPicture) for your picture control.
Also see MSDH (docs.microsoft.com) for details.
|
|
|
|
|
Thank you.
Will give it a try.
|
|
|
|
|
Does someone have a code in c, for a battleship game, i have to do it on codeblock
Thank you
|
|
|
|
|
You should try doing it yourself.
It's more fun.
I'd rather be phishing!
|
|
|
|
|
Sorry, this site does not provide code to order.
|
|
|
|
|
Julien JG7 wrote: Does someone have a code in c, for a battleship game, i have to do it on codeblock So if YOU have to do it, why are you asking for SOMEONE ELSE's code?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
What is a common way to use NASM (or other assembly compilers) when developing windows applications. Do you integrate it with VisualStudio shell or you go down the path of always using the command line?
|
|
|
|