Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Delphi com object cant be seen in IIS

hi

I have written a delphi com object for a 3rd party (they use VB & .Net)
but say they cant see the methods or run it under IIS, can if run locally

I am probably doing something wrong and need advice. help.

Is there anything obvious I need to change.
interface
 
uses
  Windows, ActiveX, Classes, ComObj,
  Strand_LREG_TLB, StdVcl, Dialogs,
  Variants, LREG_Main, SysUtils;
 
type
  TStrand_LREG_FClass = class(TTypedComObject, IStrand_LREG_FClass)
  protected
    function ELREG_RegSearch(const strxml: WideString;
      var strResult: WideString): HResult; stdcall;
    {Declare IStrand_LREG_FClass methods here}
  end;
 
implementation
 
uses ComServ;
 
function TStrand_LREG_FClass.ELREG_RegSearch(const strxml: WideString;
  var strResult: WideString): HResult;
var
  TheForm: LREG_Main.TForm1;
begin
  result := 1;
   try
    TheForm := LREG_Main.TForm1.Create(nil);
    strResult := TheForm.GetElregUPRN(strxml);
    result := 0;
  except
    On E: Exception do
      ShowMessage(E.Message);
  end;
 end;
 
initialization
  TTypedComObjectFactory.Create(ComServer, TStrand_LREG_FClass, Class_Strand_LREG_FClass,
    ciMultiInstance, tmApartment);

Open in new window

0
junebrown
Asked:
junebrown
  • 7
  • 6
  • 3
1 Solution
 
ziolkoCommented:
what you mean by saying "they cant see the methods or run it under IIS"?

does this TheForm := LREG_Main.TForm1.Create(nil); mean that you create form??

creating any GUI under IIS is not a good idea since IIS is service. in order to use GUI with services you need:
1. set desktop interactive to true for service
2. user account used to start service must have appropriate permissions

ziolko.

0
 
junebrownAuthor Commented:
the 3rd party have come back with

not sure what is meant be desktop interactive, but the access permission are that of administrator so the hierarchically that should be sufficient
0
 
ziolkoCommented:
>>not sure what is meant be desktop interactive

go to computer management list all services and display properties there's checkbox "Desktop Interactive" which must be checked if service is about to use some GUI

>>but the access permission are that of administrator
IIS typicaly runs in IWAM_XXX or IUSR_XXX accounts does it mean you assigned administrative permissions to those accounts? or changed startup user to user with admin privs?

anyway displaying GUI in service esp. IIS is this really needed?

ziolko.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
junebrownAuthor Commented:
The GUI isnit used, we were trying to get around something else
all we want to do is call up the datamodule and get an address back.
0
 
ziolkoCommented:
gui is used in your sample but nevermind.

make sure COM library is registered and IIS is using apropriate CLSID to load lib and create objects

ziolko.
0
 
junebrownAuthor Commented:
I am told by this third party that my application isnt a com object as he see it, although it was created as I
Any clues.
0
 
ziolkoCommented:
how did you created your object?

make sure he called regsvr32 to register DLL you created

ziolko.
0
 
junebrownAuthor Commented:
It was created via

project : file->other->active x tab then new active x library.

then add a com object via file->other (active x tab) com obj.
0
 
ziolkoCommented:
that's strange everything seems ok.

i guess only way to find out what's wrong is to ask your 3rd party devs how they're trying to use your library

ziolko.
0
 
developmentguruPresidentCommented:
Did they register the COM object?  I am amazed how often that is overlooked...

RegSvr32 /i MyComObj.dll
0
 
developmentguruPresidentCommented:
(It should work without the /i)
0
 
ziolkoCommented:
i've already suggested it twice but no response..

ziolko.
0
 
junebrownAuthor Commented:
Sorry but i have been out. Yes they say it has been registered

the other company have come back with (as far as I can see the application I have developed is a com object, so hitting my head against a brick wall)

Nothing is ok; in the sense that its not doing what needs to be - that is being used in a web service on an IIS box.
That and the fact that the previous version of the srand_lreg.dll isn't a COM component.
We don't have a third party developer, we have an in-house  web application that calls the proposed web service with an xml Uprn number, expecting an xml output from strand. I'm assuming that the srand_lreg.dll is supposed to be a COM file, none of the previous version of this dll have been, the only time I have seen a COM file during this exercise is when you have supplied the LREG_COM which has no methods that accept anything like the parameters of the srand_lreg.dll.


0
 
junebrownAuthor Commented:
I am struggling with this as my colleague who wrote this has resigned, so can anybody assist
I am quite happy to send code through, if this helps resolve this quickly. Ignorance isnt bliss in this case (for me)
0
 
developmentguruPresidentCommented:
--I am told by this third party that my application isnt a com object as he see it, although it was
--created as I Any clues.

  If your 3rd party is using VB then they will try to import the type library of the COM object.  If he does not see it in his list of available COM objects then they have not registered it.

  I am using a COM object on IIS to control the printing of Rave reports to a PDF through a web request.  I know from that experience that what you are trying to do is possible.  As I recall I had one issue with getting my COM object to work and that was giving IIS the rights to access the area of the registry that looks up the GUID for the object itself.  Here is the important clip line from CodeGear support.

--Grant read access to HKEY_CLASSES_ROOT\CLSID to the NETWORK SERVICE user--

  This got my web page to be able to instantiate a com object.  To do that go to the key in the RegEdit program and use the Edit | Permissions menu.  Obviously this must be done on the IIS server and permissions must be granted for the correct user account.

Let me know if this works for your 3rd party.
0
 
junebrownAuthor Commented:
Your messages forced the 3rd party to go back and check, what they were using was Windows 2000 & IIS 5, they have upgraded to Window 2003 & IIS6 and it all started to work. it is good to have independant experts to fall back on, as everyone recognises EE.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now