|
hi
If u are using MFC...you can do the following
Cin:
1)Put some controls in dialogbox like textbox etc.
2)Bind variables to that controls
3)When somebody types into that text control ,you can get the values into the variables using unctions like UpdateWindow etc
Cout:
1)You can put a static control on dialog and display message(use SetWindowText API)
2)Use a Simple MessageBox
3)Draw Text on the dialog (not needed here)
some links:
http://www.flounder.com/getdlgitem.htm[^]
http://msdn.microsoft.com/en-us/library/86kdbbs8.aspx[^]
Hope that helps
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Use SetWindowText() and GetWindowText() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
hi
i would like to know if whether the size of datatype C++ is dependant on which of the following ( or on all of them ) ?
1)Operating System
2)Hardware Architecture
3)Compiler
Eg:Does size of int on 64 bit Hardware with 32/64 bit windows varies?
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
size of int is depend on Compiler.
Compiler is depend on Operating System.
Operating System is depend on Hardware Architecture.
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
According to the C spec, int is a convenient size for that system.
char , short and long are always the same size. Not so sure about float and double ...
As for structures, they can also vary, due to structure padding .
That should give you enough google material / questions to ask your teacher.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
QuickDeveloper wrote: size of datatype C++ is dependant on which of the following ( or on all of them ) ?
1)Operating System
2)Hardware Architecture
3)Compiler
The data-type size is primarily specified by the compiler. The size used by the compiler will be chosen to make implementation of the data-type easy. So, on a 16-bit processor, ints are likely to be 16-bit, while on a 32-bit compiler, they're likely to be 32-bit.
When you get to 64-bit hardware, you have more choices. 32- or 64-bit ints are natively supported, but you'll probably find they choose 32-bit integers because a) that is in general big enough for most applications, and b) 32-bit ints are half the size of 64-bit ints - moving all ints to 64-bit would probably cause space and speed (because you have to read twice as much memory for ints) issues. You still, of course have access to 64-bit ints through __int64 and long long.
QuickDeveloper wrote: Eg:Does size of int on 64 bit Hardware with 32/64 bit windows varies?
I don't believe so. IIRC, the 64-bit Windows API uses 32-bit integer values and 64-bit pointer values, compared to 32-bit Windows, which uses 32-bit integers and 32-bit pointers.
[bit later]
I've just checked (by compiling with the x86->amd64 cross-compiling version of VC++ and looking at the generated assembler) and VC++ does indeed use 32-bit integers for x86 AND x64.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello All ,
I want to get information of machine which are connected in lan like there ip address ,mac . in vc++. How should i go
|
|
|
|
|
There's a lot of "depends" here.
Are you in a workgroup? domain? Active directory? You could loop through all ip addresses in your subnet, ping them to see if they exist... But I doubt you could get their mac addresses.
What about firewalls?
There's a reason it can take explorer a long time to fill in the network neighbourhood list.
You've chosen a difficult problem. I'm struggling to think of a requirement for other machines MAC addresses that's not (a) naughty (b) best written on sevre software by someone who knows more about this than I do (which isn't toooo hard)
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Thanks for your reply.
I have my machine in lan .I just wan to know by programatically how many pc are connected now to lan .if it show me ip it is more for me.
and if you kno ip you can find out mac.
|
|
|
|
|
Have you tried NetServerEnum() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Yes Sir I also tried it NetServerEnum() but it is not listing ip of windows or linux machine in lan .
|
|
|
|
|
ashish8patil wrote: ...but it is not listing ip...
It's not supposed to. Use gethostbyname() for that.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hello Sir ,
Thank You Sir it is working. But can i find linux machine in network.
|
|
|
|
|
Are you asking how to know if a machine is Linux based on its name or IP address?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
If both are but consider then fine .
But my question was let :- I am my network 8 machine 3 are are windows and 5 are Linux as i make code by using api you given i am able to fine windows machine only not linux .now i want linux also .
Thanks for your Replay and solution.
|
|
|
|
|
ashish8patil wrote: ...my network 8 machine 3 are are windows and 5 are Linux...
Can you see those 5 Linux machines using Windows Explorer (Network Neighborhood)?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
|
Hi,
im trying to create a key along with value under registry as follows....
LPCTSTR data=_T("HKEY_CURRENT_USER\\Software\\Siemens\\Tester\\Test");
CRegKey::SetKeyValue(data,_T("sample"),_T("SampleTest"));
The above gives error like....
error C2352: 'ATL::CRegKey::SetKeyValue' : illegal call of non-static member function...
pls help me out...
|
|
|
|
|
Of course your code is like this
CRegKey p;
p.SetKeyValue(data,_T("sample"),_T("SampleTest"));?right
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I suppose he has to open the key before writing to it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Well, the message is clear: you need an object, instance of the CRegKey class, and call its SetKeyValue method.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for ur reply...
Ya tried what u have suggested the issue i need to create Tester\\Test key under HKEY_CURRENT_USER\\Software\\Siemens and SampleTest(key value) under Test key...and when i tried the above function im getting Abort Message Box...i think this function creates value only under existing keys....
Please correct me if im wrong...
|
|
|
|
|
CRegKey 's Create method looks promising...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hai!
When we develop an application in visual C++, we can verify the code by debugging, by keeping break points etc..
Now i am developing an application in embedded VC++ for a WIN CE 5.0 OS Pocket PC Device. My application uses WINSCARD library for supporting PCSC functions, why i mentioned above library is that now i cannot use Pocket PC 2003 emulator. In order to check my application i am always building the .exe , taking the .exe to the pockect PC device and running it, Now even if there is a logical mistake it takes huge time to find it .
Because i am not able to debug my code.
So is there any way so that i can debug the code in my XP operating system itself, keep break points, check the code flow etc. what i need is the application must run on the WINCE device connected to my system, but it must virtually run in my XP system ( NOTE: I cannot use emulator)
Thanks!
|
|
|
|
|
Yes it is possible: you need to have your PocketPC connected to your desktop. Then when you can simply press F5. The debugger will try to connect your PocketPC and copy the file on the PocketPC.
The big problem is that it is extremly slow, that's the reason why it is always easier to debug through the emulator.
|
|
|
|