🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
5 messages
5 total messages Started by Alejandro Guzm�n Thu, 17 May 2001 21:20
Calling Sever Interfaces
#626
Author: Alejandro Guzm�n
Date: Thu, 17 May 2001 21:20
26 lines
1850 bytes
Hi,

I have a application server that have a Remote Data Module with some method
and  Application Client (both made in C++ Builder 5).
I register this application server in a NT server.So, i try to connect the
client with the server and implement the method that i create.
I see in the Developer�s Guide of C++ Builder 5 how can i calling a server
interface:

       IDispatch* disp = (IDispatch*)(DCOMConnection1->AppServer)
       IMyAppServerDisp TempInterface( (IMyAppServer*)disp);
       TempInterface.SpecialMethod(x,y);

MyAppServer : Name of the remote data module in the application server.


But when i try to run the application, the compiler show me the following
error on the second line:
    " Declaration syntax Error "

Please some body Know what wrong ?????? , any idea, suggestions, or please
tell me how can i do to calling server interfaces and implement method.


Thanks much
Alejandro Guzm�n
Re: Calling Sever Interfaces
#630
Author: Mark Cashman
Date: Tue, 22 May 2001 01:41
13 lines
1342 bytes
Hi, Alejandro!

You are missing a ";" on the first line you show, which is causing your
syntax error message.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------
RE: Calling Sever Interfaces
#632
Author: Alejandro Guzm�n
Date: Tue, 22 May 2001 13:24
51 lines
2315 bytes
thank's Mark, i have this error (missing a ";"), and other problem (i don't
include  the TLB file on the client).
#include <vcl.h>
#pragma hdrstop

#include "U_Cliente.h"
---->   #include "P_M_TLB.h"  <----------

#pragma package(smart_init)
#pragma resource "*.dfm"

well, now i have a new situation, when i try to call any method of my server
applicacion,

  int Resultado;

  IDispatch* disp = (IDispatch*) (DCOMConnection1->AppServer);
  IMDisp TempInterface( (IM*)disp);
  TempInterface->Maximo(&Resultado);

  Edit2->Text = IntToStr(Resultado);

 my client applicaction show me the following message box

_ASSERTE:
"m_Dispatch != 0 @
D:\\LENGUAJES\\BORLAND\\CBUILDER5\\INCLUDE\\VCL\\utilcls.h/3798\nPress [Y]es
to terminate, [N]o to continue and [C]ancel to Debug\

any idea, suggestions ?????.

Thanks much
Alejandro Guzm�n

Mark Cashman <mcashman@temporaldoorway.com> escribi� en el mensaje de
noticias 3B09C3DD.F61D034B@temporaldoorway.com...
> Hi, Alejandro!
>
> You are missing a ";" on the first line you show, which is causing your
> syntax error message.
>
> ------
> Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
> http://www.temporaldoorway.com
> - Original digital art, writing, music and more -
> C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
> (Join us!)
> http://www.temporaldoorway.com/programming/index.htm
> ------
>
>
Re: Calling Sever Interfaces
#633
Author: Mark Cashman
Date: Wed, 23 May 2001 00:35
21 lines
1727 bytes
This is just a guess, because I haven't kept up with the ActiveX
implementation (ask the guys in borland.public.cppbuilder.activex for
more info) but you might want to try changing

TempInterface->Maximo(&Resultado);

to

TempInterface.Maximo(&Resultado);

If not that, consider not putting & on the Resultado parameter. Not
knowing the type of this argument, I don't know if the & is appropriate.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------
Re: Calling Sever Interfaces
#637
Author: John Graham
Date: Fri, 25 May 2001 14:55
63 lines
3088 bytes
Gents,

This is an error in the help screen where this example is displayed - there
is no ";" at the end of the line.  I have tried this code to create a
temporary interface with no success.

My nTier client app. uses the Bind() method of the TAutoDriver class this
way:

  SMSrvrDisp = new ISysManSrvrRDMDisp();

  SMSrvrDisp->Bind(WideString(SysManScktConnect->ServerName));

  if ( !SMSrvrDisp->IsBound() )
   {
     Application->MessageBox("Can't Bind Dispatch Interface - Aborting!",
"Rats!", MB_ICONEXCLAMATION);

   Application->Terminate();
  }

This works fine when I run the client and app. server under Windows 2000 on
the same machine.  However, when I try to
run the client app. on an NT machine I get the "Can't Bind Dispatch
Interface - Aborting!" error.

If I comment the error trap out, the client application runs fine on the NT
machine and the application server runs ok on the 2000 machine as long as I
don't try to call any app. server methods.  This leads me to believe
something is wrong with the way I'm trying to bind the interface.

Conversely, if I use:

  SMSrvrDisp->Bind(LPDISPATCH(SysManScktConnect->AppServer));

It errors when both client and server are running on the 2000 machine as
well.  The above line is what I use for the same application developed with
BCB4 on an NT machine.

The version of this app developed with BCB4 under NT allows the client to
run under any Windows OS ( 95 and above ) with the app. server running on
any of our NT servers.

What am I missing?

Regards,
John

Mark Cashman wrote:

> Hi, Alejandro!
>
> You are missing a ";" on the first line you show, which is causing your
> syntax error message.
>
> ------
> Mark Cashman (TeamB - C++ Builder), creator of The Temporal Doorway at
> http://www.temporaldoorway.com
> - Original digital art, writing, music and more -
> C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
> (Join us!)
> http://www.temporaldoorway.com/programming/index.htm
> ------
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