473,471 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DLL During run time

56 New Member
Guys i need guidance,

I have an xml converter which uses dll to be referenced upon. For testing purposes.
Now, my question is, can i reference a dll file on vb 6.0 during runtime? So that when we try to convert to xml we don't have to stop the program -> recode -> ->start.

Thanks in advance.
May 7 '08 #1
19 1455
chuckzter
56 New Member
Set dllname = New SkillsManager

SkillsManager is the name of the DLL file.

How can i make a statement like this during runtime? I mean, how can i execute a statement like this where let's say i'd like to replace skillsmanager with another dll without having to recode again in design view. Given that all the DLLs are referenced.

Thanks.
May 7 '08 #2
chuckzter
56 New Member
UPDATE:

I search and tried to apply this:

a = "Set dllname = New SkillsManager"
Call ScriptControl1.ExecuteStatement(a)

But i'm getting an error saying, "Class not defined: SkillsManager"

Anybody who could help?
i would greatly appreciate it.
May 7 '08 #3
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

You can use Late Binding of the objects:

Expand|Select|Wrap|Line Numbers
  1. Dim MyObj as Object
  2. Set MyObj = CreateObject(“MyDLL.MyClass”)
  3. MyObj.Myprop = “XYZ Name”
  4. MyObj.MyMethod
  5.  
with above code, You can change MyDll.MyClass, to the Class in dll.
the problem here is, You wont get Intellisense.
More over, you need to check properties and Methods.
If any method/property is not supported by the new dll's class, or you may end up in run time error..

Such a method is used in same Dll's with different version (say Word/Excel).

Regards
Veena
May 7 '08 #4
chuckzter
56 New Member
Uhm, to clear things up here is the scenario.

I have 100+ DLL files that i need to test.
I need to figure out a way on how to save

"Set dllname = New HRMSSkills.SkillsManager" <- this statement as a string and execute it during runtime. by saying so i can change "HRMSSkills.SkillsManager" unto anything i want meaning i can manipulate the string and change the DLL file that i want to test. Again, during runtime so that i don't need to recode everytime, 100+ times in particular.

Haha, it's very frustrating.

Here's a piece of what i have so far:

Dim dllname As HRMSSkills.SkillsManager

a = "Set dllname = New HRMSSkills.SkillsManager"
Call ScriptControl1.ExecuteStatement(a)

When the Call line is being executed i get the error: "Class not defined: HRMSSkills"

Am i missing something? Do i need to step back and think it over again?
May 7 '08 #5
chuckzter
56 New Member
Cool, it works now. Thanks.

but i do have another question. How do i get the possible Intellisense and put it unto a variable? An array in particular. That would be my last question.

I.E

HRMSSkills.SkillsManager

SkillsManager can laso be SkillsProvider, etc.

Is there a possiblity that i can get the value of those?
May 7 '08 #6
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

To get the List of all the members/methods of the DLL.
You can Include the Dll in a New project. and Check the "Object Browser".
Select the dll on the top and Class name from the Left List..
Members and methods for that Class are popluated in the Right List..
This is one easy way out..

Regards
Veena
May 7 '08 #7
chuckzter
56 New Member
Thanks, i'll try that later. I need to sleep. XD thanks for the reply. I'll post if something goes wrong.
May 7 '08 #8
chuckzter
56 New Member
Uhm, how do i do this exactly? Sorry, i'm new at this.
May 8 '08 #9
chuckzter
56 New Member
Ok i think i got it. But what i need is that i want to see those methods during run time. Anybody who can help me?
May 8 '08 #10
chuckzter
56 New Member
I am getting an error "ActiveX cannot create object" on this line of code

Set dllname = CreateObject(Combo1.Text)

A little help please? I've been stuck with this for days. Thanks.
May 14 '08 #11
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

You need to use this code:

Expand|Select|Wrap|Line Numbers
  1. Dim MyObj As Object
  2. Set MyObj = CreateObject("Access.Application")
  3.  
If you are using a ComboBox, to populate the dll names, then
CreateObject takes "DLLName.ClassName" as argument.
You may get error if you are creating only DLLName as object..

Regards
Veena
May 14 '08 #12
chuckzter
56 New Member
Thanks! but now i'm getting a new error that says, "File name or classname not found during Automation operation." on this line of code

Output = dllname.GetRecord(InputTextbox.Text)

Where getrecord is a method of HRMSSkills.SkillsManager

Thanks for the reply. You guys are helping me a lot.
May 14 '08 #13
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Check how many Arguments does the GetRecord take..
Also post the modified code here...

Regards
Veena
May 14 '08 #14
chuckzter
56 New Member
Dim dllname As Object

Set dllname = CreateObject(Combo1.Text)

Output = dllname.GetRecord(InputTextbox.Text)

What happens is that when i try to run the program the "GetRecord" class which is located within the DLL isn't recognized or found.


Arguments? I'm not sure about what you mean.
thanks for the quick replies.
May 14 '08 #15
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

What values are there in Combo1.Text and TextBox...?
I Guess, "GetRecords" must be some Procedure/Function..
Arguments means, Any procedure /function which takes some values...

Regards
Veena
May 14 '08 #16
chuckzter
56 New Member
Here's the combo1.text of course depending on what you choose but here's a sample.

HRMSSkills.SkillsManager

And for the input text:

<?xml version="1.0" encoding="iso-8859-1" ?>
<Requests>
<Request>
<RequestType>Include</RequestType>
<IncludeString>
<row strEmpNo="1234567" strUserID="1234567" strSessionID="1052866004" strDimension1="" strDimension2="" strJobPosition="" strHomeURL="http://HURISBDC02/HRMS/" strDateFormat="dd mmm yyyy" strNameSpace="D:/Applications/WebRoot/HRMSNS/" blnHdrVisible="True" blnNavVisible="True" />
</IncludeString>
</Request>
<Request>
<RequestType>Skills Classifier</RequestType>
<RequestParameters>
<EmpNo>1234567</EmpNo>
<Dimension1>FGP</Dimension1>
<Dimension2 />
<JobPosition />
</RequestParameters>
</Request>
</Requests>
May 15 '08 #17
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

InputTextBox has all that...?
It looks like an XML Page..
May be the error is because of that..
You need to pass arguments/call functions as you normally do when calling a procedure..

Regards
Veena
May 15 '08 #18
chuckzter
56 New Member
Here's the scenario, I have a DLL file now i use it as reference to convert parameters to XML. Now i did some experiments and added the class/modules of that DLL (HRMSSkills.DLL) unto my program It works but when i only use it as reference it throws back an error "File name or Class name not found during Automation operation".

I've been stuck on this task for days now. I need help. Thanks in advance.
May 15 '08 #19
chuckzter
56 New Member
Our senior programmer fixed the problem. Thanks for all the replies.
May 15 '08 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
1
by: tonci.tomic | last post by:
I have windows service running on win2000 and client applications on local network connected to service via remoting. Service acts as interface to MSSQL 2000 database and it uses Microsoft Data...
11
by: Rangi Keen | last post by:
I am instantiating an XmlSerializer using the XmlSerializer(Type) constructor. This works most of the time, but sometimes I get a timeout during the process. I'm using the same type in all cases...
5
by: N | last post by:
Hi, I got an error during load on a couple of the tables. And it seems to be complaining that I'm running out of tempspace (possibly during index rebuild). Below is the load command and error....
1
by: Richard Hollenbeck | last post by:
I noticed I can't push a value into a text box by saying something like, "txtThisTextBox = intSomeVariable * 0.5" because I get an run-time error saying I can't assign a value to this object....
0
by: cefrancke | last post by:
I have a Tab control containing pages and many other controls. I would like to set the position of the tab control during Load or Open (btw, where is the place to do this?). During Design Time,...
11
by: Yeounkun, Oh | last post by:
Hello. Sleep (x) function make a process sleep during x seconds. but, how to sleep during milliseconds... Pls. help me. Thank you. Regards.
3
by: Nathan Phelps | last post by:
I realize that I could find my virtual directory using some of the methods in the HttpRequest object, but since the HttpRequest object is not in context during the Application_Start event, I'm at a...
6
by: mysore | last post by:
I am using VB6.0 I have two combo boxes , namely combo1 and combo2. For E.g, I say Combo1.AddItem Combo1.Text to add a new item to the list during run time. In the drop down I do see the new item...
2
by: =?Utf-8?B?d2R1ZGVr?= | last post by:
I have a website using windows integrated security, with anonymous access turned off. The site is used to query orders from a database and when the search takes a long time, a windows login box...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.