|
-
Oct 2nd, 2001, 05:57 AM
#1
Thread Starter
Hyperactive Member
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.....
-
Oct 2nd, 2001, 06:25 AM
#2
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.
.
-
Oct 2nd, 2001, 06:59 AM
#3
Thread Starter
Hyperactive Member
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.....
-
Oct 2nd, 2001, 08:47 AM
#4
Frenzied Member
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
-
Oct 2nd, 2001, 09:27 AM
#5
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.
-
Oct 2nd, 2001, 02:16 PM
#6
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?
.
-
Oct 10th, 2001, 09:18 AM
#7
You can use the GetModuleFileName API function to get the path and the name of the file who has created the object
VB Code:
Private Declare Function GetModuleFileName _
Lib "kernel32" Alias "GetModuleFileNameA" ( _
ByVal hModule As Long, _
ByVal lpFileName As String, _
ByVal nSize As Long) As Long
Private Function GetOwnerFileName() As String
Dim sFile As String
Dim nLen As Long
Const MAX_PATH = 260 As Long
sFile = Space$(MAX_PATH)
nLen = GetModuleFileName(0, sFile, MAX_PATH)
GetOwnerFileName = Left$(sFile, nLen)
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|