Calling a DLL from COM+ ActiveX DLL


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Calling a DLL from COM+ ActiveX DLL

  1. #1
    Bruce Casson Guest

    Calling a DLL from COM+ ActiveX DLL


    I know that this is probably something simple, but it is something that I
    haven't tried before.

    Here is the environment that I am using:

    I have an IIS application written in ASP pages, which accesses a VB6 ActiveX
    DLL running under Component services. The application works fine, but I
    need to Internationalize the application. I've written a second VB6 ActiveX
    DLL utilitizing a resource file, and this works well with the ASP pages.

    What I want to do is call the language DLL from the original DLL.

    I've used this code (and other variations):

    Private Declare Function getMSG Lib "MyLanguages.dll" _
    (ByVal thisMsgID As Long) As String

    Public Function getMSGT(ByRef thisMsgID As String, Optional thisReplace1
    As String = "-##-", Optional thisReplace2 As String = "-##-") As String
    Dim strMsg As String
    Dim tmpMsgID As Long
    strMsg = getMSG(thisMsgID)
    If thisReplace1 <> "-##-" Then
    strMsg = Replace(strMsg, "######", thisReplace1)
    End If
    If thisReplace2 <> "-##-" Then
    strMsg = Replace(strMsg, "@@@@@@", thisReplace2)
    End If
    getMSGT = strMsg
    End Function

    I've try several set-up but get an error with each method:

    1) the language DLL installed in COM+
    - error, DLL file not found

    2) I've removed the language DLL from Component services, and placed the
    DLL in WINNT\SYSTEM32
    - error, cannot find entry point.

    Has anyone done this?

    Thanks

    Bruce

  2. #2
    Eric Litwin Guest

    Re: Calling a DLL from COM+ ActiveX DLL


    If MyLanguages.dll is an ActiveX DLL, then you should not be
    declaring its getMsg function as if it were a standard dll.

    Follow these steps:
    1 Reference MyLanguages.dll (Project->References) from the dll
    that runs in COM+ services
    2. Create an instance of the Multiuse class that contains the "getMsg" function
    3. Call that function


    "Bruce Casson" <bcasson@wdkns.com> wrote:
    >
    >I know that this is probably something simple, but it is something that

    I
    >haven't tried before.
    >
    >Here is the environment that I am using:
    >
    >I have an IIS application written in ASP pages, which accesses a VB6 ActiveX
    >DLL running under Component services. The application works fine, but I
    >need to Internationalize the application. I've written a second VB6 ActiveX
    >DLL utilitizing a resource file, and this works well with the ASP pages.
    >
    >What I want to do is call the language DLL from the original DLL.
    >
    >I've used this code (and other variations):
    >
    >Private Declare Function getMSG Lib "MyLanguages.dll" _
    > (ByVal thisMsgID As Long) As String
    >
    >Public Function getMSGT(ByRef thisMsgID As String, Optional thisReplace1
    >As String = "-##-", Optional thisReplace2 As String = "-##-") As String
    > Dim strMsg As String
    > Dim tmpMsgID As Long
    > strMsg = getMSG(thisMsgID)
    > If thisReplace1 <> "-##-" Then
    > strMsg = Replace(strMsg, "######", thisReplace1)
    > End If
    > If thisReplace2 <> "-##-" Then
    > strMsg = Replace(strMsg, "@@@@@@", thisReplace2)
    > End If
    > getMSGT = strMsg
    >End Function
    >
    >I've try several set-up but get an error with each method:
    >
    >1) the language DLL installed in COM+
    > - error, DLL file not found
    >
    >2) I've removed the language DLL from Component services, and placed the
    >DLL in WINNT\SYSTEM32
    > - error, cannot find entry point.
    >
    >Has anyone done this?
    >
    >Thanks
    >
    >Bruce



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center