|
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 <
|
|
|
|
|
So what's your actual problem? Does it fail to compile? Does it crash? Does it just act weird?
Is there a particular part that you know isn't working properly? Have you tried stepping through that part in a debugger?
If you can isolate the particular part that's giving you a problem, let us know, and we might be able to help
|
|
|
|
|
there is no problem with the code that i posted. The problem i am facint is that the posted code will only read a list of integers without a student name. The .txt i need to read from is supposed to have the student name then 10 grades after then another name and another 10 grades. Don't know how to retrieve the name.
Thanks
|
|
|
|
|
I have to use a third part extension dll in my vc2003.net project, but to my despond the dll was built with vc6.0. In the book, they say a extension dll should use in a client application with the same version MFC dll. But I want know if there is a solution?
Thanks a lot!
|
|
|
|
|
Link the client application to the old MFC
|
|
|
|
|
Yes, it works. But, is there another way out?
|
|
|
|
|
I'm not sure how safe it would be. If you can link to the extension DLL and it runs then great.
The behavior, at best, would be undefined for any MFC extended classes that you derive from in
your client app though. Old MFC may allocate stuff the new MFC doesn't free, member variables
could be different, etc. Lots of room for things to go wrong
|
|
|
|