Click here to Skip to main content
15,908,111 members
Home / Discussions / COM
   

COM

 
QuestionDistinguish IObjectWithSite instance in IOleCommandTarget.Exec? Pin
song88824-Aug-05 23:51
song88824-Aug-05 23:51 
GeneralExchange 2000 - Event Sink receives EVT_SYNC_COMMITTED twice (!!!) Pin
Michael B. Hansen24-Aug-05 23:12
Michael B. Hansen24-Aug-05 23:12 
Generalwhen should i implement interface IExternalConnection Pin
HeartFriend24-Aug-05 19:59
HeartFriend24-Aug-05 19:59 
Generalcomponent registration Pin
Maddie from Dartford24-Aug-05 3:05
Maddie from Dartford24-Aug-05 3:05 
GeneralRe: component registration Pin
User 21559724-Aug-05 17:28
User 21559724-Aug-05 17:28 
GeneralActiveX and OLE server - destroyed! Pin
john john mackey23-Aug-05 8:52
john john mackey23-Aug-05 8:52 
Generaldirectshow avi source filter Pin
villalvilla22-Aug-05 20:22
villalvilla22-Aug-05 20:22 
GeneralAddRef() Error Pin
Logan from Singapore22-Aug-05 18:15
Logan from Singapore22-Aug-05 18:15 
Hi,

I have the following code in my DLL.

InnerClass* pInnerClass;

CComObject<cinnerclass>* pInnerC;

HRESULT hr = CComObject<cinnerclass>::CreateInstance(&pInnerC);
hr = pMyC->QueryInterface(IID_IInnerClass, reinterpret_cast
<<void**>>(&pInnerClass));


STDMETHODIMP CMyClass::get_InnerClass(IInnerClass **pVal)
{
if (pVal == NULL)
return E_POINTER;

*pVal = pInnerClass;
(*pVal)->AddRef();
return S_OK;
}

I have no problem with the code when I compile my code without Unicode, i.e. I have not problem running my DLL. But when I compile in Unicode mode, I always get the error:

Unhandled exception in Demo.exe(MyClass.DLL): 0xC0000005: Access Violation

After my debug, it seems that the line (*pVal)->AddRef(); is giving me the problem. But if the line is removed, I will have the same problem in all mode of compiling.

Please help me..Cry | :((
GeneralRe: AddRef() Error Pin
User 21559724-Aug-05 17:24
User 21559724-Aug-05 17:24 
GeneralCopy and pest Pin
dubotz22-Aug-05 3:42
dubotz22-Aug-05 3:42 
GeneralRe: Copy and pest Pin
MohammadAmiry30-Aug-05 9:33
MohammadAmiry30-Aug-05 9:33 
GeneralRe: Copy and pest Pin
dubotz30-Aug-05 22:35
dubotz30-Aug-05 22:35 
GeneralRe: Copy and pest Pin
dubotz31-Aug-05 0:16
dubotz31-Aug-05 0:16 
GeneralRe: Copy and pest Pin
MohammadAmiry2-Sep-05 7:36
MohammadAmiry2-Sep-05 7:36 
GeneralRe: Copy and pest Pin
Anonymous19-Oct-05 20:40
Anonymous19-Oct-05 20:40 
GeneralWindows Management Instrumentation Pin
rajeevktripathi22-Aug-05 1:53
rajeevktripathi22-Aug-05 1:53 
GeneralRe: Windows Management Instrumentation Pin
MailtoGops22-Aug-05 5:57
MailtoGops22-Aug-05 5:57 
GeneralRe: Windows Management Instrumentation Pin
MailtoGops22-Aug-05 5:57
MailtoGops22-Aug-05 5:57 
GeneralEx2K : Event Sink Registration - Access Denied Pin
Michael B. Hansen22-Aug-05 0:28
Michael B. Hansen22-Aug-05 0:28 
GeneralLoad printers using COM+ from user profile Pin
Member 77854319-Aug-05 11:01
Member 77854319-Aug-05 11:01 
GeneralDifference in the compiling modes Pin
Logan from Singapore18-Aug-05 17:55
Logan from Singapore18-Aug-05 17:55 
GeneralRe: Difference in the compiling modes Pin
Steve S22-Aug-05 1:01
Steve S22-Aug-05 1:01 
GeneralRe: Difference in the compiling modes Pin
Logan from Singapore22-Aug-05 15:41
Logan from Singapore22-Aug-05 15:41 
GeneralMarshalling problem Pin
David_Leikis18-Aug-05 11:31
David_Leikis18-Aug-05 11:31 
GeneralRe: Marshalling problem Pin
Vi218-Aug-05 19:54
Vi218-Aug-05 19:54 

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.