|
ok now please tell me what is unique?
|
|
|
|
|
From something I read recently, I've come to believe that one may query the motherboard's serial number using WPF.
|
|
|
|
|
i m trying to finding motherboard number by WMI using Win32_BaseBoard but its return "To be filled by O.E.M" for SerialNumber.
|
|
|
|
|
Don't you just hate that..
Albert made some useful suggestions earlier - regarding collecting information about a number of different pieces of hardware. The more items you check, the less it matters if any of the methods fail to provide unique information.....
|
|
|
|
|
Means different machines with the same hardware can give you the same exact result.
|
|
|
|
|
Hello,
I am C++/VC++ developer. Many times for debugging we need to attach running project to our code. My project is huge. There are whole lot of processes are running. Suppose I have a code and I wanted to attach with process. I don't know name of process I wanted to attach with. Is there any way by which I can identify name of the process from my code (or IDE).
I highly appropriate, any help regarding this concern.
Thanks and Regards
Happy Programming.
|
|
|
|
|
|
Here [^]is the link on how to get list of all process.
|
|
|
|
|
If you mean to attach a debugger to the running executable of your code, then, usually, your debugger will have a means to do that. E. g. in Visual Studio you select the menu Debug-->Processes to get a list of processes that are currently running, and then choose one of that list to attach to.
If your code is part of a specific program, the name of that program defines the name of the process. If this program spawns multiple threads, you will still need to attach to that program - it will cause the debugger to attach to all threads spawned by this process.
If you mean to attach the running program of your code to attach to ... something else (to what?) then you need a programatical solution as pointed out in the other responses.
Pranit Kothari wrote: I highly appropriate
I think you mean 'appreciate'
|
|
|
|
|
Hello,
int _tmain(int argc, _TCHAR* argv[])
{
char *ptr = new char[100];
cout<<"Enter value";
cin>>ptr;
cout<<ptr;
return 0;
}
Above code will work fine.
In statement char * ptr = new char[100]; I have assinged 100 bytes of memory to ptr.
But I am some weired requirement. I don't want to assign any memory like 100 bytes still I want to get variable character. First question is, is it possible? If yes please suggest way. I will use char * only, no stl::string no CString.
Thanks and Regards
|
|
|
|
|
If you mean the length based on the number of characters typed by the user, that is not possible as you can never know how many will be typed. You can only do it this way by setting some reasonable maximum.
The best things in life are not things.
|
|
|
|
|
You could try reading the user input character by character e.g. by using getch or somesuch, dinamically reallocating your string as it goes, but you would need to handle special characters yourself, like when the user hits backspace or enter. Implementing this can be a pain in the assembly.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Pranit Kothari wrote: I will use char * only, no stl::string...
Then why are you using C++?
"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
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
yes, it's possible, you will need to create a wrapper class around the char* .
The class will have the responsibility to allocated and re-allocate the char* buffer.
It can be as simple or as complicated as you want it to be.
Watched code never compiles.
|
|
|
|
|
this sounds like making a string class... why not use what's there already at this point?
|
|
|
|
|
I hoped someone would get a hint!!
Watched code never compiles.
|
|
|
|
|
in that case........
|
|
|
|
|
I agree that this requirement is weird, specificallly as you are using cin and cout, which are also part of the STL, and internally do use dynamic container classes! Not to mention that for the purpose of writing and reading simple char arrays, cin and cout are hopelessly inefficient, you'd be better served with puts() and _getch() .
Since you don't know the length of the input in advance, the only way to ensure you have a sufficiently large buffer is using a container that dynamically resizes itself. If you don't want to use std::string, or other string classes like CString, then I suppose using std::vector is out of the question as well? If that is so, you have to implement a dynamical container yourself. I don't see why anyone would want you to waste time on that though, unless it is for homework.
Anyway, what you need to do is
1. use or implement your own dynamical container, such as std::vector
2. make a loop to read the input, using _getch() to read individual characters
3. for each character, check whether it belongs to the input, or indocates the end of input; if input, store it in your dynamical container.
Also, at the end of the program, don't forget to release the memory that you allocated for your dynamical container. std::vector or std::string will do that for you, but if you have your own class, you need to take care of it yourself.
|
|
|
|
|
Hi!
I need to get hash key for a string using MD5 algorithm. How to do this in C++? Where to start?
|
|
|
|
|
Start here[^], just like you always should.
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
If you're implementing your own there's examples all over the net.
If you just want hashes on the Windows platform there's built in Cryptography services: Cryptography[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi All,
How to get the file version information of an MFC excutable.
select properties of an Exe file.
Select File Version tab of exe properties tab
Select File Version Ex.1.0.0.1
I want to get this file version (1.0.0.1) information
how to do this?
|
|
|
|
|
Use GetFileVersionInfo() .
|
|
|
|
|
Hi All,
I want to know the path of an MFC excutable.
Whenever an MFC app is executed, I want to know the path of that executable from where it is executing?
|
|
|
|
|
TCHAR Buffer[MAX_PATH];
DWORD dwRet;
dwRet = GetModuleFileName(NULL, Buffer, MAX_PATH);
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|