|
Depending on the OS version this information is stored in various places in the registry. Fortunately they are different in almost each Windows version
You must write code for W95/98/CE/ME/NT4/W2k/XP/.NET which reads the corresponding registry keys.
A good start is
...\CurrentControlSet\Services\Tcpip\Parameters\Adapters (NT5)
...\CurrentControlSet\Services\Tcpip\Parameters (NT4)
Holy Sh*t! I'm speechless. (hey, that's a first) Marc Clifton, The Lounge
|
|
|
|
|
Hi there,
I'm about to create a custom control for an application. This control should have 4 Buttons, 2 Textfields and about 10 LED's (some kind of changing bitmaps). I'm not able to put these buttons in my custom control. The LED's are easier to impelement, but I think these Buttons are little bit tricky.
I want to put these things in a custom control, because i have to instanciate about 32 of them (maybe at runtime)
Is anybody able to help me?
Thanks a lot for helping me
greets, Ingmar
|
|
|
|
|
is your app MFC ? (Probably not, but one never knows... ).
~RaGE();
|
|
|
|
|
It is an MFC app...
|
|
|
|
|
Hi,
Create a new class derived from CWnd (your custom control). Declare your member variables (LEDs, Bitmaps, Edit controls,...). Use Create member function of member variables to create, size and justify them.
You can also use some handy utility for managing layout of child controls.
It's better that you create a dll as host of your custom control and use it in your application whenever you want.
A. Riazi
|
|
|
|
|
I have to apply a message handler for my Button (on_click) or something.
so I need a new ID which is applied to the new created Button. How can I do this
without doing it statically in the resource file?
greetings, Ingmar
|
|
|
|
|
Hello All,
I have written a driver which retreives the RTC value. I have used WRITE_UCHAR_PORT and READ_UCHAR_PORT macros. They operate on port 0x70 and 0x71 respectively to get the RTC value. They are run in a loop of 12. I get the value properly if run once. But when the values are retreived continously , over a time it gives all the values as ff. i.e. the date and time value which are retreved are all 'F's. The driver does not give any error. I.e. the driver is correctly binded and everything seems to be properly executiong apart from the fact that the values reteived for date and time is all 'F's. Can it be the case that RTC is busy updating some registers (at the time of giving error values - all F's ) so invalid values are retreived by the driver.
The driver is able to retrieve correct values for once or twice but only during a long run it gives problem. Could there be some problem in the hardware or am I missing something.
I am running the driver in Windows XP home OS and on Intel chipsets.
Can you please suggest as to what could be the problem.
Any help would be highly appreciated.
Thanks and regards,
Sandeep
|
|
|
|
|
Sandeep Shetty wrote:
Can it be the case that RTC is busy updating some registers
Anything is possible when dealing with PC hardware.
But I'd more worry about the possible implications of you emitting e.g.
out 0x70, 2 /* minute */
then your driver is interrupted by Windows itself wanting to access the RTC (which I presume it assumes it has exclusive access of), emitting e.g.
out 0x70, 0
out 0x71, 0 /* set seconds to zero */
and voila, your driver fails. For all I know, the RTC might even have deadlocked at this point.
Coming to think of it, is even 0x70-0x73 shared? (you have successfully claimed the address range, by e.g. IoAssignResources?)
|
|
|
|
|
Hello!!
Thank you for your answer.
But I am not using statements like "out 0x70, 2". I am using the macro WRITE_UCHAR_PORT and READ_UCHAR_PORT and pass 0x70 and 0x71 as parameters.
I do not think we have to claim addresses and the macro does require on its own.
I cam across a small article at site http://www.pcprofile.com/timepiece.HTM#overview
There is some problem in chip set INtel 810. Can you please on this?
Hope I am on the right track.
Please give your suggestions.
regards,Sandeep
|
|
|
|
|
Sandeep Shetty wrote:
But I am not using statements like "out 0x70, 2".
I understand that. I just used that as syntax to keep down on the writing.
I do not think we have to claim addresses
Is think really a good word to use when dealing with stuff like this?
But it also seems you have to check whether an update is in progress before trying to read anything. Have a look at this for example.
I still don't think you are allowed to do this without either disabling interrupts (which I'm quite certain you may not on NT) or claiming the resources you access - even more so since the built-in "System CMOS/real time clock" device already have claimed this I/O range.
|
|
|
|
|
Friends, at some point of my program execution, i want the memory consumption of my program (same value that we read from task manager). Any API solution that also work for Win 98 do tell me please ?
|
|
|
|
|
Shah Shehpori wrote:
i want the memory consumption of my program (same value that we read from task manager). Any API solution that also work for Win 98 do tell me please ?
Since when did Win98 get a Task Manager?
Whatever. Try GetProcessWorkingSetSize .
|
|
|
|
|
REQUIREMENT:: Application shud be sized to full monitor irrespective of the monitor size and current system resolution.
My APPLICATION:: Application is having four formviews in tabcontrol with many controls(AcitveX Lables and Buttons) on each forma view. My application is developed for best view in 15 inch and 800*600 resolution.
MY PROBLEM: i have written code to catch when resolution ic changed.and accorind to the new resolution m changing the each contols's client rect and moving the corresponding control to new client react. but reafreshing si becoming problem and some controls are painting over other controls.
adi narayana
|
|
|
|
|
I have a dialog based application with a group of 4 radiobuttons. I want one of 4 radiobutton to be active when form loads ?
So can i do it ??;P
|
|
|
|
|
i can't undesratnd what you want...but I guess you need to place the code for radiobuttons so as to make them active...when form loads..in OnInitDialog function...if it is a dialog based application..just put the code in InitInstance() that should do the work you want..
cheers
Himanshu
|
|
|
|
|
I'll just expand what Himanshu said :
First get a control to the button you want to active. Two ways to do it :
1.Add a control with the class wizard, let's name it m_FirstButton.
In the CMyDlg::OnInitDialog()
BOOL CMyDlg::OnInitDialog()
{
...stuff...
m_FirstButton.SetCheck(TRUE);
...stuff...
}
_or_
2.Get a control to it through the Index (IDC_...), like following :
BOOL CMyDlg::OnInitDialog()
{
...stuff...
CButton *firstbutton=(CButton*)GetDlgItem(IDC_FIRSTRADIOBUTTON);
firstbutton->SetCheck(TRUE);
...stuff...
}
And as Himanshu said, you can do some calculation also in the InitInstance (like processing the command line) if this is needed to chose which of your radiobutton should be active at startup.
~RaGE();
|
|
|
|
|
GetDlgItem is giving errors
CButton *firstbutton=(CButton*)GetDlgItem(IDC_FIRSTRADIOBUTTON);firstbutton->SetCheck(TRUE);
GetDlgItem' : function does not take 1 parameters
Error executing cl.exe.
|
|
|
|
|
Use a control-variable. You can make those with the Wizard, exactly like the Member variable, but you have to set the type to 'Control'.
Now, you have all options that the respective MFC-class offers.
Especially handy as your dialog grows.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Just set your radio button member variable in dialog constructor. e.g.:
if your member variable is m_Options:
CDummyDlg::CDummyDlg()
{
m_Options = 0;
}
A. Riazi
|
|
|
|
|
Good Riazi that really worked !!!
|
|
|
|
|
Sorry, i had not thought that you could have used the value associated to your button (i prefer using controls). Riazi got me on this one.
~RaGE();
|
|
|
|
|
Hi all,
I want to delete the history, cache entries and cookies craeted by internet thru programming..Is there any good tutorial or can anyone guide me so as how to do it...Any thoughts and ideas are most welcome..
Thanks in advance..
Himanshu
|
|
|
|
|
Just call some shell function to retrieve folders of Temprory Internet Files and also History then delete all of files on it!
For more information on how to retrieve shell folders path, view my article: System Information[^].
A. Riazi
|
|
|
|
|
|
thanks buddy..this was what I was looking for....thans a lot..
cheers
Himanshu
|
|
|
|