Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ActiveX Control Event Problem

10 views
Skip to first unread message

Hantarex

unread,
Jun 22, 2009, 11:59:01 AM6/22/09
to

have created a control ocx with Visual Studio 2008.
In VB, Excel etc. it works,
but if the I use a C++, I don't succeed in correctly caring it.

This is the interface idl that I have created:

#include <olectl.h>
#include <idispids.h>

[ uuid(66C96E38-E40C-4F16-9371-A9D60601B7CB), version(1.0),
helpfile("OcxTest.hlp"),
helpstring("Modulo del controllo ActiveX OcxTest"),
control ]
library OcxTestLib
{
importlib(STDOLE_TLB);

typedef
[uuid(F39AA355-32F4-450b-B004-2AE3C1D09A24), version(1.0),
helpstring("Book Struct received by Event")]
struct BOOK{
[helpstring("Number of buying PDN")] LONG nPdnBuy;
[helpstring("Bid Quantity")] DOUBLE BidQty;
[helpstring("Bid Price")] DOUBLE Bid;
[helpstring("Ask Price")] DOUBLE Ask;
[helpstring("Ask Quantity")] DOUBLE AskQty;
[helpstring("Number of selling PDN")] LONG nPdnSell;
}BOOK;

// Interfaccia dispatch per COcxTestCtrl

[ uuid(785EBC41-D792-467D-B7BC-C97B7B8A6975),
helpstring("Interfaccia dispatch per OcxTest Control")]
dispinterface _DOcxTest
{
properties:
// [id(1), helpstring("Book Structure received by Event")] BOOK pBook;
methods:

[id(DISPID_ABOUTBOX)] void AboutBox();
[id(2), helpstring("metodo TestString")] void TestString(BSTR string);
};

// Interfaccia dispatch di eventi per COcxTestCtrl

[ uuid(4B3409A4-3336-45A1-B162-F72514FD320C),
helpstring("Interfaccia eventi per OcxTest Control") ]
dispinterface _DOcxTestEvents
{
properties:
methods:
[id(1)] void StringEvent(BSTR Stringg);
[id(2)] void TestBook(SAFEARRAY(BOOK) *pBook);
};

// Informazioni sulla classe per COcxTestCtrl

[ uuid(6A11A235-0187-4710-8503-DD7548F18A57),
helpstring("OcxTest Control"), control ]
coclass OcxTest
{
[default] dispinterface _DOcxTest;
[default, source] dispinterface _DOcxTestEvents;
};

};

Particularly I don't succeed to see the structure BOOK and of the two
events, I see only the first one (void StringEvent(BSTR StringTest);)
Can you help to understand me what I am wrong?

Naturally thanks!!

0 new messages