|
void CKeithDlg::OnLogin()
{
ShowWindow(SW_HIDE);
CMainDlg Dlg;
Dlg.DoModal();
EndDialog(IDOK);
}
Manish Rastogi
|
|
|
|
|
Is it true that if GetActiveView() returns NULL then Our Application Does not Support Doc/view.or how can know
or how can check that Our Appliction Supports Doc/View
pls help me.
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
(1)GetActiveView() returns NULL when called for an MDI main frame window (CMDIFrameWnd).
(2)If there is no current view, returns NULL.
libo
|
|
|
|
|
I am attempting to write a front-end database app. Using relational database design I have a parent table in a CFormView in one pane of a splitter window and a child table CFormView in another pane of the same splitter window. On the OnInitialUpdate for each of the CFormView's I create and open the recordsets. I can replace a new CFormView and (subsequent recordset) into a pane based on user selection. I notice that OnInitialUpdate fires for each pane of the window regardless of whether or not the pane is being replaced. Creating some problems as I was expecting the OnInitialUpdate to only fire once.
To test this again before I posted this question, I opened up a Splitter Window example from a book (MFC Answer Book) and put some trace statements in the OnInitialUpdate event for each of the CFormViews. It appears that if a window has 3 panes, all 3 panes get the OnInitialUpdate to fire even when only one is being replaced.
Question: Is this normal behavior? Thanks.
|
|
|
|
|
Can you but a breakpoint in the view's OnInitialUpdate() method and check the stack trace at that point? That will tell you what piece of code is calling OnInitialUpdate() and why it is happening for each view.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi David,
I did it once and my eyes kind of glazed over. So I did it again and it makes sense now.
InitialUpdateFrame was being called in the code that switched the views and this then makes each view call OnInitialUpdate.
Thanks
|
|
|
|
|
How to write the output array to a text file?
|
|
|
|
|
chaitanya22 wrote: How to write the output array...
What output array?
chaitanya22 wrote: How to write...to a text file?
What text file?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
Here's one way:
FILE *pFile = fopen("file.txt", "w");
for (int x = 0; x < sizeof(array) / sizeof(array[0]); x++)
fprintf("%d\n", array[x]);
fclose(pFile); Others exist, too.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
for write to file you can use CArchive But please refer to Reply David Crow
|
|
|
|
|
if you meant the values of and array in a txt file you can use the binary files to write the whole array in it but binary mode.
f=fopen(fname,"bw");
fwrite(array,1,sizeof(int)*nr_of_items,f);
fclose(f);
but if you want the values to be readable you must convert them first to chars and then write them.
char nr[10];
/*if array declared like this int array[100] or int *array*/
f=fopen(fname,"w+");
for (int i=0;i<nr_of_items;i++)
{
_itoa(*array,nr,10);
fwrite(nr,1,strlen(nr),f);
array++;
}
fclose(f);
the main="" thing="" is="" that="" you="" can="" write="" any="" kind="" of="" data="" variable="" in="" a="" binary="" file="" otherwise="" will="" have="" to="" make="" convension="" it="" text="" file.="" sometihng="" like="" this:
1="" line="" the="" nr="" entries
2="" length="" each="" entry="" if="" they="" are="" all="" equal
3="" -=""> nr_of_items line the entries
or something like this.
have fun
gabby
|
|
|
|
|
what about CFile;
CFile a("C:\\tmp.txt",CFile::modeWrite|CFile::modeCreate);
for(int i=0;i<nSize;i++)
a.Write(m_arrString[i],strlen(m_arrString));
a.Close();
|
|
|
|
|
I am working on an application that has different features built in for parsing traffic logs for the television broadcast industry. Marketing wants to sell each feature seperately or as a full package. What would be the best way to turn on and off these features short of having to do seperate builds for each of them. Also if at a later date the customer wants to add features to his existing software without having to send them a new build.
raybert
|
|
|
|
|
There are many solutions to your problem. One way we do it at our company is run a little setup dialog first, so that the user tells what to start. Then that dialog calls the appropriate executables and passes in different command-line arguments for different features.
|
|
|
|
|
package your features in DLL, only ship the one that the client buy.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I am verynew to Visual C++ 6, but I can write powerfull database programes with it. the only problem I have is the child form or child dialog. When I create as child I can not use the mouse but I can navigate with the tab. if I make it popup and move the mdi form it does not move with the parent.
Can some one give me hints!!
|
|
|
|
|
Salad Juris wrote: I am verynew to Visual C++ 6, but I can write powerfull database programes with it.
Yes, but it would not be a wise endeavor given your "new" status. A better solution would be to use Microsoft SQL, Access, or MySQL as the DBE, and write the front end using VC++.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanks for you reply, as front end I am using mysql with C API and it is working fine. my problem is in the displaying the form in mdi application.
Best REgards
|
|
|
|
|
Salad Juris wrote: my problem is in the displaying the form in mdi application.
Is it a modeless dialog?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanks David
I tried modelles and model dialog and also FormVies. When I set the style to child I can not click the form or the dialog with the mouse, but I can use the tab and the keyboard. if I set it to other it does not move with the window and it goes out of the window.
My current possition now is I set in the more style tab as control. in this possition is better than others but when I move the main windows it remains current possition.
Best Regards
|
|
|
|
|
Salad Juris wrote: When I set the style to child...
Why are you using WS_CHILD as opposed to WS_POPUP ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I went through several books, and read several posted messages, nont of them helped to get solution for this.
If you know better and simple way to do it, what I need for my project is creating mfc mdi project and attach either child dialg window or child formview. That is all what i need.
Can help on this?
|
|
|
|
|
So if you have already created the MDI application and derived the view from CFormView , what is the problem?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
The form name is IDD_FORMVIEW
the class name is CMyFormView driven from CFormView, how do do I call the form from the menu?
Thanks
|
|
|
|