|
1. i would like to know about mouse control that i can command "double click" for open "my computer" on my desktop
2. i would like to know the name of even for system key such as i press on keyboard "CTRL+SHIFT+P"......... i guess that WM_SYSKEYDOWN but not appear in even when i press "CTRL+SHIFT+P"?
thank a lot....
|
|
|
|
|
Hi all,
I would like to check the attributes of a file's (e.g date, time) creation.
I am sure it is possible but I just dont know how?
I am writing an application in VC++ .NET which would search for file in a specified folder and the results will be shown in chronical order.
I can search the file but I can't show the output in chronical order .
I would really appreciate if someone can help me out.
Thanks
Dilshad
|
|
|
|
|
If you're using FindFirstFile /FindNextFile to do the searching, those APIs return the created/modified/accessed times in the WIN32_FIND_DATA struct. Otherwise, you can call GetFileTime() to get those.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Ericahist updated (again) Sep 6!
|
|
|
|
|
i wrote the following:
void CText_dialogDlg::OnSearch()
{
CString buffer;
FILE *stream;
char target[80],etchant[80],conc[300];
char name[80];
int temp;
int m_itemp;
float etchrate;
// float m_fetchrate;
CString name_str;
CString eof = "EOF";
CString m_strTarget;
CString m_strConc;
CString m_strEtchant;
CString searchkey;
stream = fopen( "e:\\fyp_2003\\database.txt", "r" );
searchkey=m_strkey;
do
{
fscanf( stream, "%s", name );
fscanf( stream, "%s", target );
//fscanf( stream, "%s", process );
fscanf( stream, "%s", etchant);
fscanf( stream, "%s", conc);
fscanf( stream, "%d", &temp );
fscanf( stream, "%f", &etchrate );
name_str = name;
}while (name_str != searchkey);
/* Output data read: */
CString str;
str.Format("%s %s %s %s %d %f",name,target,etchant,conc,temp,etchrate);
m_dialog_etch.m_strTarget = target;
//m_dialog_etch.m_str_process = process;
m_dialog_etch.m_strEtchant = etchant;
m_dialog_etch.m_itemp = temp;
m_dialog_etch.m_fetchrate = etchrate;
m_dialog_etch.m_strConc = conc;
UpdateData(FALSE);
m_dialog_etch.DoModal();
fclose( stream );
}
but my dialog_etch din appear, instead the program hanged.
i have 2 dialogs, dialog1 and dialog_etch, when user key in the edit box, my dialog etch will retrieve the info from a txtfile.
|
|
|
|
|
dialog1 is my text_dialogDlg
|
|
|
|
|
hi!
where is onsearch() called in? Maybe you have called this function in other procedure actived by EN_SETFOCUS message.
dupengfei
|
|
|
|
|
coda_x wrote:
do {
fscanf( stream, "%s", name );
fscanf( stream, "%s", target );
fscanf( stream, "%s", etchant);
fscanf( stream, "%s", conc);
fscanf( stream, "%d", &temp );
fscanf( stream, "%f", &etchrate );
name_str = name;
}while (name_str != searchkey);
This loop is where your program is hanging. If you never read a value where name_str==searchkey , the loop will continue forever. Eventually you will reach the end of file, and the fscanf functions will return errors.
Software Zen: delete this;
|
|
|
|
|
thanx! i solved that but now i have another problem, i use 2 if statements which contain different searchkey, so by right, my dialog_etch should display different information depending on the searchkey but it kept displaying the same info to mi...:
if(strcmp(buffer,"Wet etch Al H3PO4") == 0)
{
CString search = "Wet1";
/* Read data back from file: */
do
{
fscanf( stream, "%s", name );
fscanf( stream, "%s", target );
fscanf( stream, "%s", process );
fscanf( stream, "%s", etchant);
fscanf( stream, "%s", conc);
fscanf( stream, "%d", &temp );
fscanf( stream, "%f", &etchrate );
name_str = name;
}while (name_str != search);
/* Output data read: */
CString str;
str.Format("%s %s %s %s %s %d %f",name,target,process,etchant,conc,temp,etchrate);
m_etchDlg.m_str_target = target;
m_etchDlg.m_str_process = process;
m_etchDlg.m_str_etchant = etchant;
m_etchDlg.m_f_etchrate = etchrate;
m_etchDlg.m_str_conc = conc;
m_etchDlg.m_temp = temp;
UpdateData(FALSE);
m_etchDlg.DoModal();
fclose( stream );
}
if(strcmp(buffer,"Wet etch Al H3PO4/HF") == 0)
{
CString search = "Wet2";
/* Read data back from file: */
do
{
fscanf( stream, "%s", name );
fscanf( stream, "%s", target );
fscanf( stream, "%s", process );
fscanf( stream, "%s", etchant);
fscanf( stream, "%s", conc);
fscanf( stream, "%d", &temp );
fscanf( stream, "%f", &etchrate );
name_str = name;
}while (name_str != search);
/* Output data read: */
CString str;
str.Format("%s %s %s %s %s %d %f",name,target,process,etchant,conc,temp,etchrate);
m_etchDlg.m_str_target = target;
m_etchDlg.m_str_process = process;
m_etchDlg.m_str_etchant = etchant;
m_etchDlg.m_temp = temp;
m_etchDlg.m_f_etchrate = etchrate;
m_etchDlg.m_str_conc = conc;
m_etchDlg.m_temp = temp;
UpdateData(FALSE);
m_etchDlg.DoModal();
fclose( stream );
}
is there anything wrong with it?
|
|
|
|
|
Hi,
I want to create an application which shows the status of my network devices. For this I want to put clickable icons. Once I click that it should generate a dialouge box showing the details of the device. Now, my doubt is how to create small clickable item with some icon over it?? Can it be a regular resource?? How to generate that small buttons??
Thanks and Regards,
SatyaDY.
|
|
|
|
|
Sounds like you want something like a bitmap button. Search this site for that. Another good site to look is www.codeguru.com.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
How do I determine a string is empty, coming from the input stream?
Purely for simplicity, let's say I have the following:
string str;
do
{
cout<< "\n\n Enter Something: ";
cin>>str;
} while(str.size()==0);
What I'm testing for, is whether the string is empty (which would include whitespace as well). IOW, if 'return' were to be hit, that is a whitespace, and I would like the message to be repeated.
The sample illustration is merely a test to see how I can determine when a string is truly empty, and while it is syntactically correct, the message, "Enter Something" does not get repeated if 'return' was hit.
'str.length()' doesn't do it either.
Thanks.
William
Fortes in fide et opere!
|
|
|
|
|
Hi William,
The cin will not return until an EOL or EOF character is entered. This usally is the carriage return. To tell if the string is empty, you can cycle through the string looking for any non-white space characters. Or, strip off the white characters. I have done this before, but I have lost that code.
Hope this helps. (Sorry I cannot give you the exact way, I don't have my STL book at home.)
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
Try with
getline(cin,str); which won't eat whitespace (except the final return key).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
WREY wrote:
How do I determine a string is empty, coming from the input stream?
You could try writing your own version of the getline function. I've done what I think you are trying to do by doing inputstream.get( char ). You can continue scanning the input until you get a newline character or whatever you want. The only problem is that a carriage return will have to have been pushed for the input to go into the stream. And if you want to keep track of the entire input, you can just keep adding each character to a string. I hope this helps, good luck.
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
hi..
Assuming there is alist ctrl in a dlg..
How do i handle a LVN_ITEMCHANGED message in the OnCmdMSg,, instead of
actually handling LVN_ITEMCHANGED message for the list ctrl ??
Any help is appreciated.
Thanx
saleem
|
|
|
|
|
LVN_ITEMCHANGED is a notification sent by the list control to its parent, in this case your dialog. OnCmdMsg is a handler for a command message. Perhaps if the command handler and the notification handler need to do something in common, you could create a single function that both handlers use?
Software Zen: delete this;
|
|
|
|
|
Hi,
In my MFC app,i create Menus dynamically.In this case how to trap the messages when menu item is selected or clicked.I overrddden OnCmdMsg() routine..but somehow i don't get the handle for the selected MenuItem..Pl help.
Thanks in advance
Ram
|
|
|
|
|
Why are you not using the wizard to create the handle? The wizard (not sure about .net still learning how they have changed it). This creates the method in the .h, the macro to handle and the skeleton method. Then all you need to do is add the meat! Is there something extra that you are trying to accomplish?
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
|
I'd like to create functions that copies a specific string (array of char) from another, starting at a specific offset and have a specific length.. probably something like this
char* CopyStr(const char* pszFrom, int nOffset, int nLength);
How can I do it without using CString or std::string?
|
|
|
|
|
|
or memcpy
memcpy(pDest,pFrom+nOffset,nLength*sizeof(char))
|
|
|
|
|
With memcpy, you will need to manually add the terminating NULL or preinitialize the destination buffer with NULLs.
Steve
|
|
|
|
|
Hi ,
Does any body have some examples on SNMP in C or C++?? (Not from MSDN)
Or suggest some web site.
Thanks and Regards,
Satya
|
|
|
|
|
What is SNMP???
Well... I am a beginner ...
|
|
|
|
|