Re: how to add pointer to struct as a parameter in the automation VC
From: David (not_at_here.com)
Date: 03/05/04
- Next message: dw85745: "Find in Files"
- Previous message: David: "Re: Visual C++ .NET"
- In reply to: Grace: "Re: how to add pointer to struct as a parameter in the automation VC"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 5 Mar 2004 11:06:44 +0000 (UTC)
As far as your question regarding making the vbariables global, no you
shouldn't need to (well, depending on how you implement the interface :) ).
I'll try to get time to post a sample today or at the weekend.
David
Grace" <anonymous@discussions.microsoft.com> wrote in message
news:5430EFC6-1534-4173-B81B-FB0537BC33E2@microsoft.com...
> Thanks David,
>
> I'm a new user of VC and not quite familiar with the odl. I add typedef
struct as follow:
>
> [ uuid(891E5A48-D21F-48AB-8721-0821677ADB7B), version(1.0),
> helpfile("ABC.hlp"),
> helpstring("ABC ActiveX Control module"),
> control ]
> library ABCLib
> {
> importlib(STDOLE_TLB);
> importlib(STDTYPE_TLB);
>
> file://added these 2 structures
> typedef struct ABC_SENDDATA_T {
> FILETIME ft;
> WORD wType;
> DWORD dwTransaction_id;
> int iAmount;
> } ABC_SENDDATA, *LPABC_SENDDATA;
>
> typedef struct ABC_RECEIVE_T {
> WORD wReturnType;
> char cVersion[10];
> WORD wType;
> char cCardName[20];
> int dBalPrepaid;
> int dAmount;
> DWORD dwTransaction_id;
> } ABC_RECEIVE, *LPABC_RECEIVE;
>
> // Primary dispatch interface for CIBonusCtrl
>
> But it didn't compile and ask for id, however, how could I use the above
structure as the parameter of a method of automation?
> Actually, I want to create a method in ocx, like Method(ABC_SENDDATA *p,
ABC_RECEIVE *r)
> If as you said, create an interface to put the variables of the struct as
the properties, say, dllexport a number of function and these functions are
only store the values of the variables, Do I need to set the variables as
Global so that it's value won't loss after the client call to set the value?
> like ABC->ft = Now ; ABC->wType = 1; ABC->dwTransaction_id = 1;
ABC->iAmount = 1; file://ABC is a ocx component.
> Where ft, wType, dwTransaction_id and iAmount are all global variables in
the dll.
> But I think once the client call, ABC->ft = Now, the dll is quit and
finished, so the "Now" wouldn't be stored in the "ft" variables after this
call.
>
> Sorry, I know the above is a bit messy but I'm quite confused about the
using of pointer to structure in the automation. It'll be great to see any
sample coding or reference.
>
> Best regards,
> Grace
- Next message: dw85745: "Find in Files"
- Previous message: David: "Re: Visual C++ .NET"
- In reply to: Grace: "Re: how to add pointer to struct as a parameter in the automation VC"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|