|
Well, if you want Physical Numbers and you do not want to go into device driver writing, the best option is to go to WMI. WMI provides such classes which can provide you these things. Look at Win32_Processor and Win32_DiskDrive in MSDN. This will help you.
Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth!
-Fyodor Dostoevsky, The Brothers Karamazov
|
|
|
|
|
|
|
1)How do u access functions that are within structures and make them return a value to not the main but to another (void) function ? ( Dunno if qn is phrase is correctly ??)
2)Below is an excerpt from a vending machine program in C++ but how do u convert to C without using ::(the scope resolution operator) ? or Is the below program unable to be converted to C...
BTW: some reasoning of the program may be wrong especially the data inside Convert_to_Denom as this part is wat me coded moiself...^^;;
Mani Thks for all who readin tis
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
struct coins{
int denomination;
void setDenom(int);
int getDenom();
};
struct machine{
struct coins ten, twenty, fifty;
};
void Convert_to_Denom(struct machine *m);
main()
{
struct machine *mac;
Convert_to_Denom(&mac);
return 0;
}
void Convert_to_Denom(struct machine *m)
{
m->fifty.setDenom(50);
m->twenty.setDenom(20);
m->ten.setDenom(10);
printf("%d",m->fifty.getDenom());
printf("%d",m->twenty.getDenom());
printf("%d",m->ten.getDenom());
}
void coins::setDenom(int D)
{
denomination = D;
}
int coins::getDenom()
{
return denomination;
}
|
|
|
|
|
1. The question is not phrased reasonably. But this is how I understand it "How can I call a function inside a structure ?" and "How can I determine the location where the return value is stored ?"
For the first, calling a function inside a structure is just like calling any other function, the difference is that you need to have an object of the structure and use the member-of operator (. or ->). An example:
struct coins
{
void Function1(void) {}
void Function2(void) {}
};<DIV>
int main(void)
{
coins objCoin;
objCoin.Function1();
objCoin.Function2();
return 0;
} In your code piece, the Convert_To_Denom function will not work, because you have not initialized the pointer 'mac' before passing it as a function parameter. What you are doing is declaring a pointer-to-struct type, but you're not assigning it i.e. it does not point anywhere. If you use this pointer as is, the program will cause a run-time error. To make the code work, you must remove the asterisk from the declaration of 'mac'. This way, you will create an object of structure 'machine', and pass the address of this object into the function, which will then use the created pointer to access the members ten, twenty and fifty of the structure.
For the second question, you can nest function calls inside each other, if the return values and parameter types match. An example:
int Function1(void) { return 1; }
void Function2( int nValue ) { printf("%d", nValue); }<DIV>
int main(void)
{
Function2( Function1() );<DIV>
return 0;
}
Does this answer your questions ? If not, rephase your question, spell check it and write it in clear, plain english. Do not use abbreviations or other things which might leave your question unclear to other readers. For example, the 'qn' does not mean anything unless you can decipher it from the sentence context. If the sentence context is unclear or mistyped, the entire idea of the sentence (and thus your question) will be ruined.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
hi there
i've made an activeX control which is capable of playing wav files. i was wondering how i could use this control so that i could actually hear the content on the web using IE or any other browser. Also the reason i've developed this control is that i need to play vox files which are automatically converted through the control. Any ideas,opnions or workarounds on how i could use this control to stream on the web or local lan? also are there any open source or free vox converters or players available?
Thanks
|
|
|
|
|
The Bass libraries at http://www.un4seen.com[^] allow you to play streaming audio. Commercial use requires a licensing fee. Speaking from personal use, I highly recommend these libs.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello.I have a small problem.
I cannot insert new Items in my Toolbox.
To insert I can, but those are then grey and
not clickable.Thus, I can not use her.
It would be nice, if someone says to me, where the problem lies.
It concerns Visual Studio.Net 2003.
I thank ahead.
|
|
|
|
|
If I am not mistaken, you want to insert items in the Toolbar (not Toolbox). The items in a toolbar will remain grayed unless you write a handler for those items. Just right-click the item in design view and click Add Handler. A Wizard will appear which will do the remaining stuff.
Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth!
-Fyodor Dostoevsky, The Brothers Karamazov
|
|
|
|
|
I need a timer.In Toolbox, in Kontexmenu ' Add new Item ' select, come a window with different new tools, ' Timer ' mark and to ' OK ' click.In Toolbox came, but grey and not clickable.
|
|
|
|
|
my application is based on touch screen and use listctrl to list all user,so i want to set list height to make user to select list item easily.how can i do it?thanks.
Happy Gemini
|
|
|
|
|
|
How do I get information from the file properties section of a file? What I want to do is use C or C++ to get the lyrics field from an audio file.
Any ideas?
-- dessa99
|
|
|
|
|
I believe that you're looking for the information on how to view the 'Summary' of a file, as displayed by Windows Explorer.
First, to achieve this, you need to know COM programming. I will describe the method in a short-handed manner. If you do not know shell programming, then this list of information will not be very helpful.
1. Get the desktop folder item
2. Navigate into the folder where the file is (IShellFolder::BindToObject)
3. Get a pointer to the file's IShellFolder interface, and query it for IShellFolder2 interface
4. Call IShellFolder2::GetDetailsOf, passing NULL in the first parameter, and an increasing column index as the second. The third parameter will return the title of the indexed column or E_FAIL if the index doesn't exist.
The MSDN says the same in a more verbose manner:
"The available information fields and their column numbers vary depending on the particular folder. To enumerate the available fields call IShellDetails::GetDetailsOf with pidl set to NULL for increasing values of iColumn. This approach provides you with the title associated with each column index. When iColumn exceeds the number of columns supported by the folder, IShellDetails::GetDetailsOf will return E_FAIL. Bear in mind that these titles are localizable, and may not be the same for all locales."
After you have the titles, and can identify the index of the title you're interested in, then you need to get the PIDL (Pointer to item identifier list) of the file. To get this, use the IShellFolder pointer you had, call IShellFolder::GetDisplayNameOf and use the display name with SHParseDisplayName to get the PIDL. Then call IShellFolder2::GetDetailsOf again with the PIDL and column index. You'll be presented with the information you were looking for.
If none of this makes sense, you should begin your journey in MSDN by searching for 'Shell Basics' and learn the concepts required to program the Shell. It's a difficult and quite a complex thing to learn, but once you master at least a part of it, your skills and options in using Windows OS is much more varied.
Hope this helps.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
How can I make so that disabled menu items are not highlighted when I put cursor on them?
|
|
|
|
|
I would suggest that you have to subclass and write your own owner drawn menu for this.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Yeah, I was thinking about it but wondered if there was a simple way to implement it. Thanks anyway.
|
|
|
|
|
Platform : vc 6.0 ,Windows 2000
1.select MFC AppWizard (EXE)
2.Select SDI
3.Next
4.Next
5.Next
6.Next
7.Base Class is : CEditView
Add three Menu item :(Left ,Center ,Right )
Now :
How can i control the text alignment with this three Menu Item?
uqtur
|
|
|
|
|
i want to know how can i make a "virtual CD" drive on the computer
if any one have a usefull experience,articles or links please send me
|
|
|
|
|
Hi!Dear,
I just want to register in the website
www.c-sharpcorner.com. but after I filled in my email address and my nickname,it never sent password to my email box.I am my email address is correct.my email address is:libingmomer@163.com,passward is "libing". I dont know where is the problem.Maybe it treat my email address as a invalid one.
Now I prefer my honoured you can register a nickname and a password on this website for me to login.
Thanks!
|
|
|
|
|
Hi,
I would like to store great numbers on a primitive type. Is unsigned long int primitive type that can hold the greatest non-negative number? Or which primitive type I can use?
Kind Regards,
-
When in doubt, push a pawn!
-
|
|
|
|
|
Take a look at hyper it holds either a signed or unsigned 64bit number. i.e. unsigned hyper int - will give you a 64bit unsigned integer
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi Mr. Kancidrowski,
I used hyper but compiler(Visual C++ 2005 Express Beta) gave me compiler error.
Regards,
-
When in doubt, push a pawn!
-
|
|
|
|
|
2005! Wow, you are keen! I am still running either V6.0 or 2003.
What was the error message?
BTW, call me Ant. It needn't be formal!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
unsigned long ul = -1;
so
ul == 0xFFFFFFFF
TOXCCT >>> GEII power
|
|
|
|
|