473,503 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DLLs

Is there any way I can prevent people using my DLLs in their programs? I
mean, I'm new to making DLLs and I'm guessing that if I can reference my
DLLs in my projects then there is nothing stopping anyone else from
referencing my DLLs in their projects.

Also, Just wondering whether there is a type of *thing* which is like a DLL
but includes a form as well. I want to include modules in my app, so say
for example purposes my app contains a main form and a calculator module.
The main form is the exe and the calculator gets called from a separate file
when needed? Any ideas?

Thanks for the help.
Jul 17 '05 #1
12 3111
On Fri, 28 May 2004 08:35:01 GMT, Visual Boodu .NET wrote:
Is there any way I can prevent people using my DLLs in their programs? I
mean, I'm new to making DLLs and I'm guessing that if I can reference my
DLLs in my projects then there is nothing stopping anyone else from
referencing my DLLs in their projects.
Nothing that can't be bypassed by a determined cracker. You could have
your DLL look in the registry for something, look for another
preexisting file, require a password (either fixed or determined by
something within the user's system), etc. - basically, do the same
things that commercial programs do - but again, crackers bypass this on
a daily basis. (Although they usually crack apps to use the app, not
just one specific file.)
Also, Just wondering whether there is a type of *thing* which is like a DLL
but includes a form as well. I want to include modules in my app, so say
for example purposes my app contains a main form and a calculator module.
The main form is the exe and the calculator gets called from a separate file
when needed? Any ideas?


I don't usually store forms in DLLs but I would assume that it can be
easily done; others here will have that answer.
--
auric underscore underscore at hotmail dot com
*****
Obviously our captor underestimated the wrath of a man and his hamster.
Jul 17 '05 #2
You can put forms in a DLL and call them. There's no
limitation.
For restriction: Somewhere on MSDN there's a page
about how to make a control licensed, the same way
that VB controls are licensed and can't be run otherwise.
I don't have a link to it, though. Another option might be
something like a dummy parameter. Your DLL parameters
can be seen in an object browser but that doesn't explain
them. So besides the natural difficulty in figuring out how
to call a function given object browser info., you could also
make it more confusing by adding a dummy parameter,
naming the parameters in a vague way, etc.

--
--
Visual Boodu .NET <sn@il.mail> wrote in message
news:VQ****************@news-server.bigpond.net.au...
Is there any way I can prevent people using my DLLs in their programs? I
mean, I'm new to making DLLs and I'm guessing that if I can reference my
DLLs in my projects then there is nothing stopping anyone else from
referencing my DLLs in their projects.

Also, Just wondering whether there is a type of *thing* which is like a DLL but includes a form as well. I want to include modules in my app, so say
for example purposes my app contains a main form and a calculator module.
The main form is the exe and the calculator gets called from a separate file when needed? Any ideas?

Thanks for the help.

Jul 17 '05 #3
Auric__ wrote:
On Fri, 28 May 2004 08:35:01 GMT, Visual Boodu .NET wrote:
Is there any way I can prevent people using my DLLs in their
programs? I mean, I'm new to making DLLs and I'm guessing that if I
can reference my DLLs in my projects then there is nothing stopping
anyone else from referencing my DLLs in their projects.
Nothing that can't be bypassed by a determined cracker. You could have
your DLL look in the registry for something, look for another
preexisting file, require a password (either fixed or determined by
something within the user's system), etc. - basically, do the same
things that commercial programs do - but again, crackers bypass this
on a daily basis. (Although they usually crack apps to use the app,
not just one specific file.)


Thanks, yea I didn't think of that. Might be a good idea me thinks!
Also, Just wondering whether there is a type of *thing* which is
like a DLL but includes a form as well. I want to include modules
in my app, so say for example purposes my app contains a main form
and a calculator module. The main form is the exe and the calculator
gets called from a separate file when needed? Any ideas?


I don't usually store forms in DLLs but I would assume that it can be
easily done; others here will have that answer.

Jul 17 '05 #4
mayayana wrote:
You can put forms in a DLL and call them. There's no
limitation.
For restriction: Somewhere on MSDN there's a page
about how to make a control licensed, the same way
that VB controls are licensed and can't be run otherwise.
I don't have a link to it, though. Another option might be
something like a dummy parameter. Your DLL parameters
can be seen in an object browser but that doesn't explain
them. So besides the natural difficulty in figuring out how
to call a function given object browser info., you could also
make it more confusing by adding a dummy parameter,
naming the parameters in a vague way, etc.
How do I put a form in a DLL? Probably if I make vague functions & that
then I'll probably get confused! I'll check out MSDN for that licencing
thing. Thanks for your help.
--
Is there any way I can prevent people using my DLLs in their
programs? I mean, I'm new to making DLLs and I'm guessing that if I
can reference my DLLs in my projects then there is nothing stopping
anyone else from referencing my DLLs in their projects.

Also, Just wondering whether there is a type of *thing* which is
like a DLL but includes a form as well. I want to include modules
in my app, so say for example purposes my app contains a main form
and a calculator module. The main form is the exe and the calculator
gets called from a separate file when needed? Any ideas?

Thanks for the help.

Jul 17 '05 #5
On Fri, 28 May 2004 20:50:07 GMT, Visual Boodu .NET wrote:
Auric__ wrote:
On Fri, 28 May 2004 08:35:01 GMT, Visual Boodu .NET wrote:
Is there any way I can prevent people using my DLLs in their
programs? I mean, I'm new to making DLLs and I'm guessing that if I
can reference my DLLs in my projects then there is nothing stopping
anyone else from referencing my DLLs in their projects.


Nothing that can't be bypassed by a determined cracker. You could have
your DLL look in the registry for something, look for another
preexisting file, require a password (either fixed or determined by
something within the user's system), etc. - basically, do the same
things that commercial programs do - but again, crackers bypass this
on a daily basis. (Although they usually crack apps to use the app,
not just one specific file.)


Thanks, yea I didn't think of that. Might be a good idea me thinks!


Yes, well, just remember that crackers can bypass *any* protection
scheme if they have reason to.
--
auric underscore underscore at hotmail dot com
*****
Jennifer Lopez wears enough diamonds to blind a city block.
Jul 17 '05 #6
Yea, thats fine, I think I would feel honoured if I saw my app on some
cracker page :)

Auric__ wrote:
On Fri, 28 May 2004 20:50:07 GMT, Visual Boodu .NET wrote:
Auric__ wrote:
On Fri, 28 May 2004 08:35:01 GMT, Visual Boodu .NET wrote:

Is there any way I can prevent people using my DLLs in their
programs? I mean, I'm new to making DLLs and I'm guessing that if
I can reference my DLLs in my projects then there is nothing
stopping anyone else from referencing my DLLs in their projects.

Nothing that can't be bypassed by a determined cracker. You could
have your DLL look in the registry for something, look for another
preexisting file, require a password (either fixed or determined by
something within the user's system), etc. - basically, do the same
things that commercial programs do - but again, crackers bypass this
on a daily basis. (Although they usually crack apps to use the app,
not just one specific file.)


Thanks, yea I didn't think of that. Might be a good idea me thinks!


Yes, well, just remember that crackers can bypass *any* protection
scheme if they have reason to.

Jul 17 '05 #7

How do I put a form in a DLL?


A DLL is like an EXE with a COM interface. You can do
anything you want to. Just add the form to the project and
control it through your exposed class(es).
You can also pass the events through if you need to.
In the exposed class, assuming you have a Form1, use:
Private WithEvents Frm as Form1
You can then write subs in your class for the form events, like:
Private Sub Frm_Clicked()
Msgbox "Form was clicked."
end sub
Jul 17 '05 #8
Excellent advice, thanks. I made a DLL with a form which had a button and
'referenced' the DLL in my project (project - references) then added this
code:

Dim frm As Projectdll.Class1

Set frm = New Projectdll.Class1

Call frm.LdForm

Is that the right way to work with DLLs? What does 'Private WithEvents Frm
as Form1' do? What is a COM interface?

Thanks!

mayayana wrote:
How do I put a form in a DLL?


A DLL is like an EXE with a COM interface. You can do
anything you want to. Just add the form to the project and
control it through your exposed class(es).
You can also pass the events through if you need to.
In the exposed class, assuming you have a Form1, use:
Private WithEvents Frm as Form1
You can then write subs in your class for the form events, like:
Private Sub Frm_Clicked()
Msgbox "Form was clicked."
end sub

Jul 17 '05 #9
OK I figured out I can just do:

Dim frm As New Projectdll.Class1

And that works OK. Now I would like the DLL to be a MDI child form to be
called into my (obviously) MDI parent. When I try to do this it craps
itself (it can't find a MDI parent form). Is there any way around this?

Visual Boodu .NET wrote:
Excellent advice, thanks. I made a DLL with a form which had a
button and 'referenced' the DLL in my project (project - references)
then added this code:

Dim frm As Projectdll.Class1

Set frm = New Projectdll.Class1

Call frm.LdForm

Is that the right way to work with DLLs? What does 'Private
WithEvents Frm as Form1' do? What is a COM interface?

Thanks!

mayayana wrote:
How do I put a form in a DLL?


A DLL is like an EXE with a COM interface. You can do
anything you want to. Just add the form to the project and
control it through your exposed class(es).
You can also pass the events through if you need to.
In the exposed class, assuming you have a Form1, use:
Private WithEvents Frm as Form1
You can then write subs in your class for the form events, like:
Private Sub Frm_Clicked()
Msgbox "Form was clicked."
end sub

Jul 17 '05 #10
What does 'Private WithEvents Frm
as Form1' do?
That's to use in the class of your DLL if you want to trap
form events. The "Frm" variable was meant to be a variable
in your DLL class, not the variable for your object within
the main project.
What is a COM interface?
Component Object Model. A COM object is registered
in HKCR, along with its type library. A COM object also has a
specific structure, such that the type library can be accessed and
functions in the COM object can be discovered based on what's
in that type library. A VB DLL is an ActiveX DLL, which is
a COM DLL.

COM is basically ActiveX, though the definitions are murky
because they're as much marketing as they are technical terms.
A fun quote from "The Essence of COM", a book by a notably
cranky author by the name of David S. Platt:

" The term ActiveX is another winner....the term "ActiveX" has no
technical meaning whatsoever, although it did have several
different meanings at various times. It is today a branding prefix, the
same as the letters "Mc" in front of all the food at the restaurant
with the golden arches."

The Object Browser is actually a COM object browser. It reads
COM object type libraries and displays what it finds. That's as
opposed to non-COM DLLs like shell32.dll or kernel32.dll, for
which there's no "self-documenting" functionality. With those you
just have to know the function that you want. That's why there's
"intellisense" for components added to your project but not for
kernel32.dll, even though you may have declared a kernel32.dll
function. You can get the function parameters popup for that
because VB knows it from your declare, but you can't get an
intellisense listbox menu because kernel32.dll doesn't "expose"
a COM interface to know it's functions.
And that works OK. Now I would like the DLL to be a MDI child form to be
called into my (obviously) MDI parent. When I try to do this it craps
itself (it can't find a MDI parent form). Is there any way around this?


Why would you put a form inside a DLL if you want it to be
an MDI child? I don't understand what you're trying to achieve.
The point of the DLL is that you can package functionality and
make it easily accessible with a COM interface. The form inside
your DLL is only accessible to the extent that you've provided public
methods in the DLL class(es) that can act on it in some way.
That form has no relation to an MDI form in your project.

In case it's any help, I've got sample DLL code with a form
in it:
http://www.jsware.net/jsware/zips/dllsamp.zip
Jul 17 '05 #11
With the MDI form I figured that if you can create a form in a DLL then you
could create a MDI form to be called into my MDI parent. It doesn't really
matter too much. Basically the reason I'm looking into DLLs is that my
application will need constant updating so it would be easier and a lot less
Kbs when downloading the updates... Update only the modules which need
updating rather than the whole exe every time. For my application think of
it like Outlook Express, the main screen is my exe, when you click on say
the accounts section, that will be called from a DLL.

As for your project, at this line:

Set SampOb = New SampleObject

And this line:

Set Ob = CreateObject("SampleDLL.SampleObject")

I get Run-time error '429': ActiveX component can't create object

mayayana wrote:
What does 'Private WithEvents Frm
as Form1' do?


That's to use in the class of your DLL if you want to trap
form events. The "Frm" variable was meant to be a variable
in your DLL class, not the variable for your object within
the main project.
What is a COM interface?


Component Object Model. A COM object is registered
in HKCR, along with its type library. A COM object also has a
specific structure, such that the type library can be accessed and
functions in the COM object can be discovered based on what's
in that type library. A VB DLL is an ActiveX DLL, which is
a COM DLL.

COM is basically ActiveX, though the definitions are murky
because they're as much marketing as they are technical terms.
A fun quote from "The Essence of COM", a book by a notably
cranky author by the name of David S. Platt:

" The term ActiveX is another winner....the term "ActiveX" has no
technical meaning whatsoever, although it did have several
different meanings at various times. It is today a branding prefix,
the same as the letters "Mc" in front of all the food at the
restaurant with the golden arches."

The Object Browser is actually a COM object browser. It reads
COM object type libraries and displays what it finds. That's as
opposed to non-COM DLLs like shell32.dll or kernel32.dll, for
which there's no "self-documenting" functionality. With those you
just have to know the function that you want. That's why there's
"intellisense" for components added to your project but not for
kernel32.dll, even though you may have declared a kernel32.dll
function. You can get the function parameters popup for that
because VB knows it from your declare, but you can't get an
intellisense listbox menu because kernel32.dll doesn't "expose"
a COM interface to know it's functions.
And that works OK. Now I would like the DLL to be a MDI child form
to be called into my (obviously) MDI parent. When I try to do this
it craps itself (it can't find a MDI parent form). Is there any way
around this?


Why would you put a form inside a DLL if you want it to be
an MDI child? I don't understand what you're trying to achieve.
The point of the DLL is that you can package functionality and
make it easily accessible with a COM interface. The form inside
your DLL is only accessible to the extent that you've provided public
methods in the DLL class(es) that can act on it in some way.
That form has no relation to an MDI form in your project.

In case it's any help, I've got sample DLL code with a form
in it:
http://www.jsware.net/jsware/zips/dllsamp.zip

Jul 17 '05 #12
> I get Run-time error '429': ActiveX component can't create object

You need to load the DLL and test projects as a group.
Then reference SampleDLL from the test project. (And
set the test project to start: Right-click ProjectTester; click
Set as Startup

With the MDI form I figured that if you can create a form in a DLL then you could create a MDI form to be called into my MDI parent. It doesn't really matter too much. Basically the reason I'm looking into DLLs is that my
application will need constant updating so it would be easier and a lot less Kbs when downloading the updates... Update only the modules which need
updating rather than the whole exe every time. For my application think of it like Outlook Express, the main screen is my exe, when you click on say
the accounts section, that will be called from a DLL.


The DLL is not part of your project, though. It's like
another program. You can use a DLL to do workhorse
functions but you can't call your DLL form to load inside
the MDI parent any more than you could if it were in
another EXE that you made.
I see what you mean about the Outlook Express example. OE
does seem to work that way, with a very small program EXE.
Maybe what you want is an OCX that you can put on a main form
in the EXE. You could then update your OCX.
Jul 17 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2829
by: Johann Blake | last post by:
I can hardly believe I'm the first one to report this, but having gone through the newsgroup, it appears that way. I would like to open a solution in the VS.NET IDE that consists of multiple...
2
4222
by: Shiraz | last post by:
Hi I just made an installer for an application that uses two external COM dlls. On the surface, everything seems to be running smoothly and the the application runs without any errors. However,...
11
2271
by: Devender Khari | last post by:
Hi Friends, I'm facing a situation as follows, need help on identifying possible issues. There is an MFC application developed in VC6.0, say ABCVC6.exe and another developed in VC.NET, say...
0
3203
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
7
3089
by: Oenone | last post by:
I'm sure there's an obvious way to do this, but I'm missing it so far. I have an ASP.NET application that relies on several DLLs to work. Currently in order to get my site working I have to put...
6
2189
by: Brian Bischof | last post by:
I'm having troubles getting the debugging process to work consistenly for external classes. I got it to work once and then I turned it off. But now I can't get re-enabled. Here is what I'm doing....
0
1395
by: Dave | last post by:
Hello The application I'm building an installer for uses dlls which were developed originally in C. Since the application itself is developed in C#, these dlls were wrapped using SWIG....
7
1921
by: Jeff Lynn | last post by:
Help! I recently upgraded my VS V6 to VS 2005 and was unable to build projects that were perfectly ok under VS V6. Where VS 2005 fails was in the linker resolving external DLLs, which are Open...
3
2687
by: gopal | last post by:
I am developing an application in CSharp - windows forms based, which copies the DLLs both unmanaged and managed DLLs from a shared folder and will overwrite the existing versions of managed &...
10
1900
by: =?Utf-8?B?UmljaGFyZA==?= | last post by:
Hi, I usually deploy my ASP .NET application to the server by publishing, using Visual Studio 2005 publish feature. This creates the Bin folder on the server, with the compiled DLLs. I've...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
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
6991
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
5578
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,...
0
4673
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
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.