calling an interface method from another method in the same class 
Author Message
 calling an interface method from another method in the same class

this is the code of the problem:

STDMETHODIMP CClassA::Start()
{
   ATLTRACE("test");

Quote:
}

void CClassA::press()
{
    Start();   //Access Violation happens here
Quote:
}

when i call Start From Press  i get:
First-chance exception in VTest.exe (XTester.DLL): 0xC0000005: Access
Violation.

When i call Start from another Class it works fine
Start method is of interface press is not
Both are of the same class defined in the same h file
why is that happening , how can i overcome this?



Sun, 10 Aug 2003 03:06:48 GMT  
 calling an interface method from another method in the same class
When do you call press? If you do it in the constructor - that's normal
(you don't have a vtable yet).

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> this is the code of the problem:

> STDMETHODIMP CClassA::Start()
> {
>    ATLTRACE("test");
> }

> void CClassA::press()
> {
>     Start();   //Access Violation happens here
> }
> when i call Start From Press  i get:
> First-chance exception in VTest.exe (XTester.DLL): 0xC0000005: Access
> Violation.

> When i call Start from another Class it works fine
> Start method is of interface press is not
> Both are of the same class defined in the same h file
> why is that happening , how can i overcome this?



Mon, 11 Aug 2003 09:59:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Call methods of dynamically loaded classes via interface?

2. Calling explicitly implemented interface method from derived class

3. Calling Class methods from Interface

4. Calling a class member's interface method from a non interface method on the parent class

5. Calling one Interface method into another Interface

6. Howto Expose a normal C++ class with methods via an Interface Class in ATL COM

7. call from nested class method nonstatic of the class containing

8. Call ATL class method from C++ class

9. Dynamic Method call ( Invoke method ) failing in service when compiled as ReleaseMinDependancy

10. Calling a method from within a method, legal?

11. use method from CMainFrm class fin CMyappApp::InitInstance method of an SDI app

12. Using other interfaces in a method call

 

 
Powered by phpBB® Forum Software