The child creation is by defining a pointer object tot he child dialog class. Yep, i did traced it line by line and the result is it is having a null memory reference at the time when it is trying to destroy the child window or even if i comment the child window destroy statement and try to destroy the main window directly (which is of ocurse not the right way to terminate an application). So, what I doubt is the child destroy function is trying to free or access a null reference, but dont know where it happens.
My whole childwindow creation in main window initdialog goes like this-
achild = new CChildWindow(this);
then some of the functions in childwindow calls the functions in main window like this-
// TODO: Add your control notification handler code here
so, where am i referencing a null memory while destroying my child window???
there is a problem
assume your OnKeyFunction1 at parent (CMainWindow::OnKeyFunction1()) is for closing the application, in it you will KILL the child (i.e. delete the pointer of child window or equivlant) and so the function don't know how to return to the child part (CChildWindow::OnKeyFunction1)!!
so, what you have to do is change the structure:
1. Use callback function to use parent window function instead of directly calling, callback allow window to handle when to call the function
2. Use Send message as the "tunnel" for commuincation for some command function
3. try to build the function in child only if it only consider to be used in child
Thanks for ur replies. Today I recognised one thing which is causing me the same error. Actually my program is having 2 threads running parallel (but will be in suspended state when they r not used and resumed when needed) to the main application. My application is terminating well without any errors if I am not starting any of the threads. But when I have started them even once and then try to terminate the application or even if I click on the main application window it is giving me the same error, Access Violation and at the time of debugging the error it is sometimes pointing to
// delegate to object's WindowProc
lResult = pWnd->WindowProc(nMsg, wParam, lParam);
Those threads are worker threads, i hope. But there is a statement in those, which calls another child window on the main application using the window handle and updates the image of tht window (since this application is a real time image grabbing application).
I want to display an Excel Diagram on one of my property sheet. I write my programm with VC++6.How can i do it?Could someone help me?
and what means LPDISPATCH GetDiagram()?What will i get? Is the value of the diagram ? Or a diagram?
I'm not entirely sure what you intend to do, but I think you'll need to investigate COM. I believe the new name for doing such things is .net, but I don't think that is supported by VC++6(I may be completely wrong about this though as I haven't used visual studio much in the past)
I believe under the projects menu there will be a menu "Add Class", which will generate some header files for you to interface with COM objects. Do a google for COM etc. You can also use MSDN.com as a resource.
Be warned though if you go down this path, as most documaentation you will find will be for VB applications, and a strong use of variant types can make debugging a nightmare without docs.
My job is to write in Excel ,read from Excel and display Diagram .Now i could write and read.I've used EXCEL.EXE from type library function to write/read (Excel.Application, Excel.Workbook,Excel.Sheet...).But i don't know how to display with VC++. I know that it is no easy to do it with VC++.But i have to use VC++ .
Thanks, thats work fine! The next thing that I would like to have, is a dynamic menu for each views. The main menu will contain a top menu item called "Operation" and each views will have different operations. So, how can I do that?
My first idea was to create a popup menu for each views and attach the popup menu to the top menu "Operation". But I really need help to do that.
I am doing a project related to TAPI.When i am executing the appllication ,i got an error that the selected line does't support voice capabilities.What will be the problem? How can i identify that my modem having suitable driver.(I am using voice modem).Help me please...
The basic nature of your questions leads me to beleive you are not familiar with this book, which I recommend you read, before you get too deep into TAPI development - "Windows Telephony Programming" by Chris Sells
how should i start with which of them and how to continue???
thanks,waiting for reply.
the website i want to develop is something like codeproject.com