Click here to Skip to main content
15,906,567 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Read one struct,write to another struct. Pin
chandu00418-May-08 19:49
chandu00418-May-08 19:49 
AnswerRe: Read one struct,write to another struct. Pin
Rajkumar R18-May-08 21:08
Rajkumar R18-May-08 21:08 
Question[RESOLVED]Creating Toolbar [modified] Pin
Priya_Sundar18-May-08 18:58
Priya_Sundar18-May-08 18:58 
AnswerRe: Creating Toolbar Pin
ShilpiP18-May-08 19:53
ShilpiP18-May-08 19:53 
AnswerRe: Creating Toolbar Pin
Rajkumar R18-May-08 20:53
Rajkumar R18-May-08 20:53 
General[RESOLVED]: Thanks Pin
Priya_Sundar19-May-08 0:57
Priya_Sundar19-May-08 0:57 
QuestionHow to return COM object? Pin
RYU^^18-May-08 18:13
RYU^^18-May-08 18:13 
AnswerRe: How to return COM object? Pin
RYU^^18-May-08 20:15
RYU^^18-May-08 20:15 
I found the problem. Apparently I am trying to be really smart about this by creating only 1 Factory and put a check in CreateInstance() to determine whether it is AddClass or MainTestClass.

I was wrong because the IID check should be in DllGetClassObject().

I have created 2 different factories for these classes and it works fine. I can now return the AddClass by using GetAddObject() function.

However, when I tried to use the function in AddClass (eg. SetFirstNumber()), it gave me this error:
The runtime has encountered a fatal error. The address of the error was at 0x7f628678, on thread 0x105c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.


Here is my code:
HRESULT __stdcall CMainTestClass::GetSamTest(IAdd **ppRetVal)
{
    CAddClass *pAddClass = new CAddClass();
    *ppRetVal = pAddClass;
    return S_OK;
}


Thanks again for any help Smile | :)
Questioninteger value in editbox Pin
Mohanraj D18-May-08 18:12
Mohanraj D18-May-08 18:12 
AnswerRe: integer value in editbox Pin
Hamid_RT18-May-08 18:17
Hamid_RT18-May-08 18:17 
GeneralRe: integer value in editbox Pin
Mohanraj D18-May-08 19:07
Mohanraj D18-May-08 19:07 
GeneralRe: integer value in editbox Pin
Hamid_RT18-May-08 19:17
Hamid_RT18-May-08 19:17 
GeneralRe: integer value in editbox Pin
Mohanraj D18-May-08 19:31
Mohanraj D18-May-08 19:31 
AnswerRe: integer value in editbox Pin
Paresh Chitte18-May-08 19:07
Paresh Chitte18-May-08 19:07 
GeneralRe: integer value in editbox Pin
Mohanraj D18-May-08 19:27
Mohanraj D18-May-08 19:27 
GeneralRe: integer value in editbox Pin
Paresh Chitte18-May-08 19:54
Paresh Chitte18-May-08 19:54 
GeneralRe: integer value in editbox Pin
Hamid_RT18-May-08 20:10
Hamid_RT18-May-08 20:10 
GeneralRe: integer value in editbox Pin
Hamid_RT18-May-08 20:34
Hamid_RT18-May-08 20:34 
GeneralRe: integer value in editbox Pin
Rajkumar R18-May-08 21:15
Rajkumar R18-May-08 21:15 
GeneralRe: integer value in editbox Pin
Cedric Moonen18-May-08 21:18
Cedric Moonen18-May-08 21:18 
JokeRe: integer value in editbox Pin
Rajesh R Subramanian18-May-08 21:37
professionalRajesh R Subramanian18-May-08 21:37 
GeneralRe: integer value in editbox Pin
CPallini18-May-08 22:09
mveCPallini18-May-08 22:09 
GeneralRe: integer value in editbox Pin
David Crow19-May-08 4:34
David Crow19-May-08 4:34 
GeneralRe: integer value in editbox Pin
David Crow19-May-08 4:35
David Crow19-May-08 4:35 
Questioncan anyone give me a solution Pin
shohel89918-May-08 16:01
shohel89918-May-08 16:01 

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.