Click here to Skip to main content
15,919,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to start up an external .exe prog? Pin
Anonymous5-Aug-02 13:31
Anonymous5-Aug-02 13:31 
GeneralRe: How to start up an external .exe prog? Pin
Nish Nishant5-Aug-02 16:47
sitebuilderNish Nishant5-Aug-02 16:47 
GeneralRe: How to start up an external .exe prog? Pin
Anonymous6-Aug-02 15:23
Anonymous6-Aug-02 15:23 
GeneralRe: How to start up an external .exe prog? Pin
Nish Nishant6-Aug-02 17:53
sitebuilderNish Nishant6-Aug-02 17:53 
GeneralFindResource Pin
Sparticus5-Aug-02 12:10
Sparticus5-Aug-02 12:10 
GeneralRe: FindResource Pin
Sparticus5-Aug-02 12:13
Sparticus5-Aug-02 12:13 
GeneralUsing regedit and the command line... Pin
esapp4205-Aug-02 11:13
esapp4205-Aug-02 11:13 
Questionhow to access an object that is declared in view1, when in view2? Pin
ns5-Aug-02 10:52
ns5-Aug-02 10:52 
I've got an MDI MFC app.

(Irrelevant info in parentheses probably: I have a database class(built from ADO) )

An object 'db' is declared in view1. It opens a database which has to stay open while the program is running. Now I want to run one of the functions of db, in view2. View2 transmits a piece of information that is to be used in the argument list of the function. I need to use the same object, so I cant create a new one (cant open an already open database connection). What is the best mechanism to do this?

I was wondering about:

/*	POSITION pos = pDoc->GetFirstViewPosition();
	while (pos!=NULL)
	{
		CView* pView = pDoc->GetNextView(pos);
		ASSERT_VALID(pView);
                pView->db.MyFunc(arg from view2);
         }
*/


I only have two views and this tactic worked when I did a sendmessage from view2 to view1. But in the dropdown intellisense after doing pView-> I saw only the names of functions and didnt know if I could get to the db object as above.

Please let me know.

Thank you very much,
ns

The above snippet said that db was not a member of CView. I tried forcing it to be CTrain1View * (totally wrong I know) but was not acceptable to the compiler either.

Do I have to go via Doc variables and a sendMessage?
AnswerRe: how to access an object that is declared in view1, when in view2? Pin
Tomasz Sowinski5-Aug-02 11:02
Tomasz Sowinski5-Aug-02 11:02 
GeneralRe: how to access an object that is declared in view1, when in view2? Pin
nss5-Aug-02 12:47
nss5-Aug-02 12:47 
GeneralRe: how to access an object that is declared in view1, when in view2? Pin
Chris Losinger5-Aug-02 13:39
professionalChris Losinger5-Aug-02 13:39 
GeneralRe: how to access an object that is declared in view1, when in view2? Pin
nss5-Aug-02 13:53
nss5-Aug-02 13:53 
AnswerRe: how to access an object that is declared in view1, when in view2? Pin
Steen Krogsgaard7-Aug-02 0:29
Steen Krogsgaard7-Aug-02 0:29 
Generalmessage handling Pin
help5-Aug-02 10:50
help5-Aug-02 10:50 
Generalstandard save dialog problem Pin
Brad Jennings5-Aug-02 10:44
Brad Jennings5-Aug-02 10:44 
GeneralRe: standard save dialog problem Pin
Ernest Laurentin5-Aug-02 10:50
Ernest Laurentin5-Aug-02 10:50 
GeneralRe: standard save dialog problem Pin
Brad Jennings5-Aug-02 11:06
Brad Jennings5-Aug-02 11:06 
GeneralRe: standard save dialog problem Pin
Brad Jennings5-Aug-02 11:36
Brad Jennings5-Aug-02 11:36 
GeneralRe: standard save dialog problem Pin
Ernest Laurentin5-Aug-02 11:51
Ernest Laurentin5-Aug-02 11:51 
GeneralDestroyWindow Issues Pin
tjkrz5-Aug-02 10:37
tjkrz5-Aug-02 10:37 
GeneralRe: DestroyWindow Issues Pin
Tomasz Sowinski5-Aug-02 10:47
Tomasz Sowinski5-Aug-02 10:47 
GeneralRe: DestroyWindow Issues Pin
tjkrz5-Aug-02 10:52
tjkrz5-Aug-02 10:52 
GeneralRe: DestroyWindow Issues Pin
Tomasz Sowinski5-Aug-02 11:03
Tomasz Sowinski5-Aug-02 11:03 
GeneralRe: DestroyWindow Issues Pin
tjkrz6-Aug-02 2:51
tjkrz6-Aug-02 2:51 
GeneralSimple ADO question ... Pin
Hadi Rezaee5-Aug-02 9:43
Hadi Rezaee5-Aug-02 9:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.