Webservice Registering dll

Asked

Viewed 285 times

18

I have the following code:

CoInitialize(nil);
  try
    DM_Principal.pLarWS := CreateComObject(LarWS_TLB.CLASS_WS) as IWS;
  except
    WinExec( 'regasm LarWS.dll /tlb:LarWS.tlb',SW_HIDE);
    Screen.Cursor := crHourGlass;
    Sleep(3000);
    Screen.Cursor := crDefault;
    DM_Principal.pLarWS := CreateComObject(LarWS_TLB.CLASS_WS) as IWS;
  end;

DM_Principal:
  private
    larWS: IWS;
  public
    property pLarWS: IWS read larWS write larWS;

When running without internet the system loops into routine:

DM_Principal.pLarWS := CreateComObject(LarWS_TLB.CLASS_WS) as IWS;

Unable to register, if I try to change the code to register in REGASM also enter infinite loop.

Follow the link of the file LARWS_TLB.pas Filing cabinet.

  • 2

    But how did you set up the connection to the database? it is on the same machine?

  • 3

    Yes it is on the same machine. But the bank interferes with something?

  • 3

    It seems to me some kind of permission error, some resource that the credential used doesn’t have privilege or some way that it can’t access. Not to mention the description of the mistake itself.

  • 1

    @Leandroangelo but when running with internet/webservice works, the problem is when there is no internet or Webservice is offline.

  • 2

    What is this LarWS.dll where we can find this to simulate the problem?

1 answer

0


The Createcomobject(GUID: TGUID) function creates a new instance of a COM object. Before creating the instance, it needs to do the following:

  • Load the . dll that contains the class that implements the interface identified by this GUID (I will call classeGuid). In this case Larws.dll.
  • Create an instance of the factory class of the classeGuid (class responsible for manufacturing objects of the classeGuid).
  • Request the factory to create a new instance of the Uid class.

During this process, a bit of Larws.dll code is executed. If this code is trying to access something on the internet or on the local network, when there is no internet/network it will run until it reaches the response time limit (timeout). Giving the impression that the program has jammed.

If you have the code for this Larws.dll, you need to open it and see if there is any connection being opened, during dll startup, from the factory class, or in the classeGuid constructor.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.