How to access a function in another class file
-
Hi, By using MFC Appwizard I have created a project. Say FirstApp as an SDI application and chosen the Header files only as databasesupport. I wrote a function in FirstAppView class to get the database connection. After that I have inserted another Dialog resource and added a few controls for it and then added a new class for it. Now I want to invoke the function which I wrote in FirstAppView class. Can you plz say How can I do that? Thanks in advance.
-
Hi, By using MFC Appwizard I have created a project. Say FirstApp as an SDI application and chosen the Header files only as databasesupport. I wrote a function in FirstAppView class to get the database connection. After that I have inserted another Dialog resource and added a few controls for it and then added a new class for it. Now I want to invoke the function which I wrote in FirstAppView class. Can you plz say How can I do that? Thanks in advance.
Does this help;
AfxGetMainWnd()->GetActiveView()->YourFunction();
Prasad Notifier using ATL | Operator new[],delete[][^]
-
Hi, By using MFC Appwizard I have created a project. Say FirstApp as an SDI application and chosen the Header files only as databasesupport. I wrote a function in FirstAppView class to get the database connection. After that I have inserted another Dialog resource and added a few controls for it and then added a new class for it. Now I want to invoke the function which I wrote in FirstAppView class. Can you plz say How can I do that? Thanks in advance.
tejaswini.g wrote:
Now I want to invoke the function which I wrote in FirstAppView class.
create extern object of that Class and call the required function using taht object!
"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, By using MFC Appwizard I have created a project. Say FirstApp as an SDI application and chosen the Header files only as databasesupport. I wrote a function in FirstAppView class to get the database connection. After that I have inserted another Dialog resource and added a few controls for it and then added a new class for it. Now I want to invoke the function which I wrote in FirstAppView class. Can you plz say How can I do that? Thanks in advance.
Thank you very much for both of you. I have another doubt shall i ask you? I wrote code like this. while() { ..... ..... //a query to insert data into database. .... } I want to stop the execution for sometime say 2milli seconds after insert query. How can I do that? Can I use sleep() method here?
-
Thank you very much for both of you. I have another doubt shall i ask you? I wrote code like this. while() { ..... ..... //a query to insert data into database. .... } I want to stop the execution for sometime say 2milli seconds after insert query. How can I do that? Can I use sleep() method here?
tejaswini.g wrote:
I want to stop the execution for sometime say 2milli seconds after insert query. How can I do that? Can I use sleep() method here?
any particular reason to use While Loop!...
"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
-
tejaswini.g wrote:
I want to stop the execution for sometime say 2milli seconds after insert query. How can I do that? Can I use sleep() method here?
any particular reason to use While Loop!...
"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
Yes I am reading data from a .txt file and inserting it into the database.
-
Does this help;
AfxGetMainWnd()->GetActiveView()->YourFunction();
Prasad Notifier using ATL | Operator new[],delete[][^]
Hi Prasad, Actually I tried this way but I got an error saying that my application class is not derived from CWnd. Can u say how to overcome it. Thanks in advacne.
-
Hi Prasad, Actually I tried this way but I got an error saying that my application class is not derived from CWnd. Can u say how to overcome it. Thanks in advacne.
Can you show some code? I assume your application is SDI with Doc/view support. and you have a dilaog class from which you want to access a function in view class, isn't it?
Prasad Notifier using ATL | Operator new[],delete[][^]