Re: Client C# ----- Interface ATL ------ Server C++,MFC
I suggest you lose the attributes in your ATL project.
Then there's an ATL Wizard to create a proxy class
for firing your events. You can also check a box when
you create your ATL class so the event mechanism
is created for you from the start.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Melanie Zubel" <XXXX_a_XXXXX@discussions.microsoft.com> wrote in message
news:eYK4bRnZHHA.4420@TK2MSFTNGP02.phx.gbl...
Hello everybody,
I have a big problem.
I should make following.
Client C# ----- Interface ATL ------ Server C++,MFC
odl? ---- idl ----- odl?
Is in the internet a good overview picture?
How can I make it?
- C# Visual Studio 2005?
- ATL interface without function, only interface!!! No function.
- MFC Server Visual Studio 2005, MFC
I want to call from Client C# a function to MFC
MFC gives me a event, like finish.
// IPhoneNumber
[
object,
uuid("E71BF6BA-7189-4E87-9ECF-8525F91A3ACD"),
dual, helpstring("IPhoneNumber-Schnittstelle"),
pointer_default(unique)
]
__interface IPhoneNumber : IDispatch
{
[id(1), helpstring("method ValidatePhoneNumber")] HRESULT
ValidatePhoneNumber([in] BSTR Number, [out] BYTE* pError, [out] BSTR*
pErrorString);
};
// CPhoneNumber
[
coclass,
threading("apartment"),
vi_progid("PhoneFormat.PhoneNumber"),
progid("PhoneFormat.PhoneNumber.1"),
version(1.0),
uuid("F79B5514-5A8A-4827-9A55-C94FD1A0B234"),
helpstring("PhoneNumber Class")
]
class ATL_NO_VTABLE CPhoneNumber :
public IPhoneNumber
{
public:
CPhoneNumber()
{
}
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
public:
STDMETHOD(ValidatePhoneNumber)(BSTR Number, BYTE* pError, BSTR*
pErrorString);
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How can I insert an Event? It is possible with the assistent.
----> Event BOOL Finish(); // Telefon number is ok