🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
2 messages
2 total messages Started by Avinash Meetoo Thu, 08 Jul 1999 00:00
Calling a method in an application server
#1629
Author: Avinash Meetoo
Date: Thu, 08 Jul 1999 00:00
22 lines
1075 bytes
Hi,

I am trying to call a method found in an application server. According to
the documentation, this will do:

IMyAppServerDisp TempInterface(LPDISPATCH(MyConnection->AppServer));
TempInterface->SpecialMethod(x,y);

This does not compile!

I've changed it to:

IMyAppServerDisp TempInterface((IMyAppServer
*)LPDISPATCH(MyConnection->AppServer));
TempInterface->SpecialMethod(x,y);

And it compiles but throws a Priviledge violation exception when executed.
What am I doing wrong?

Thanks.

PS: Reply to ame@dcdmc.intnet.mu please
Re: Calling a method in an application server
#1630
Author: Steve Pietrykoski
Date: Thu, 08 Jul 1999 00:00
25 lines
1454 bytes
Avinash,

I found out through tech support that the documentation on this is
incorrect and was given the proper technique, which I have turned into a
macro:

#define APPSERVER_INTERFACE( CONNECTION, SERVERNAME, VAR ) \
  IDispatch * VAR##Disp = (IDispatch *)(CONNECTION->AppServer); \
  I##SERVERNAME * VAR##Intf = reinterpret_cast<I##SERVERNAME
*>(VAR##Disp); \
  I##SERVERNAME##Disp VAR( VAR##Intf );

In the context of the documentation example, you would instead declare

APPSERVER_INTERFACE( MyConnection, MyAppServer, TempInterface );

Happy Coding,
Steve Pietrykoski

Avinash Meetoo wrote:
> I am trying to call a method found in an application server. According to
> the documentation, this will do:
> 
> IMyAppServerDisp TempInterface(LPDISPATCH(MyConnection->AppServer));
> TempInterface->SpecialMethod(x,y);
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads