|
Hi to all,
I need sources for programming external devices, actually I have to make a program to control electronic circuit boards... I collect some info from the net and I think it is easier to reach circuit boards with serial ports. Finally I guess there are some resources out there and if someone post these, I really will be gratefull to him/her...
Thanx in advance.
Not: I need these resources for our project (to add real physics to our robot project in school)...
|
|
|
|
|
There are a few Serial Communications classes around here (in codeproject) that help you have access to a serial port. You could search for them (I would give you the links but I don't remember where they are. I also need to go to bed, I am very tired). But, being an electrical engineer myself I have always programmed devices by dumping the binary the code into eeproms (assembly code), so serial communications were not always required. (I don't know your project specifications so I better stop here).
Good luck with your project!
Here are three links by the way (since you are a fellow engineer) :
http://www.codeproject.com/useritems/chaiyasit_t.asp?target=serial%7Ccommunication
http://www.codeproject.com/system/cserialcom.asp?target=serial%7Ccommunication
http://www.codeproject.com/system/serial_com.asp?target=serial%7Ccommunication
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Read the manual of the device carefully. Maybe there is a API for the device. Also ensure that the device is installed properly and the OS is supported.
To tell a long story short: RTFM
PS: I have done this over and over with modems
Try this @ home. (B&B)
|
|
|
|
|
You know what? KarstenK is right.
But at the same time, to save you the trouble of learning windows programming (if you don't know any) and in case the device is designed by you or it doesn't have an API interface, just use plain MS-DOS and functions such as outp() to send data through a serial port.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
I am using VC6 - MFC
I designed a dialogbox in DialogEditor ...... and
I want this dialogbox will be my MDI child window of main MDI window!
So I mean, I want design interface (put controls to window: edit, button...) for all my MDI child window in Dialog Editor
, not by code (design by coding is slower than design by DialogEditor)
thank you!
|
|
|
|
|
When you are create an application using AppWizard, choose MFC AppWizard.
On page 1 of 6, choose "Multiple Documents" / MDI.
On page 6 of 6, choose CFormView as the base CView class.
Choose other options sensibly.
This will give you an MDI Formview application. Now just change the dialog
the form uses to match the one you've already made elsewhere.
Tada!
Iain.
|
|
|
|
|
I want to evaluate each option's value in a dropdown listbox,but I don't know how to use the function get_options of IHTMLSelectElement.
I try this:
IHTMLElementCollection *lpCol=NULL;
IHTMLSelectElement *lpList=NULL;
IDispatch *lpDisp = NULL;
//init lpList
lpList->get_options((IDispatch **)&lpCol); //this doesn't work!!!!!!!
and
lpList->get_options(&lpDisp);
lpDisp->QueryInterface(IID_IHTMLElementCollection,(void**)&lpCol); //doesn't work either.
please help me!!
Thanks in advance!
Alan Shen.
|
|
|
|
|
Hi,
My application has many dialog box, and I use the following code to go from one to another..
CcamsetfinDlg dlg8;
CcsettDlg dlg2;
CsettDlg dlg3;
Ctstdlg dlg4;
CtmpsetDlg dlg5;
CtmrsetDlg dlg6;
CSimpletonDlg dlg;
//m_pMainWnd = &dlg; //I removed the line or else the dialog vanishes immediately
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{m_pMainWnd = &dlg4;
dlg4.DoModal();
}
else if (nResponse == IDCANCEL)
{
INT_PTR pRet = -1;
pRet= dlg3.DoModal();
if(pRet==5)
{
m_pMainWnd = &dlg8;
pRet=dlg8.DoModal();
}
if(pRet==0)
{
m_pMainWnd= &dlg4;//
dlg4.DoModal();
}
The problem is the dialog box pointed by &dlg4 in the above if loop pops up and vanishes immediately.I had this problem with the first dialog box, but got over it as I got a suggestion that I should remove the line m_pMainWnd = &dlg; which I have quoted as a comment statement. Please help me in this regard.
Thanks.
Deepak Samuel
|
|
|
|
|
Hi,
from which type is your application? (e.g. dialog-based)
Why do you set the m_pMainWnd variable to current dialog? Because if your application dialog based and the m_pMainWnd = current dialog and the dialog close, then the application get a "signal" that the mainwindow is closed and the application terminates itself.
Regards Frank
|
|
|
|
|
Right. While not exactly the same, I bet it is closely related to MSDN article Q138681.
|
|
|
|
|
There is an article about "Dialog Tips & Trics" on CP.
read it!
I guess its because m_pMainWnd
|
|
|
|
|
How can enumerate LPT ports on machine?
If possible, with sample code please.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
i don't know anything about coding with LPT ports...
but try this:
char buffer[32];<br />
unsigned int i;<br />
HANDLE hPort;<br />
<br />
for( i = 1; i < 10; i++ )<br />
{<br />
sprintf( buffer, "LPT%i", i );<br />
hPort = CreateFile( buffer, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL )<br />
<br />
if( hPort == INVALID_HANDLE_VALUE )<br />
break;
<br />
CloseHandle( hPort );<br />
}<br />
Don't try it, just do it!
|
|
|
|
|
Your question intrigued me, as not long ago there were a series of articles / questions on
how impossible it was to enumerate serial ports...
I've done a little digging, and there are two functions that should interest you:
EnumPorts and EnumPrinters.
Here is some sample code for each:
DWORD dwNeed = 0;
DWORD dwPorts = 0;
BOOL b = EnumPorts (NULL, 2, NULL, dwNeed, &dwNeed, &dwPorts);
if (!b && GetLastError () == ERROR_INSUFFICIENT_BUFFER)
{
BYTE *buf = new BYTE [dwNeed];
memset (buf, 0, dwNeed);
PORT_INFO_2 *p = (PORT_INFO_2 *)buf;
b = EnumPorts (NULL, 2, buf, dwNeed, &dwNeed, &dwPorts);
delete [] buf;
}
dwNeed = dwPorts = 0;
b = EnumPrinters (PRINTER_ENUM_LOCAL, NULL, 1, NULL, dwNeed, &dwNeed, &dwPorts);
if (!b && GetLastError () == ERROR_INSUFFICIENT_BUFFER)
{
BYTE *buf = new BYTE [dwNeed];
memset (buf, 0, dwNeed);
PRINTER_INFO_1 *p = (PRINTER_INFO_1 *)buf;
b = EnumPrinters (PRINTER_ENUM_LOCAL, NULL, 1, buf, dwNeed, &dwNeed, &dwPorts);
delete [] buf;
}
You may also want to look at EnumMonitors, and the results different report levels give.
Iain.
|
|
|
|
|
Thank you. That's all I need
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hello, everyone!
If I want to ask question about C/C++ under Linux environment. Can you introduce some forums?
regards,
George
|
|
|
|
|
this is a windows site
Don't try it, just do it!
|
|
|
|
|
Hi, Alexander buddy!
Linux is our future. Can you answer my question in a direct way?
Thanks in advance,
George
|
|
|
|
|
What do you want to know? What is Linux-specific about it? If it's about a library, ask on that libraries mailing list; if it's not Linux specific, ask here.
|
|
|
|
|
Thanks, roel_ buddy!
I want to ask IPC, PThread, memory management and device driver questions under Linux environment.
Do you know some forums?
regards,
George
|
|
|
|
|
Have you checked out any of the linux.dev.* newsgroups?
|
|
|
|
|
A very nice idea!
But are there some web based?
George
|
|
|
|
|
You can access them from Google.
|
|
|
|
|
Thanks, DavidCrow buddy!
George
|
|
|
|
|
You could start with http://leapster.org/linoleum/ (I admit, it's the second link when you type 'linux programming' in Google). Find some mailing lists to subscribe to, most development and support is on mailing lists and not on web-based boards in the Linux world (suggestion: get yourself a threading mail reader, like Mozilla Mail or even better, Mutt, it will greatly enhance your mailing list reading)
|
|
|
|