|
I want to make my view-window just like MS-Excel.
My question is: How to make the Tab and scroll control in the same row???
-- modified at 20:20 Thursday 2nd November, 2006
|
|
|
|
|
I have an application with produce document/file with a lot of textual information into it (in a TAR-GZ format).
This application is for the general public (as opposed to corporate, so I cannot assume too much on what's on my user's computer, except we require XP or later).
Now the Windows user could search file, in the FileExplore, by right clicking on a folder => search.
I wonder if there is a way to extend this search so that it search in my files as well?
I have found the IFilter interface, but apparently it is only if you have the indexing service running. I don't know which one it is, but I will bet I don't have it running, nor my user.
Any tip?
|
|
|
|
|
I'm having somewhat of a strange problem. When overriding WM_NCACTIVATE to draw custom borders to my window, the window no longer becomes the foreground window. It has the focus, but is not the currently selected window within the Taskbar. A similar problem arrises when closing the window, the previous is neither selected or has the focus.
I have tried calling SetForegroundWindow() from various locations within the code, but it has no effect. A call to DefWindowProc() before my own code solves the problem, but creates others. Could anybody point in me in the right direction as to exactly which API call is required?
|
|
|
|
|
waldermort wrote: Could anybody point in me in the right direction as to exactly which API call is required?
SetWindowPos
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
I feel so stupid sometimes I tried it before, but I can't think why I didn't try the SWP_SHOWWINDOW flag. Thankyou.
|
|
|
|
|
What value are you returning from your WM_NCACTIVATE handler? The ret value is important for that message as it controls the active/inactive state of the window after the handler returns.
|
|
|
|
|
I should have read the docs a little more carefully. I was handling the WM_NCACTIVATE to get the required state for the borders then falling through to a WM_NCPAINT handler, which should return 0. My mistake.
|
|
|
|
|
Hi all,
I have some difficulties in automating the excel application using MFC. My project is to get the input from the user and according to that input i mus draw chart in excel. presently i can able to connect with excel. But my problem is that i dont know how to create a line chart and dont know how to define the x and y axes. I am using VC++ 6.0.
Can anyone please help me in this regards?
Thanks in advance.
Regards,
Ram
|
|
|
|
|
Ram Murali wrote: But my problem is that i dont know how to create a line chart and dont know how to define the x and y axes.
Are you using any of the following classes:
ChartObject
ChartObjects
_Chart
Charts
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I am writing an application where I convert the set of images to .avi file. I am using use XviD MPEG4 codec as a default codec. I set this as default codec to “xvid”. Now my AVIStreamSetFormat function displays a dialog box with title "XviD Status". How can I avoid this dialog box?
Regards,
Hemant Kulkarni.
|
|
|
|
|
There's an option in the XviD Configuration dialog to turn it off.
Also, try this registry entry
HKCU\Software\GNU\XviD\display_status
Set it to 0.
(found this on google, don't know if it's right )
|
|
|
|
|
Hi All,
I am new this VC++ Programming. Can one say that how to create a shared memory so that all process can access that memory?.
or let me know that where can i see shared memory programming articles?.
Thanks in Advance...
|
|
|
|
|
There are a couple of ways. One is to make an EXE or DLL that has a shared data segment. ie.
#pragma data_seg(".shared")
int g_SharedVariable = 1;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.shared,rws")
Another way is to use the CreateFileMapping API with hFile set to INVALID_HANDLE_VALUE and dwMaximumSizeHigh and dwMaximumSizeLow set to the size of the mapping.
Steve
|
|
|
|
|
Sakthiu wrote:
or let me know that where can i see shared memory programming articles?.
googling is what you need.. any why try this search :-
SHARED MEMORY AT CODEPROJECT[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
Hi All,
I've created a dialog based application with the dialog having multiple editboxes. What I want to achieve is to call a specific function when I press "Enter" key. Each editbox should trigger its specific function or I should be able to know from which editbox the enter key was pressed.
Please help.
Thanks,
Gajendra
|
|
|
|
|
gajendrakashyap wrote: Each editbox should trigger its specific function or I should be able to know from which editbox the enter key was pressed.
You GetFocus api to get currently focussed Edit box!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
Using this I can get a pointer to the ebox. If I could get the ID number of the ebox in context, it would help me more than having a pointer as my application logic depends on that.
Can you suggest something on obtaining focussed ebox control id number?
Thanks,
Gajendra
|
|
|
|
|
Using this I can get a pointer to the ebox. If I could get the ID number of the ebox in context, it would help me more than having a pointer as my application logic depends on that.
Can you suggest something on obtaining focussed ebox control id number?
|
|
|
|
|
You can override default PreTranslateMessage function of the dialog/window class.
BOOL CBAMBuildToolDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam == VK_RETURN)
{
if (pMsg->hwnd == ::GetDlgItem(*this, IDC_EDITBOXID)
//Replace with proper ID
{
//Handling of the return key for this edit box
return TRUE;
}
}
}
return CDialog::PreTranslateMessage(pMsg);
}
I hope the above code snippet will help you.
Regards,
Stanly
|
|
|
|
|
stanlymt wrote: IDC_EDITBOXID)
from where this ID will come.. and are you going to check like this, for every Control present on Dilaog box.. this really going to make you PreTranslateMessage Bulky..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
ID is the Editbox ID in the resource file. If you need to handle differently for each edit box in the dialog, you have to handle it seperately. Otherwise,
you can use one button as 'default' button and handle the event there.
|
|
|
|
|
stanlymt wrote: you can use one button as 'default' button and handle the event there.
then I believe his question wrong.. actually that person want currently focused EditBox at the Time of press of enter key
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
gajendrakashyap wrote: Can you suggest something on obtaining focussed ebox control id number?
when you got pointer to Window you can easily call function GetDlgCtrlID to retrieve it control id
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
Thanks Alok. Actually i tried that, but misspelt the name of function
I could work from your first clue itself.
Thanks for the help !!
Thanks & regards,
Gajendra
|
|
|
|
|
I have a program that is able to take the numbers out of the .txt if it is just a list of numbers. Problem is, I have a file with Names before the grades. I believe i need to set up another array inside the first one to fill with names. The .txt file will look like:
Name
grade
grade
grade
grade
grade
grade
grade
grade
grade
grade
Name
...
Have 15 Names with 10 grades under each. I guess what i'm trying to do is take the strings out of the file. Is there a way to take the strings(there is a string every 11 lines)
Here is what i have now:
#include
#include
#include
#include
#include
#include
using namespace std;
const int TESTS = 10;
const int STUDENTS = 15;
void displayGrades( int [][TESTS] );
void getGrades( int [][TESTS]);
int main()
{
int data[STUDENTS][TESTS] = {0};
getGrades( data );
cout <<fixed <<setprecision(1);
displaygrades(="" data);
#ifdef="" win32
system("pause");
#endif
return="" 0;
}
void="" getgrades(int="" data[]="" [tests])
{
ifstream="" inputfile;
inputfile.open("gradespring07.txt");
if="" (!inputfile)
{
cout="" <<="" "error="" opening="" file!"="" endl;
exit(="" 1="" );
}
for="" (int="" student="0;" student<="" students="" ;="" student++)
{
for="" test="0;" test
{
inputfile="">> data[student][test];
}
}
}
void displayGrades( int data[][TESTS] )
{
double testTotal = 0.0;
double classTotal = 0.0;
double squared = 0.0;
double var = 0.0;
double sdev = 0.0;
int mxm = data[0][0];
int min = data[0][0];
cout << "\nGrade summary" << endl;
cout << "--------------" << endl;
cout << left << setw(7) << "Student"
<< right << setw(5) << right << "Ex1"
<< setw(7) << "Ex2"
<<setw(6) <<="" "ex3"
<<setw(6)="" "qz1"
<<setw(5)="" "qz2"
<<setw(6)="" "qz3"
<<setw(6)="" "qz4"
<<setw(6)="" "qz5"
<<setw(6)="" "pr1"
<<setw(6)="" "pr2"
<<setw(8)="" <<"averg"="" <<endl;
for="" (="" int="" student="0;" <="" students;="" ++)
{
cout="" left="" <<setw(7)="" +="" 1;
for="" test="0;" tests;="" test++)
{
int="" grade="data[student][test];
cout" right="" <<setw(5)="" <<"="" ";
classtotal="" average="(((data[student][0]+data[student][1]+data[student][2])/3)*0.4)+(((data[student][8]+data[student][9])/2)*0.3)+(((data[student][3]+data[student][4]+data[student][5]+data[student][6]+data[student][7])/5)*0.3);
cout" setw(7)="" endl;
}
cout="" "\n"="" "test="" avg";
for="" (int="" test++)
{
for="" student++)
{
testtotal="" setw(6)="" testtotal="" students;
testtotal="0.0;
}
cout" endl;
cout="" "stan="" dev";
for="" student++)
{
squared="" 2.0);
var="(squared" -="" ((testtotal="" *="" testtotal)="" 15)="" )="" 15;
sdev="sqrt(var);
}
cout" sdev;
sdev="0.0;
}
cout" "max";
for="" student++)
{
if="" (data[student][test]=""> mxm)
{
mxm = data[student][test];
}
}
cout << right <
|
|
|
|