|
who can give me some tins?? plz, thx very very very much....
|
|
|
|
|
Please ,how i can get serial numbers of bios, motherboard, processor,vedio card ,hard disk , with java or c programmes under windows and linux platforms
if u have any site or url contact me .
email
ss2006@caramaiol.com
am
-- modified at 7:06 Sunday 26th February, 2006
|
|
|
|
|
Hi, I'm new to parallel port and would like to ask a few questions:
1. I want to program the parallel port (in C) using VC++, how can I access the port?
2. How can I run my program in windows?
Your help is truly appreciated!
|
|
|
|
|
Hi,
Check this port programming[^].
The _inp and _outp are privileged instructions and cannot be used in Win2000 and WinXP. Try using some library. Check this link.
InpOut32.dll[^]
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
I have used InpOut32.dll - really convenient to use, etc.
One thing to watch out for - I was doing InPorts, and got peculiar results until I realised that it returned an 8-bit value, and I wanted a 16-bit value, so I had to do 2 separate InPorts and combine the results.
|
|
|
|
|
We do not need to select palette into DC to display rich-colored bitmap for monitor if we set monitor properties as 32 bits or 16 bits.
but, do we need to select palette for Printer DC for printing rich-colored bitmap?
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
-- modified at 9:23 Sunday 26th February, 2006
|
|
|
|
|
can anyone help me find how to write a program to read input from hardware temperature sensors and display it.
- Kyle
|
|
|
|
|
See http://www.wotsit.org
|
|
|
|
|
i could not find any helpful topics for this problem on that web site. if you could point me to the one you found it would help me out.
thank you
- Kyle
|
|
|
|
|
Hi Kyle
What do you fo exactly?
In the site helpful information for hardware,...
But if it's not your answer go to
http://www.codeguru.com/
Have a nice day
|
|
|
|
|
Hi,
I am developing a console type application that accepts command from the user and executes it, if it is valid.
This is a Dialog based application. I have only a CEdit control in this dialog box.
When this application starts, the focus is in the CEdit control and the entire initial text is selected.
How do i keep the focus without selecting the whole initial text. I tried to set selection in InitDialog. But things didnt work as I expected.
Please suggest me a solution for this
Thanks
Saravanan
|
|
|
|
|
Hi
Do you test WM_SETFOCUS
|
|
|
|
|
Hi,
After
1)seting focus to the edit control in the initdialog
2) send EM_SETSEL Message to that edit control with the info of setting the text.
3) return false in the initdialog.
Regards,
FarPointer
|
|
|
|
|
I have dialog (window/form) that inherits from the CDialog class. This dialog has various controls on it including a few buttons and textboxes.
I am trying to get some keyboard events (key presses) to fire some events but its not working.
In the Header file for the dialog i have this as a protected declaration
[code]
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
[/code]
I have an ON_WM_KEYDOWN() event created and its corresponding method in the .cpp file
[code]
void COpenGLMFCDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
[/code]
Within this method i have written some test code to change the text in a textbox just to see whether the event is fired correctly, but the text is never changed. I also tried changing the dialog's name and also firing some Message Boxes ... but nothing worked.
The code in the "OnKeyDown" method is as follows:
[code]
void COpenGLMFCDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags){
switch(nChar)
{
case VK_RETURN:
SetWindowText("You pressed Enter");
break;
case VK_F1:
SetWindowText("Help is not available at the moment");
break;
case VK_DELETE:
//SetWindowText("Can't Delete This");
//AfxMessageBox("Testing");
m_Txt_Test.SetWindowText("The Event was fired");
break;
case VK_DIVIDE:
//SetWindowText("Testing");
m_Txt_Test.SetWindowText("Another Event fired");
break;
default:
SetWindowText("Whatever");
}
}
[/code]
Could someone please (pretty please) tell me why this isn't working and whether i have done all that is needed for a keyboard event to fired & a result to be seen on screen.
Thanks in advance.
|
|
|
|
|
Hello braveheartkenya ,
If you have each control's in the form then WM_KEYDOWN and UP isn't work and All Event's(WM_KEYDOWN and Up) send
to controls unless in the form non controls
|
|
|
|
|
So how do i put the focus on the Dialog itself rather than on a control. The focus is currently on a button and i would like to put it on the dialog so that the events will be sent there.
|
|
|
|
|
I think It's not possible.
I suggestion for example:
delete all controls in the from(the form is empty) I think now WM_KEYDOWN is work.
or
if you need to controls in the form you can create controls in the application
Example:
Like this for each control
//////////////in the Header file//////////////////////
#define IDC_BUTTON1 1000
....
class CMyCpp: public CDialog
{
...
...
...
DECLARE_MESSAGE_MAP()
CButton m_Button;
afx_msg void OnBnClickedButton();
};
/////////In the cpp file/////////
void CMyCpp::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_BUTTON1, m_Button);
}
BEGIN_MESSAGE_MAP(CMyCppCDialog)
ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton)
END_MESSAGE_MAP()
BOOL CMyCpp::OnInitDialog()
{
m_Button.Create("MyButton",WS_CHILD|WS_VISIBLE...,CRect(0,0,100,25),this,IDC_BUTTON1);
CDialog::OnInitDialog();
}
void CMyCpp::OnBnClickedButton()
{
}
|
|
|
|
|
Thanks for the idea ... i'll try it out
|
|
|
|
|
I know how to load and save info to files but I'm having trouble loading info from a file into multiple strings. This is the data that I am saving and it works just as I want it to.
ofstream fp;
fp.open("C:\\war\\stringdata.DAT", ios::out);
for (count = partytotal -1; count >= 0; count--)
for (count2 = 16; count2 >= 0; count2--)
{
fp << party[count][count2];
fp << "\n";
}
fp.close();
Party is defined as: CString party[4][17];
I'm not a vary good programmer , so could anyone give me an example of code that will load the data back into the strings . (nothing I tried worked)
Thank you.
"To an optimist the glass is half full.
To the pessimist the glass is half empty.
To the programmer the glass is twice as big as it needs to be."
GC13: "Mature-Ages 16 and up. 'your mature, right?'"
FARGORE: "no, but I am over 16."
|
|
|
|
|
I'm experiencing some problems with writing data to a driver of mine and I was wondering if it is caused by the following:
I open a single handle to the driver with CreateFile(). I use the handle in both ReadFile() and WriteFile() which are called in separate threads.
Now, what I'm wondering is if this approach has some multithreading issues (because both threads use the same handle) and if I should instead open two handles to the driver.
Thanks!
|
|
|
|
|
Sorry I'm probably roung here but have you tried using the /FORCE command line for the multithreading?
"To an optimist the glass is half full.
To the pessimist the glass is half empty.
To the programmer the glass is twice as big as it needs to be."
GC13: "Mature-Ages 16 and up. 'your mature, right?'"
FARGORE: "no, but I am over 16."
|
|
|
|
|
I am not quite sure what that has to do with the question, though..
|
|
|
|
|
Halloko wrote: I use the handle in both ReadFile() and WriteFile() which are called in separate threads.
A file handle only has 1 'current offset' value which is the location that the next read or write will take place at in the file. You will likely trash your file using the same handle in more than 1 thread unless you guard the handle (e.g. critical section) and always set the offset before a read/write.
Halloko wrote: I should instead open two handles to the driver.
That is one solution.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
cmk wrote: A file handle only has 1 'current offset' value which is the location that the next read or write will take place at in the file. You will likely trash your file using the same handle in more than 1 thread unless you guard the handle (e.g. critical section) and always set the offset before a read/write.
Yeah, that's what I figured.
So either a critical section of some sort or two open handles.
Thanks!
|
|
|
|
|
Halloko wrote: So either a critical section of some sort or two open handles.
Lets discuss the pros and cons of each method :-
#1: Using Syncronization Object to control reading and writing :-
Very Native Solution.. almost every big project use same.. but let consider the example.. when you am reading the particular file and request for the writing
come then writing operation have to wait till the reading operation complete and viceversa.
#2 Using Two Handle.... you have to open file in sharedenynone mode.. this will increase memory overhead.. each handle is to maintian it postion in the file.. also you have to do espeacial handlling of the updation of file..
so i believe Critical section Method is more suitable for you!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|