|
Is there any way to insert a NULL value into database using CAccessor class, or a way to verify if the value fetched from the database is NULL? It seems to be value 0 in both cases, which is not the same as NULL. I'm using Microsoft SQLServer. Thanks.
|
|
|
|
|
I can disable the menu item on the popup menu,but I can't make it grayed.
My program is written on MFC.
void CTesttabctrl2Dlg::OnUpdatePause(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if( m_bPause )
pCmdUI->Enable(FALSE);
else
{
pCmdUI->Enable(TRUE);
}
}
|
|
|
|
|
use EnableMenuItem api this api has the option to gray it.
|
|
|
|
|
My program is a dialog based program.From MSDN I know that I must gray the menu item in ON_UPDATE_COMMAND_UI handle,so,I wrote the program:
void CMenuDlg::OnUpdatePause(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if( m_bPause )
pCmdUI->Enable(FALSE);
else
{
pCmdUI->Enable(TRUE);
}
}
It works in MFC SDI program,but it doesn't work in MFC Dialog based program.
It can disable the menu item,but it cann't gray the menu item.
|
|
|
|
|
Why dont you do it while loading the popup menu?
(Some code is everytime helpful to understand the problem)
Try this @ home. (B&B)
|
|
|
|
|
Hi,
Anybody help me to retrieve the system users access permission (Administrator rights/ Normal User/ ...) in different OS (WinXP/ Win98/ Win2000) for my application.
I Need it very urgently...
|
|
|
|
|
Hey, what's the rush?
There are no rights in Win9x or WinME.
There are rights, or privileges. You can determine these programmatically using GetTokenInformation. See PSS ID 119669 on MSDN for more details.
If you're talking about working out whether the user is an administrator, then that's PSS ID 118626 on MSDN.
If you're talking about file permissions, that's NTFS only, so the first thing is to determine the volume type. If it's NTFS, then you need to get to grips with ACLs, SIDs and the like (but it's not as difficult as it first seems...)
Steve S
|
|
|
|
|
Thanks ![Rose | [Rose]](https://www.codeproject.com/script/Forums/Images/rose.gif)
|
|
|
|
|
Thanks Steve,
I need to check on NTFS format, whether the given path is accessible by the current login user or not.
|
|
|
|
|
I want to run my application when someone clicks on the reply button in OutLook. Can I write a add-in to do this?
Thanks
Ralph Krausse
www.consiliumsoft.com
CSFastRunII, a new kind of application launcher integrated in the taskbar!
ScreenShot - http://www.consiliumsoft.com/ScreenShot.jpg
|
|
|
|
|
It is excited to see so many powerful windows control here. However, I am really quite new to MFC, so I am quite confused when entering the area of Doc/View structure. Say, how can I use the enhanced control in doc/view program, e.x How can I use the extended Tree control as base class for the TreeView instead using the one along with the MFC framework.
Thanks in advance.
|
|
|
|
|
Why do you want to do that, TreeView is employs all the functionlality that tree control provides, If you do the samething you will comeup with ur treeview and will be doing the same thing.
So save ur time. If you are using MFC then make full use of it.
regards,
Prakash.
|
|
|
|
|
Hi all,
I want to migrate a windows application from one machine to another with its state intact.
I was thinking of doing this by saving the process address space (code, stack, heap etc) into a file taking it to the other machine and copying it onto the space of an identical application just started on machine 2.
Ofcourse I am assuming that the application does not have external dependencies like open network connections and file I/O happening. e.g word/notepad.
I am familiar with how to get the process table in Linux but need help badly for working with windows. How do you get the addresses of the process image? Any references... help would be greatly appreciated.
Regards,
Zahid
|
|
|
|
|
I was wondering if there was a way that I could find out when data was being sent and received by dial-up networking (RAS). I would like to write my own connection monitoring program but I am not able to find a RAS tutorial that will tell me how to do this. Please advise.
Mr. Man
|
|
|
|
|
Hi all!
I have to make a CORBA interface for my Visual C++ application but when I try to compile the .idl file I get errors with CString type. How could I solve it?
Thank you in advance!
|
|
|
|
|
You cant have CString in idl file.
|
|
|
|
|
COM doesn't support CString
try using BSTR its meant for COM
Read the following article
http://www.codeproject.com/string/bstrsproject1.asp
Regards
Suneet Chandok
|
|
|
|
|
Hy!
I need help!
Can you do for me please the most simple aplications that uses *ini files for a MFC application with multi-language suport?
Please, I really need this!
HHHHHHeeeeeeeeellllllllppppppp!
Thanks!
|
|
|
|
|
writing INI files has been already posted on CP, but if you want it for different language...use ATL and UNI-CODE to re-write the one.
cheers
Balkrishna Talele
|
|
|
|
|
[code]
#include<iostream.h>
#include<math.h>
#include<iomanip.h>
class Watch
{
public:
Watch(int hour,int minute,int second);
Watch();
float get_min();
float get_hour();
float get_seconds();
void get_m_time();
void get_regular_time();
private:
int hrs;
int sec;
int min;
};
void Difference(Watch Watch_start, Watch Watch_end);
void main ()
{
Watch Watch_start, Watch_end;
int start_hour;
int start_minute;
int start_second;
char answer;
int end_hour;
int end_minute;
int end_second;
cout << "Welcome to my program\n";
cout << "This program will tell you the difference in times you enter\n";
cout << "It will also convert the time of day, to military time\n";
do
{
cout << "please enter the time of day you started\n";
cout << "please enter the hours first.\n";
cin >> start_hour;
cout << "now enter the minute you started.\n";
cin >> start_minute;
cout << "now please enter the seconds you started.\n";
cin >> start_second;
Watch_start = Watch(start_hour, start_minute, start_second);
Watch_start.get_regular_time();
Watch_start.get_m_time();
cout << "now please enter the time you ended\n";
cout << "again, please enter the hour first\n";
cin >> end_hour;
cout << "now enter the minute you ended\n";
cin >> end_minute;
cout << "now enter the second you ended\n";
cin >> end_second;
Watch_end = Watch(end_hour, end_minute, end_second);
Watch_end.get_regular_time();
Watch_end.get_m_time();
cout << "------------------------------------------------------------\n";
Difference(Watch_start, Watch_end);
cout << "Do you wish to enter another value?\n";
cin >> answer;
}
while ((answer == 'y') || (answer =='Y'));
};
Watch::Watch(int minute, int hour,int second)
{
hrs = hour;
min = minute;
sec = second;
};
Watch::Watch():hrs(0), min(0), sec(0)
{
};
float Watch::get_min()
{
return(min);
}
float Watch::get_hour()
{
return(hrs);
}
float Watch::get_seconds()
{
return(sec);
}
void Watch::get_m_time()
{
}
void Difference(Watch Watch_start, Watch Watch_end)
{
int diff_hour;
int diff_min;
int diff_sec;
int End_Hours = Watch_end.get_hour();
int End_Minutes = Watch_end.get_min();
int End_Seconds = Watch_end.get_seconds();
int Start_Hours;
int Start_Minutes;
int Start_Seconds;
if (Watch_end.get_hour() < Watch_start.get_hour())
{
End_Hours = Watch_end.get_hour() + 24;
diff_hour = End_Hours - Watch_start.get_hour();
}
else
{
diff_hour = Watch_end.get_hour() - Watch_start.get_hour();
}
if (Watch_end.get_min() < Watch_start.get_min())
{
End_Minutes = Watch_end.get_min() + 60;
diff_min = Watch_end.get_min() - Watch_start.get_min();
diff_hour = diff_hour - 1;
}
else
{
diff_min = Watch_end.get_min() - Watch_start.get_min();
}
if (Watch_end.get_seconds() < Watch_start.get_seconds())
{
End_Seconds = Watch_end.get_seconds() + 60;
diff_sec = Watch_end.get_seconds() - Watch_start.get_seconds();
diff_min = diff_min - 1;
}
else
{
diff_sec = Watch_end.get_seconds() - Watch_start.get_seconds();
}
cout <<setfill('0')<<setw(2)<<diff_hour <<"="" hours="" "<<endl;
="" cout="" <<setfill('0')<<setw(2)<<diff_min<<="" "="" minutes="" <<setfill('0')<<setw(2)<<diff_sec<<"="" seconds=""
}
void="" watch::get_regular_time()
{
="" float="" hour="hrs;
" if="" (hour=""> 12)
hour = hrs - 12;
}[/code]
im getting problems with the difference on minutes and seconds........it displays negative numbers.....any ideas?
|
|
|
|
|
|
Hint#1: Don't post all of your code.
Hint#2: Don't expect anyone else to do your class assignment for you.
Hint#3: You want a difference in times. If you have h,m,and s, convert the whole thing to seconds (you do know how many seconds in a minute, right?), then subtract one time from the other, and convert back to h,m and seconds.
Oh, and
Hint#4: Don't SHOUT, I have a headache...
Steve S
|
|
|
|
|
I think the easiest thing for you to do would be to just figure out how many seconds difference there is between the two times, and then convert that back to the proper time format for displaying purposes only. I'm confused about the hour variable. Is this military time that goes from 0-23, or does it go from 1-12? If this is military time, then your life is really easy. You don't even need an hour and minute variable in your Watch class anymore, just a second variable. Use the following as a model for getting your time (you really should have a function in your class which asks this
int hrs, mins, secs;
cout << "enter the hour\n";
cin >> hrs;
Sec = hrs * 3600;
cout << "enter the minute\n";
cin >> mins;
Sec += mins * 60;
cout << "enter the seconds\n"
cin >> secs;
Sec += secs;
There, now you have the time in the exact second of the day that you started. And you can do the same to get the second time...and I hope you can figure out how to find the difference between times...just subtract the seconds. Now, to display your time back in proper format:
hrs = Sec / 3600;
min = (Sec % hrs)/60;
secs = (Sec % min);
There ya go! Hope you get an A.
|
|
|
|
|
I am trying to write a simple Windows program that monitors and logs the memory usage of programs or tasks in Windows. Basically, I want the information that the Task Manager gets so that I can watch for changes, memory leaks, etc... I am experienced in C++ but have yet to write a Windows application. Any help or information regarding how I might go about this project would be greatly appreciated.
John
|
|
|
|
|
i exactly dont remember the title of the book...but its of MS Press by Jeff Prosise for developing Systems internals...Its CD contains..alots of sample code like...Erro look up, SPY, MFC TRACER, MEMORY DETECTOR..thread and process viewer...
If till evening i get the name of the book, PINGO I shall be gald to let u know...
regards
Balkrishna Talele
|
|
|
|