|
Also in MFC you can use DDX to bind dialog class member variables to controls, then the content of controls will be set from these variables on init, and after OK, the variables will be filled with data from controls.
Creating of variables and DDX binding using Class Wizard is easy.
Pavel
Sonork 100.15206
|
|
|
|
|
I have a very accurate GPS clock. I have it connected to my computer through the serial port. Is there a way to either have the GPS clock keep updating the time on my PC clock, or when I read the PC clock, have my program read the GPS clocks time instead. Any ideas would be appreciated.
Thanks,
Shane
|
|
|
|
|
We are using GPS to synchronize control system PC with ms precision through serial port, so there is a way. I'm sorry I can't help you with details, because the development of this had cost my employer some money
Pavel
Sonork 100.15206
|
|
|
|
|
How, hard can it be? Read, the serial port, parse the string for the time, then call SetSystemTime() to set the PC's clock. You may only want to do this once per hour, or once per day, etc.
|
|
|
|
|
Hi all,
I met some error when i compile my project in VC++6.0
Is there some lib I didnot add to the project?
Thanks for your help.
Laura
*******************
error LNK2001: unresolved external symbol _IID_ITask
error LNK2001: unresolved external symbol _CLSID_CTaskScheduler
error LNK2001: unresolved external symbol _IID_ITaskScheduler
************************
|
|
|
|
|
|
Hi I got it.
It 's mstask.lib
Thanks
|
|
|
|
|
I would like to display 2 fields from a database in a tabular form.
I know how to write a query, but I want to know what control I should use to display the data.
Thanks
|
|
|
|
|
|
Hi there,
I want to move a certain hidden/readonly file (namely thumbs.db) from one folder to another in C++. However, this fails, because the "::rename(src, dst)" function does not like hidden/readonly/systems files.
Now, how can I change one file's attributes in Visual C++? In Visual Basic you have the SetAttr() procedure, but I cannot find a similar function in C++?
Regards,
Marco van der Kolk
|
|
|
|
|
In MFC using CFile::SetStatus, in WIN32 API using function SetFileAttributes
Pavel
Sonork 100.15206
|
|
|
|
|
|
Hi Marco,
Take a look here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/setfileattributes.asp
|
|
|
|
|
Trying to use SHFileOperation to copy files to/from FTP server, but without success (for a while). Anybody tryed to do such things? Guess, theoretically is possible...
|
|
|
|
|
This one should be a TAPI FAQ...
I'm using TAPI 2 in an application. I need to be able to tell the modem not to wait for a dial tone before dialing a number. I could find no such option in the TAPI API, but I found a checkbox in the modem control panel. Is there a way to disable "wait for dial tone" using a C++ program, without the user having to go through the control panel to do this?
Thanks!
--Two Magic Lovers
|
|
|
|
|
Did you try with lineSetCallParams function? because
typedef struct linedialparams_tag {
DWORD dwDialPause;
DWORD dwDialSpeed;
DWORD dwDigitDuration;
DWORD dwWaitForDialtone;
} LINEDIALPARAMS, FAR *LPLINEDIALPARAMS;
ÿVOTD: 14 "Make every effort to live in peace with all men and to be holy; without holiness no one will see the Lord.
15 See to it that no one misses the grace of God and that no bitter root grows up to cause trouble and defile many." - Heb 12:14-15
|
|
|
|
|
I need to know how to write a try catch for this. What goes iinto the catch? In the try I will be openeing and reading registry keys. If the keyOpen operations fail I dont want keyClose to be called. Is try-catch the way to organize this, or an if statement?
Thanks,
ns
|
|
|
|
|
If you're using bare Win32 API, then you'll get no exception - you'll have to check return values. If you're using one of class wrappers for registry... it depends on class. Read the class documentation to check how error handling works.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Exception handling is intended as it's name says for handling of exceptional/error conditions. Don't use it to control a normal flow of your program - it has it's cost. Throw an exception if an error occured, which you don't want or can't handle in place.
Maybe you're using a class to access registry which generates exceptions. Then you need to use try/catch, see the class doc.
If you are using API functions or a class which doesn't use exceptions, the choise is on you.
The exceptions would be appropriate, if more error conditions can occure in your code with the same handling. State of your data (close or not close) is in your hands. Simple example throwing na int for simplicity:
try
{
if(!keyOpen(...)) throw 1;
if(!keyRead(...)) throw 2;
keyClose(...);
if(!keyOpen(...)) throw 1;
if(!keyRead(...)) throw 2;
keyClose(...);
...
}
catch(int i)
{
if(i>1) keyClose(...);
MsgBox("err");
return false;
}
Pavel
Sonork 100.15206
|
|
|
|
|
Thanks very much. It resolved my problem.
|
|
|
|
|
Hi,
You must also take into account that throwing exception will call the destructors of all stack-created objects. That's why there are times when it is more efficient to return an error code rather than throw an exception.
Best regards,
Alexandru Savescu
|
|
|
|
|
I want to monitor my computer's share directory in the LAN, when some files are deleted or renamed or modified by other computer. I can recored it.
but I don't know all this being done by which computer! How can i do it ?
Thanks a lot!
How can I know which remote computer access which file of my computer?
How can I finished it with MFC or VC?
|
|
|
|
|
I want to monitor my computer's share directory in the LAN, when some files are deleted or renamed or modified by other computer. I can recored it.
but I don't know all this being done by which computer! How can i do it ?
Thanks a lot!
How can I know which remote computer access which file of my computer?
How can I finished it with MFC or VC?
|
|
|
|
|
All my buttons are passed through OnCtlColor() but I can't change the text colour or background. I could subclass the control (seen the article in CP) but I am lazy so is there a way to do it in OnCtlColor?? If not, then why doesn't it work when edit boxes, static boxes, etc.. do.
cheers!
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
From MSDN docs on WM_CTLCOLORBTN:
Buttons with the BS_PUSHBUTTON, BS_DEFPUSHBUTTON, or BS_PUSHLIKE styles do not use the returned brush. Buttons with these styles are always drawn with the default system colors. Drawing push buttons requires several different brushes-face, highlight and shadow-but the WM_CTLCOLORBTN message allows only one brush to be returned. To provide a custom appearance for push buttons, use an owner-drawn button.
In other words, "this feature is by design"
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|