|
sourabh272318 wrote: I TRIED TO MAKE FIEND FUNCTION INTO CHILDFRANE IT DOESNT WORK.
so, now the c++ standard defines evil functions ? :->
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Yes you access it using the "satan" keyword as opposed to "friend".
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
sourabh272318 wrote: I TRIED TO MAKE FIEND FUNCTION INTO CHILDFRANE IT DOESNT WORK
How about making Message Handdler in your View class and posting message to it when ever something changed
"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
|
|
|
|
|
hi
sourabh jain
patni computers system
|
|
|
|
|
Use GetParentFrame() .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi,
I'm using VS .NET 2003 and CR 8.5 ...
My project type is MFC Dialog-based program and i should display a ADO Recordset query result in viewer activex ...
It's what i've done:
1- I made the Report with Crystal Report 8.5 and with connecting to .mdb database via OLEDB connection ... (it's ok)
2- Then i insert the Viewer Control in my project and also made the ado recordset object with a simple query like this: "select * from some_table where code=1"
3- i wrote below code:
m_RptApp.CreateInstance( "CrystalRuntime.Application" );<br />
m_RptReportInfo = m_RptApp->OpenReport( _bstr_t(_T("rpt\\CompanyInfo_FA.rpt")) );<br />
Line1: m_RptReportInfo->Database->SetDataSource( _variant_t( (IDispatch *)m_pRec, true ) );<br />
m_ReportViewer.put_ReportSource( m_RptReportInfo );<br />
m_ReportViewer.ViewReport();
I tried this code for Line1 too:
m_RptReportInfo->Database->Tables->GetItem( 1 )->SetDataSource( _variant_t( (IDispatch *)m_pRec, true ) );
The Problem:
the problem is the program shows ALL records ... and NOT the filtered recs !!
1- Can u tell me what's wrong with my code ?!
2- ( ADO Question ):
say i have two _RecordsetPtr objects ..
for example: _Rec1, _Rec2 ..
_Recs1 fills by some records (by Open() mehod)
Is there anyway to copy some records from _Rec1 to _Rec2 ?!
for example i want to copy Record (pos) number 3, 10, 16 to _Rec2
( sorry for my english .. )
Regards,
Hadi
|
|
|
|
|
YEP !!!
SOLVED !
|
|
|
|
|
I have a dialog box with id IDD_AGREE_FRAME_ABSTRACTION . This class's all cotrols are populated from the view class using one LoadDetails() function which is implemented inside the dialog class. I have added an edit box to this dialog. But when ever i am creating any variable of type:
1. CString and attaching it to the editbox through class wizard/manually. It's giving me a message "An unsupported operation was attempted". When i click that msg box the application is getting crashed.
2. CEdit then i am getting the message and the application is crashing.
When i am debugging the application the message box is coming in the DoDataExchange i for that particular entry for that editbox control.
I deleted the entry in the DoDataExchange for the control and just tried to set a its text by using GetDldItem(IDC_EDIT_BLDG_AGE)->SetWindowText("biswa") but again the application is crashing.
For all the cases when its crashing it's giving the error as "Unhandled exception in the app.exe(MFC42D.DLL):0x0000005: Access Violation."
I am really surprised why this is happening for this dialog where as for other dialog there is no problem when i do the same. Also when i am removing the the DDX_Text entry for the control causing the problem the whole application is running fine.
Please help me on this. This is really important for me. If you need any more information then just tell me i can give you the detail history for this.
|
|
|
|
|
|
When the dialog is created in the view class it calls the DoDataExchange function and when it excutes the line
DDX_Text(pDX,IDC_EDIT_BUILDING_AGE,m_BuildingAge) it crashes and when i remove the entry it works fine. Also as i said when directly try to access by it using GetDlgItem then also it crashes.
One more thing i want to say this class was not visible when opened the class wizard. So i deleted the .clw file and agained opened it. That class was then visible but when i selected that i got parsing error for one of entries of DoDataExchange function that is DDX_Dollar(.....). That is why i added entry for this control manually.
|
|
|
|
|
just try the follow this may be reason....
in resourse.h
IDC_EDIT_BUILDING_AGE is defined right. it has some value say 1234
check there should not any other defined with the same value 1234.
just check it. as a one of the reasons.
Regards
Anil
|
|
|
|
|
When does LoadDetails() get called?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
The LoadDetail() is called in the OnUpdate() of the view class.
|
|
|
|
|
BiswaR wrote:
The LoadDetail() is called in the OnUpdate() of the view class.
Before or after the dialog's DoModal() method is called?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi!
Does somebody know, how to to open notepad.exe?
In the opened notepad's page, the user should be able to write, save and close the file.
Would be great, if somebody could help me with this problem.
|
|
|
|
|
|
Hi!
Thanks, that was a big help.
Maybe you can tell me, too, how to insert text of a CString-object in the already opened notepad-File? Or do I have to do this at the same time and if yes: how?
With best regards,
Hanno
|
|
|
|
|
I don't know if this is possible. However, what you could to is first, save your text into a text file, then open this file in notepad with ShellExecute.
But, why exactly do you want to have such a thing ? Maybe there is another solution that is better.
|
|
|
|
|
I want to have such a thing, because there are points to display on a window. There is a function, responsible for displaying the points. Of course, the function needs coordinates.
First of all, this function gets the point names from the calling program.
THen, the function is looking for fitting coordinates, which should be in a already existing text-file. But it can happen, that the coordinate-file will be empty. Then, the function has to open a notepad-file, where the point-names should be already inserted. The user has to write down the missing coordinates for the point-names.
That's the way. Maybe you have a better idea to do this?
Hanno
|
|
|
|
|
Err...
Honnestly, I don't think notepad is the right tool for doing that. Why don't you simply ask for this data in a program of your own (either a separate or even in your existing application) ? Then save the data in a file and its done. Why do you want to use notepad for that ?
|
|
|
|
|
Cedric Moonen wrote: Honnestly, I don't think notepad is the right tool for doing that.
I concur. It's the old square-peg-in-a-round-hole paradigm.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
But it works that way. It is not my idea to do it this way, maybe that makes you a little bit happier?
Best regards, Hanno
|
|
|
|
|
hanno25 wrote: It is not my idea to do it this way
Let me guess: it's your boss's idea
|
|
|
|
|
you cannot directly interract with the notepad content.
however,you could write your string (CString object content) into a file that you pass to notepad as a command line parameter so that it is opened when notepad is launched.
::ShellExecute(this, "open", "notepad.exe", "myfile", NULL, SW_SHOW);
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
Another idea that comes to mind would be to use the Windows clipboard.
What you could do in your program is launch notepad.exe. Your app could place the text content on the clipboard and then send messages to the notepad window to paste the text into it's edit window.
For more info on how to use the Windows clipboard, look up the SetClipboardData function on MSDN and/or take a look at this CodeProject article[^]
It doesn't really make sense as to why you can't just write your data straight out to a text file from within your program.
|
|
|
|