Click here to Skip to main content
15,898,036 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Toolbar Resizing Pin
Steven M Hunt4-Dec-02 16:49
Steven M Hunt4-Dec-02 16:49 
GeneralRe: Toolbar Resizing Pin
Rand Al'thor4-Dec-02 16:55
Rand Al'thor4-Dec-02 16:55 
GeneralRe: Toolbar Resizing Pin
Theo Buys16-Oct-16 23:20
Theo Buys16-Oct-16 23:20 
GeneralMFC DLL that Loads an SDI Pin
mgarvin3-Dec-02 10:19
mgarvin3-Dec-02 10:19 
GeneralRe: MFC DLL that Loads an SDI Pin
valikac3-Dec-02 12:56
valikac3-Dec-02 12:56 
GeneralRe: MFC DLL that Loads an SDI Pin
Roger Allen4-Dec-02 1:53
Roger Allen4-Dec-02 1:53 
GeneralRe: MFC DLL that Loads an SDI Pin
Roger Allen5-Dec-02 21:46
Roger Allen5-Dec-02 21:46 
Generalhelp: passing pointer from view to dialog problem Pin
trustno13-Dec-02 9:36
trustno13-Dec-02 9:36 
hi everyone,

i'm working on a sdi application with window's explorer style(i.e. a
sdi application with a vertical splitter, dividing the windows into 2
panes, left and right pane).

i added a command, named 'add info', to the main menu and added the event handler to 'add info'. the coding of the event handler of 'add info'
command is done in left pane class. what 'add info' command do is creating a dialog that collects inputs from users then store these user inputs into a database. i modified the contructor of the dialog for 'add info' to accept a database object pointer(get past from the left pane class, when the dialog object is created).

when i start the program, if the windows focus in on left pane, i was able to run 'add info' command, display the dialog, save the inputs from the dialog and store in the database without any problem.

the problem occurs when my window focus is on right pane, if i run
'add info', i get error 'Unhandled exception at 0x005832ba in myapp.exe: 0xC0000005: Access violation reading location 0x61636f4c.'

and the debugger points out that the program crashes at line 44 in objcore.cpp, within the function iskindof(.....)..

here is the function..

BOOL CObject::IsKindOf(const CRuntimeClass* pClass) const
{
ASSERT(this != NULL);
// it better be in valid memory, at least for CObject size
ASSERT(AfxIsValidAddress(this, sizeof(CObject)));

// simple SI case
CRuntimeClass* pClassThis = GetRuntimeClass();
return pClassThis->IsDerivedFrom(pClass);
}

after doing several tests, i found out that it was the database pointer, that get past from the left pane class to the dialog class, causing the problem.. strangely, the pointer doesn't cause any problem with left pane, but causing problems with right pane.. does anyone have any suggestion on fixing this?
thx in advance.
GeneralBSTR and UNICODE Pin
Jörgen Sigvardsson3-Dec-02 9:31
Jörgen Sigvardsson3-Dec-02 9:31 
GeneralRe: BSTR and UNICODE Pin
Tim Smith3-Dec-02 9:40
Tim Smith3-Dec-02 9:40 
GeneralRe: BSTR and UNICODE Pin
Jörgen Sigvardsson3-Dec-02 11:53
Jörgen Sigvardsson3-Dec-02 11:53 
GeneralRe: BSTR and UNICODE Pin
Michael Dunn3-Dec-02 13:18
sitebuilderMichael Dunn3-Dec-02 13:18 
GeneralRe: BSTR and UNICODE Pin
Jeff J3-Dec-02 16:40
Jeff J3-Dec-02 16:40 
GeneralEnum vs #define Pin
Brad Bruce3-Dec-02 9:23
Brad Bruce3-Dec-02 9:23 
GeneralRe: Enum vs #define Pin
Neville Franks3-Dec-02 9:31
Neville Franks3-Dec-02 9:31 
GeneralRe: Enum vs #define Pin
Maximilien3-Dec-02 9:52
Maximilien3-Dec-02 9:52 
GeneralRe: Enum vs #define Pin
Tim Smith3-Dec-02 9:56
Tim Smith3-Dec-02 9:56 
GeneralRe: Enum vs #define Pin
Neville Franks3-Dec-02 9:57
Neville Franks3-Dec-02 9:57 
GeneralRe: Enum vs #define Pin
Maximilien3-Dec-02 10:02
Maximilien3-Dec-02 10:02 
GeneralRe: Enum vs #define Pin
Neville Franks3-Dec-02 10:07
Neville Franks3-Dec-02 10:07 
GeneralRe: Enum vs #define Pin
Maximilien3-Dec-02 10:09
Maximilien3-Dec-02 10:09 
GeneralRe: Enum vs #define Pin
Neville Franks3-Dec-02 10:18
Neville Franks3-Dec-02 10:18 
GeneralRe: Enum vs #define Pin
Tim Smith3-Dec-02 10:42
Tim Smith3-Dec-02 10:42 
GeneralRe: Enum vs #define Pin
Gary R. Wheeler3-Dec-02 15:24
Gary R. Wheeler3-Dec-02 15:24 
GeneralRe: Enum vs #define Pin
Orkun GEDiK3-Dec-02 9:44
Orkun GEDiK3-Dec-02 9:44 

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.