|
Sample from CP[^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
This is in an ALT/COM.And my rest of code in MFC.So it will work.And when i compile this code then i am geting error
error C2259: 'ATL::CComObject<Base>' : cannot instantiate abstract class
Plz help me
singh
|
|
|
|
|
polopo wrote: ...when any one Copy file/folde from any drive(System Drive) and past into USB Drive.
Are you wanting to know when a file or folder is pasted to a USB drive?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Friends,
In my application, i like to have UI control which can display time in 24hour or AM/PM format.
I used CDateTimeCtrl of MFC, but is is able to diplay only in AM/PM format.
Does one have ANY IDEA???
Thanks,
Prasanth
|
|
|
|
|
Call CDateTimeCtrl::SetFormat()[^] function. Check here[^] for the list of valid format specifiers.
In your case, for setting 24hr clock just call -
m_DateTime.SetFormat("HH:mm:ss");
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi all,
In one of my application I want to decide a string is in RTF format or Plain Text format. How can I solve it using C++
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
|
Thanks for the reply.
I go through the doc you send. But there is no direct way, I mean any windows API or something. Do you know such a way, something like IsTextUnicode used to identify UNICODE and ASCII?
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I don't know of something like IsTextRTF(). But you can make one yourself. For instance, the specifications say that the RTF should have a Header ^, without which, the text won't be RTF.
You can search for articles on an RTF reader application and know how the header is parsed.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
i am using CDaoDatabase to connect to ms-access database and trying to insert records in some table.
it works fine when used through a gui thread (main thread) any number of times, but the application crashes when i try to insert a record via a worker thread after i have inserted in main thread, although all the insert queries are same and work at different times.
code snippet:
CDaoDatabase daodb;
daodb.open("D:\\test.mdb");
if(daodb.IsOpen())
{
daodb.Execute(strQuery);
daodb.close();
}
when i try to debug it gives access violation when it tries to open the database.
thanks
|
|
|
|
|
Hi,
To my knowledge, none of the MFC DAO classes are thread safe. You are not supposed to access DAO objects from threads other than the main GUI thread. You have to use "SendMessage" to the main APP window from the worker threads to access DAO objects in the main GUI thread.
The best alternative I would suggest is ADO which is thread-safe.
But you can try the following approaches.
1. Instead of using a worker thread, create a user interface thread by deriving a class from CWinThread and call AfxDaoInit() function from the override InitInstance method before you start using DAO objects.
or
2. Try the worker thread itself. Call AfxDaoInit() method before you start using DAO objects.
cheers
Varghese Paul
|
|
|
|
|
Hi,
I am again asking the same question because yesterday I was unable to login. Questio is:
I am filling some cluster of Harddisk with some data, It is running fine with all other operating system except Windows Vista.
WriteFile() function is getting fail in Vista.
I am getting errro "5-Access Denied".
Can anybody help me?
|
|
|
|
|
I read many similar problems on vista on CP and most of these file related problems had following answer.
"You require Administrator access".
Regards,
Sandip.
|
|
|
|
|
|
Vista is a whole new world when it comes to access rights. Back in XP and older OS you almost always could write anywhere... But, under Vista you are much more restricted!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Whole new world? Hardly.
These are the same rules that started with Windows 2000.
Old world rules enforced
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i want to add country validation in my dialog EDITBOX
|
|
|
|
|
Go for it.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
yeap yeapp yeaaapp go for it!!!!!!!!!!!!!!!!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
We can't allow this to happen!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i may have written my question improperly . Actually i have created a CDialog (Using resources)which contains user registration form in which i have to validate name, zip, country etc ... when i click the sumbit button.
i am not able to write validate for country.
|
|
|
|
|
samrw wrote: i am not able to write validate for country
What defines a valid country?
Do you check the user's entry against a list?
If so, you could provide the list in a combo box so
the user can't input an unknown value.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
the user registration form which i am making only contains CEdit(Edit control) from resources . so i can't use combobox.
|
|
|
|
|
Okay...but I thought validation was the problem?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I wanna convert the CString data to the _bstr_t,I need some advice.
|
|
|
|