Solved

HowTo import DLL file in form

Posted on 2014-04-02
7
390 Views
Last Modified: 2014-04-07
I'm running Visual Studio

I have a DLL on a server \\A\myDLL.dll
The Dll has forms inside it

i want to use it on my form importing it only from the form, not through references


I need to do soemthing like this in my form  (pseudocode)



Imports MyDLL1  <source="\\A\myDLL.dll" >

Sub main()
    Dim x as Mydll1.frmForm1
    X.show()
End main
0
Comment
Question by:Ess Kay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 39972409
You should be able to use the load from to do that:
http://msdn.microsoft.com/en-us/library/1009fa28.aspx

Dim myDLL as Assembly = LoadFrom("\\A\myDLL.dll")
Dim x as new myDLL.Form1
x.Show()
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 39972634
should, but doesn't
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 39972687
are you getting an error?  What happens if you try the DLL not on a server path?

Also what happens if you just add it as a reference to your other project for now?  does that work?
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 15

Accepted Solution

by:
Ess Kay earned 0 total points
ID: 39972727
Im sure, same happens to me as it would to you
12

If i reference it in my program, it works fine, but I dont publish it to production. Thus, whoever publishes it will need to constantly update all DLLS, and this one may be frequently changing.

To avoid that, I would like to either add it to the project as an included file, or place it somewhere shareable.



UPDATE:
Got it to work
ex.jpg
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 39972829
frmReturn might be null.
try to instantiate it
myDLL.frmReturn = new myDLL.frmReturn

and then show it:
myDLL.frmReturn.Show()
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 39973016
thanks kyle. the solution i posted works
0
 
LVL 15

Author Closing Comment

by:Ess Kay
ID: 39982592
found solution here: http://www.a1vbcode.com/snippet-3215.asp

converted to vb
0

Featured Post

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Time out only from one specific computer client 15 52
aspx ascx, c# 7 41
GUID's in SQL Server 4 30
EF5 How do I stop pre-compiled views? 8 51
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question