|
hello guys...I have made a liberary module in VC 6. How can I use it in Visual C 2008?? thnx
|
|
|
|
|
you will probably need to re-build it in VS08
|
|
|
|
|
Hey folks, i was just wondering, what do you think which of these would generate a faster way -if there's a difference at all- to query a class variable:
class CMyClass
{
protected:
int m_myVar;
public:
int GetVar() const { return m_myVar; }
};
...
const int &GetVar() const { return m_myVar; }
...
,,,
inline int GetVar() const { return m_myVar; }
...
...
inline const int &GetVar() const { return m_myVar; }
...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
In your example you are returning a basic datatype (an integer), then it's quite the same to return by reference or by value: for example on a 32 bit environment, returning by reference means load the address of m_myVar inside the eax register, while returning by value means load the content of m_myVar inside that register.
The inlined versions of your methods could potentially be better, because the compiler could better optimize the usage of CPU registers and produce a code a bit more efficient.
If your methods return a class or a struct the things could be different: returning by value means that your methods should allocate a temporary object on the stack and call its copy constructor. Then returning by reference in most of cases is better.
|
|
|
|
|
Of course with more complex types it's usually better to go by reference, i was just wondering about the basic types indeed. Thank you for your answer.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Actually in the long run, return by value may be shorter, but it depends on what you are measuring. For basic data types, the actual return doesn't make much difference, but then when you go to use the returned value, if it is returned by reference, there is an extra level of indirection to resolve.
Of course what the compiler optimizes out and what else you might do with the results enters into the overall performance, so it's not a simple matter to determine a priori. However, in most cases, I doubt the difference is major.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Thanks for the info.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Hi friends,
Can somebody provide me the sample code for getting serial number of motherboard using C++ on WINDOWS?
Regards
Aseem
|
|
|
|
|
I doubt there is a common way to do that, if any at all (i might be wrong and correct me if i am, fellas), maybe check out if WMI[^] has a way, e.g. here[^] it mentions a "serial number" and "bios asset tag", that's probably not for the motherboard though...
Here[^] are examples about how to use WMI in C++.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Hi friend.
Thanks for your reply. I have changed the plan. I'll use some third party licensing.
Regards
Aseem
|
|
|
|
|
Check out the DeviceID property of the Win32_MotherboardDevice class.
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
You want WMI; see the SerialNumber property of the Win32_BaseBoard class.
Note: AFAIK it gets stored in the BIOS memory, and flashing a new BIOS is likely to erase the number.
|
|
|
|
|
Is that universal, i mean, whould that work on any system?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Code-o-mat wrote: whould that work on any system?
which part of it, getting it or getting rid of it?
and I'm afraid I don't know for all systems either way.
|
|
|
|
|
I meant the "getting it" part. I guess the "getting rid" part would work on any system that can have a big enough hammer applied on.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
as always with WMI, it depends on the manufacturers. If they decide not to bother, then it won't be there. But I think they do use it to their advantage, during manufacturing and later on, for serviceability.
|
|
|
|
|
Thought so really... so basicly there is no common way to get the info he requested, it is most likely he can get it trough WMI but there are no garantees...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Hi how to convert binary file to bmp/jpg image. I have to convert image(BMP/JPG) to binary file and binary file to image(BMP/JPG).
Please help.
Thanks in advance.
|
|
|
|
|
What do you mean exactly by binary file ? An image is already a binary file. could you please clarify your question.
|
|
|
|
|
yes image is already a binary file.
|
|
|
|
|
was that exactly your question ?
|
|
|
|
|
i have already a image binary data, how to convert back to image file.
|
|
|
|
|
That is far from clarifying your question...
What is your problem exactly ?
|
|
|
|
|
i have binary image data i have to convert back to image file.
ex : image.bmp converted to binary file image.bin.
Now i have to convert "image.bin" binary file back to image.( imgage.bin to image.bmp).
|
|
|
|
|
Just change the extension ?
|
|
|
|