|
-
Jan 29th, 2002, 09:32 AM
#1
Thread Starter
New Member
-
Jan 29th, 2002, 10:08 AM
#2
Bouncy Member
what kind of database are you trying to create?
Access?
SQL Server?
-
Jan 29th, 2002, 10:37 AM
#3
Bouncy Member
can you reply to this and paste your code in your reply and i'll take a look...
-
Jan 29th, 2002, 10:53 AM
#4
Thread Starter
New Member
code
I am sorry, there is not point in doing that I was hoping that you could have given me some idea from my question. Thanks for your time.
-
Jan 29th, 2002, 01:06 PM
#5
One of the classes has a method to create a mdb using dao and that is the cls that I would like to access but I cannot.
Why not?
Is apples a collection of apple?
Did you make these DLLs?
I guess I am not sure exactly what you are trying to accomplish or what the problem is (I can be slow sometimes).
-
Jan 30th, 2002, 05:01 AM
#6
Thread Starter
New Member
Thank you for responding E. Yes, I created the dlls. apple is to import/export exporting single apple
apples Provides the handling of mulitiple apples, primarily for the purposes of importing certain data.
-
Jan 30th, 2002, 11:15 AM
#7
I have a form and 2 dlls which the form is referencing. Is it possible for me to access 1 of the dlls via the other dll?
Yes you can add a reference to the other dll in the first dll and have it access it either internally or it could expose it through properties and such. You could also have it pass in an object from the 2nd dll and have the app use SET to set a reference to the same instance of any object from dll 2 that the app is using.
VB Code:
'exposed thru props
objFromDLL1.objFromDLL2.Prop=1
'or setting to the same as the app
'if an apple obj is created by the app and is called objApple
'then the other dll exposes a class of the same kind Apple as UseApple to make them contain the same object
Set Dll2.MyApple=objApple
'now DLL2.MyApple contains a reference to objApple from the app so the following would now be doing the same thing on the same obj
objApple.Name="Greeny"
'or
DLL2.MyApple.Name="Greeny"
Say dll one is called me and one of the cls in dll 2 is called apple and another apples. I want to access apple via apples. Is this possible? So when I click cmdRun on the form depending on what the user chooses will call either dll. The mdb will be created on-the-fly when its method is called.
If apples is a collection of apple then this is very easy. You would simply use the item property of the collection to access the objects contained therein.
VB Code:
'kinda like this
apples.item("mykey").PropertyOfAnAppleClass=1
Or you could just use an If/Then behind the commandbutton and use different objects that way.
-
Jan 30th, 2002, 11:39 AM
#8
Thread Starter
New Member
Thanks a mil. I will try this and see what happens.
-
Jan 31st, 2002, 03:21 AM
#9
Thread Starter
New Member
-
Jan 31st, 2002, 04:50 AM
#10
When will it all end?...Oh, in 2 hours!...Cheers.
Not sure if I read your question correctly as I am having a day which can only be described as a hedgehog playing in a liquidiser. 
In your 1st DLL you could have events, which when "fired" could be used to execute somesort of function/event in the 2nd DLL. ie
Inside 1st DLL
VB Code:
Public Event CreateDatabase()
Public Property SaveToTextFile(ByVal strFilename As String)
If Trim$(strFilename) = "" Then
Raiseevent CreateDatabase
Else
'Rest Of Code
End If
End Property
In your application
VB Code:
Private Sub Command1_Click()
1stDLL.SaveToTextFile = txtFilename.Text 'if = to "" then will fire event
End Sub
Private Sub 1stDLL_CreateDatabase()
Dim 2ndDLL As New DLL2
'Code to create database using 2ndDLL
Set 2ndDLL = Nothing
End Sub
can you see what I am getting at, or am I talkign a load of lorry drivers and jam?
-
Jan 31st, 2002, 11:27 AM
#11
Well it depends a lot on what Apple cls does compared to Apples are they almost the same?
Wokawidget's suggestion will work, you could also do it outside of your objects. Like in the SaveToFile sub
VB Code:
Public Sub SaveToFile(strFileName as string)
If trim$(strFileName)="" then
dim tmpObj as new Apple
tmpObj.SaveToTextFile strFileName
Else
dim tmpObj as New Apples
tmpObj.SaevToDB
End If
Or I will attach an example of using an object inside another object and as a collection.
-
Jan 31st, 2002, 12:57 PM
#12
Here is that example I said I'd give although it is VERY poor, considering I'm not sure what any of the functionality is in your project.
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
|