Results 1 to 7 of 7

Thread: Who's calling me???

  1. #1

    Thread Starter
    Hyperactive Member FATBOYPEE's Avatar
    Join Date
    May 2001
    Location
    Charleville (Ireland) Still. ANYONE GOT A JOB I CAN HAVE ? GIZA JOB. I CAN DO THAT....
    Posts
    463
    I would'nt say it's possible from the DLL side implicitly. Of course you could write functions which have a required variable informing the procedure which system it is being used by?

    ie

    Public Function GetMyData(iEnv as integer) as string

    select case iEnv

    Case 1 'ASP

    Case 2 'VB

    End Select

    End Function

    Suppose that was a bit of an obvious reply.....

    FBP

    Best Bar.....

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Elementary, Watson! Still, thanks for the suggestion. I actually want to make it automated, so that any other developer does not control what my DLL would assume to be the environment. My DLL should recognize it by itself.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3

    Thread Starter
    Hyperactive Member FATBOYPEE's Avatar
    Join Date
    May 2001
    Location
    Charleville (Ireland) Still. ANYONE GOT A JOB I CAN HAVE ? GIZA JOB. I CAN DO THAT....
    Posts
    463
    OK Holmes...

    You/someone has still gotta deploy this DLL somewhere yes ?

    I take it your DLL will be placed on a server that has IIS (or similar) running as well as being an App/File server, therefore, you won't know if a terrestrial App is using your DLL by reference or the IIS Server/ASP is using it ?

    if that's not what you mean then you're either gonna deploy terrestrially or Web in which case a regsetting in the deployment will suffice to identify in which environment it's being used.

    Even in the first scenario above a environment variable would suffice.

    FBP

    Best Bar.....

  4. #4
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    you could make it a property of the main class in your dll and have it be defaulted to what it's used most property is

  5. #5
    jim mcnamara
    Guest
    Don't want to rain on your parade - but you're trying to break the basic rules of COM.

    COM is a binary interface, working regardless of client source code. Telling the server what kind of code the client comes from automatically breaks all the rules. Plus it can't be done without setting property values or something else.

    No COM object I've ever heard of can support a IWhatLanguageAmI interface. COM is supposed to behave exactly the same whether it's a network/local connection to a client written in java, C, VB, or VBA. No interface could EVER worry about that. COM isn't meant to do that, nor will it do that.

    The other folks suggested a property. Good suggestions. Also the Registry will work just fine. YOu can also set enviornment variables. Lots of choices. Just not COM.

  6. #6
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Agreed. What if I have to include some licensing restrictions, whereby the shareware copy of my DLL pops up a messagebox after a certain interval when used in VB, and displays a specific message in HTML format when used in ASP?

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  7. #7
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    You can use the GetModuleFileName API function to get the path and the name of the file who has created the object
    VB Code:
    1. Private Declare Function GetModuleFileName _
    2.  Lib "kernel32" Alias "GetModuleFileNameA" ( _
    3.  ByVal hModule As Long, _
    4.  ByVal lpFileName As String, _
    5.  ByVal nSize As Long) As Long
    6.  
    7. Private Function GetOwnerFileName() As String
    8.     Dim sFile As String
    9.     Dim nLen As Long
    10.     Const MAX_PATH = 260 As Long
    11.  
    12.     sFile = Space$(MAX_PATH)
    13.     nLen = GetModuleFileName(0, sFile, MAX_PATH)
    14.     GetOwnerFileName = Left$(sFile, nLen)
    15. End Function

Posting Permissions

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



Click Here to Expand Forum to Full Width