COM Objects + ASP

Results 1 to 3 of 3

Thread: COM Objects + ASP

  1. #1
    skinny Guest

    Default COM Objects + ASP

    I&#039ve got a version simple version of a problem I&#039m having.<BR>I have a COM object with a function that has an in/out parameter.<BR>I&#039m returning data in this parameter from the COM object. Every<BR>time I use it from ASP, I get a type mismatch.<BR><BR>Here&#039s my VB Code:<BR> set TestObject = Server.CreateObject("testAspParam.testAspParam")<B R> x = cint(2) <BR> TestObject.Square x &#060;- this is the problem line<BR> Response.Write x<BR><BR>Here&#039s my MIDL for the COM object:<BR>[<BR> uuid(64661E7E-E336-4BDB-911A-F9A2A8DB33A7),<BR> version(1.0),<BR> helpstring("Project1 Library")<BR>]<BR>library testAspParam<BR>{<BR><BR> importlib("stdole2.tlb");<BR> importlib("STDVCL40.DLL");<BR><BR> [<BR> uuid(E9CA96D7-7347-4635-A587-A6BEFF0852DD),<BR> version(1.0),<BR> helpstring("Dispatch interface for TestAspParam Object"),<BR> dual,<BR> oleautomation<BR> ]<BR> interface ITestAspParam: IDispatch<BR> {<BR> [id(0x00000001)]<BR> HRESULT _stdcall Square([in, out] long * Param1 );<BR> };<BR><BR> [<BR> uuid(FDD2BE46-184F-4444-9FA7-58EE5CDB5D1A),<BR> version(1.0),<BR> helpstring("TestAspParam Object")<BR> ]<BR> coclass testAspParam<BR> {<BR> [default] interface ITestAspParam;<BR> };<BR>};<BR><BR>

  2. #2
    Vijai Guest

    Default RE: COM Objects + ASP

    set TestObject = Server.CreateObject("testAspParam.testAspParam")<B R>x = CLng(2) <BR>TestObject.Square x &#060;- this is the problem line<BR>Response.Write x<BR><BR>Make the cInt as CLng, it should work.<BR><BR>Vijai

  3. #3
    skinny Guest

    Default RE: COM Objects + ASP

    Thanks for the suggestion! However, it didn&#039t change<BR>the behavior at all. I&#039m still getting a type mismatch<BR>from the asp engine.<BR><BR>I&#039m pretty sure the problem lies in the in/out definition<BR>of the integer paramter in square. Any other ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts