Click here to Skip to main content
15,920,508 members
Home / Discussions / COM
   

COM

 
GeneralRe: How to solve this problem??? Pin
chq1223-Apr-02 12:58
chq1223-Apr-02 12:58 
GeneralRe: How to solve this problem??? Pin
Vi223-Apr-02 21:05
Vi223-Apr-02 21:05 
GeneralIPictureDisp with copy constructor Pin
21-Apr-02 1:27
suss21-Apr-02 1:27 
GeneralRe: IPictureDisp with copy constructor Pin
Vi223-Apr-02 21:25
Vi223-Apr-02 21:25 
GeneralRe: IPictureDisp with copy constructor Pin
26-Apr-02 0:25
suss26-Apr-02 0:25 
GeneralRe: IPictureDisp with copy constructor Pin
Vi226-Apr-02 23:45
Vi226-Apr-02 23:45 
GeneralRe: IPictureDisp with copy constructor Pin
27-Apr-02 1:59
suss27-Apr-02 1:59 
GeneralRe: IPictureDisp with copy constructor Pin
Vi227-Apr-02 4:11
Vi227-Apr-02 4:11 
Well. I have a look at your files.
PICTUREDISP(IPictureDisp* lpDisp)
{
    if (this != NULL)
        this->Release();

    if ((lpDisp != NULL) &&
        SUCCEEDED(lpDisp->QueryInterface(IID_IPictureDisp, (LPVOID*)this)))
    {
        ASSERT(this != NULL);
    }
}
ULONG STDMETHODCALLTYPE PICTUREDISP::Release()
{
    return this->Release();
}

Why have you decide to call the Release() in the constructor? You must get the endless loop, IMHO.
virtual ~PICTUREDISP();

You should not use the virtual destructor. Your vtable will not correspond to the vtable of a class PICTUREDISP during a destructor call (QueryInterface will replace this vtable).
To avoid the AddRef/Release problem you must also realize the operator of copying with your technique.
PICTUREDISP& operator=(const PICTUREDISP& src)
{
    ...
}

In summary I would like to tell you that your technique is very doubtful and is fraught with mistakes. Though it may have the right on life. Be attentive! And often use Debug Session!


With best wishes,
Vita
GeneralRe: IPictureDisp with copy constructor Pin
27-Apr-02 5:48
suss27-Apr-02 5:48 
QuestionHow to use an activex when user does not have an administrator account ? Pin
Jean-Michel LE FOL19-Apr-02 23:17
Jean-Michel LE FOL19-Apr-02 23:17 
GeneralLinker Error Pin
Madmaximus19-Apr-02 4:20
Madmaximus19-Apr-02 4:20 
GeneralRe: Linker Error Pin
Tim Smith19-Apr-02 4:25
Tim Smith19-Apr-02 4:25 
GeneralCComPtr Pin
19-Apr-02 2:57
suss19-Apr-02 2:57 
GeneralRe: CComPtr Pin
Tim Smith19-Apr-02 3:34
Tim Smith19-Apr-02 3:34 
QuestionReturning values from COM object ?? Pin
19-Apr-02 1:37
suss19-Apr-02 1:37 
AnswerRe: Returning values from COM object ?? Pin
Paul M Watt21-Apr-02 9:39
mentorPaul M Watt21-Apr-02 9:39 
GeneralRe: Returning values from COM object ?? Pin
21-Apr-02 11:48
suss21-Apr-02 11:48 
QuestionHow to implement a thread in a service? Pin
Bhikshapathi Gorantla18-Apr-02 21:42
Bhikshapathi Gorantla18-Apr-02 21:42 
QuestionHow to digital certificate Pin
liuage18-Apr-02 16:06
liuage18-Apr-02 16:06 
AnswerRe: How to digital certificate Pin
Todd Smith18-Apr-02 16:09
Todd Smith18-Apr-02 16:09 
GeneralIs there a class just as MFC's CTime in ATL/WTL Pin
18-Apr-02 15:50
suss18-Apr-02 15:50 
GeneralA Question of Using the Standard C++ to Programme Connectable Object in VC6.0 Pin
zjkw18-Apr-02 15:49
zjkw18-Apr-02 15:49 
GeneralRe: A Question of Using the Standard C++ to Programme Connectable Object in VC6.0 Pin
zjkw23-Apr-02 2:37
zjkw23-Apr-02 2:37 
GeneralActivex/VisualC++ Pin
Dr Anandhi18-Apr-02 0:40
Dr Anandhi18-Apr-02 0:40 
Generala question about WTL Pin
xsword17-Apr-02 21:48
xsword17-Apr-02 21:48 

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.