Click here to Skip to main content
16,005,121 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Encrypting and decrypting objects Pin
Michael Dunn9-Aug-03 7:49
sitebuilderMichael Dunn9-Aug-03 7:49 
QuestionDocking toolbars / windows without mfc? Pin
gri9-Aug-03 5:05
gri9-Aug-03 5:05 
Generalvideo stream Pin
mr pier9-Aug-03 3:34
mr pier9-Aug-03 3:34 
Generaltrouble in ATL Pin
novachen9-Aug-03 3:07
novachen9-Aug-03 3:07 
GeneralRe: trouble in ATL Pin
Michael Dunn9-Aug-03 6:31
sitebuilderMichael Dunn9-Aug-03 6:31 
GeneralRe: trouble in ATL Pin
novachen9-Aug-03 17:07
novachen9-Aug-03 17:07 
GeneralRe: trouble in ATL Pin
Michael Dunn9-Aug-03 17:22
sitebuilderMichael Dunn9-Aug-03 17:22 
GeneralRe: trouble in ATL Pin
novachen9-Aug-03 22:33
novachen9-Aug-03 22:33 
Thanks! I wanna ask for a little more.
In Apple i try to hide a struct. It is not on the interface to the client. But the other class in the COM know it is there, and can access it.

in apple.h
struct Image
{
int num;
};
// CApple

class ATL_NO_VTABLE CApple :
public CComObjectRootEx<ccomsinglethreadmodel>,
public CComCoClass<capple, &clsid_apple="">,
public IDispatchImpl<iapple, &iid_iapple,="" &libid_fruitlib,="" *wmajor="*/" 1,="" *wminor="*/" 0="">
{
public:
Image img;

CApple()
{
}

The banana add a method
interface IBanana : IDispatch{
[id(1), helpstring("GetApple")] HRESULT GetApple([out,retval] IApple** apple);
[id(2), helpstring("QueryApple")] HRESULT QueryApple([in] IApple* apple, [out,retval] int * ret);
};

And in banana.cpp i try
STDMETHODIMP CBanana::GetApple(IApple** apple)
{
CApple* p = new CComObject<capple>();
p->img.num = 100;
*apple = p;
return S_OK;
}

STDMETHODIMP CBanana::QueryApple(IApple* apple, int* ret)
{
CApple* p = dynamic_cast<capple*>(apple);
*ret = p->img.num;
return S_OK;
}

But when i use this dll in c#, it always get a System.ExecutionEngineException.
the script is
FruitLib.Banana banana = new FruitLib.BananaClass();
FruitLib.Apple apple = banana.GetApple();
int n = banana.QueryApple(apple);

Any idea then?
Thanks!
GeneralProblem in RiechEdit..!! Pin
boonshajayan9-Aug-03 1:37
boonshajayan9-Aug-03 1:37 
QuestionHow to delete my temporary file? Pin
HansonDavid9-Aug-03 1:00
HansonDavid9-Aug-03 1:00 
AnswerRe: How to delete my temporary file? Pin
HansonDavid9-Aug-03 1:16
HansonDavid9-Aug-03 1:16 
GeneralRe: How to delete my temporary file? Pin
igor196011-Aug-03 19:24
igor196011-Aug-03 19:24 
AnswerRe: How to delete my temporary file? Pin
boonshajayan9-Aug-03 1:32
boonshajayan9-Aug-03 1:32 
AnswerRe: How to delete my temporary file? Pin
PJ Arends9-Aug-03 5:38
professionalPJ Arends9-Aug-03 5:38 
GeneralRe: How to delete my temporary file? Pin
HansonDavid10-Aug-03 0:32
HansonDavid10-Aug-03 0:32 
QuestionWhat is different from DLL, Static Lib, Dynamic Lib Pin
HansonDavid9-Aug-03 0:49
HansonDavid9-Aug-03 0:49 
AnswerRe: What is different from DLL, Static Lib, Dynamic Lib Pin
valikac9-Aug-03 4:23
valikac9-Aug-03 4:23 
GeneralRe: What is different from DLL, Static Lib, Dynamic Lib Pin
HansonDavid10-Aug-03 0:28
HansonDavid10-Aug-03 0:28 
GeneralRe: What is different from DLL, Static Lib, Dynamic Lib Pin
valikac10-Aug-03 6:25
valikac10-Aug-03 6:25 
GeneralRe: What is different from DLL, Static Lib, Dynamic Lib Pin
HansonDavid10-Aug-03 18:24
HansonDavid10-Aug-03 18:24 
GeneralHandling Events Pin
cberam9-Aug-03 0:17
cberam9-Aug-03 0:17 
GeneralRe: Handling Events Pin
Giles9-Aug-03 1:23
Giles9-Aug-03 1:23 
GeneralRe: Handling Events Pin
cberam11-Aug-03 2:00
cberam11-Aug-03 2:00 
GeneralCreate Process + WaitForSingleObject hangs Pin
Member 4048138-Aug-03 23:59
Member 4048138-Aug-03 23:59 
GeneralRe: Create Process + WaitForSingleObject hangs Pin
valikac9-Aug-03 4:29
valikac9-Aug-03 4:29 

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.