Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

newbie thats needs a little help with a dll issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aaron - 13 Mar 2008 12:41 GMT
Hello All,

First, I'm newer than a Newbie... I know its sad, but i'm trying to start
somewhere.

I'm attempting to write what I thought was a very simple program that would
call another program from a command line. Now I got that part to work, but
got hung up on packaging the exe (and its supporting dll) to the target
computer.
So I found an open source program that extracts and create cab files. So
using that I created a small progy to create the cab file containing the the
two other files I need. Then modified my code to call the dll file that I
included into the program(the cab extractor program.. I might also mention
that the open source program is writen in C++ not C# and comes as a dll file
that I included into my project). Everything was working fine till I moved
my program to another computer and discovered that the dll file from the cab
program is not included in my exe file. It has to be copied to the same
directory as my exe.

So does anyone know how integrate that dll file into my exe, or a way to
include it as a resource file and extract it to the working directory(i've
search high and low for that and can not find anything).

I've tried to use the al.exe program included with the SDK's in VS08 but its
fighting me every step of the way. I keep getting caught up on finding the
main entry point. The main entry point in my app is under the program.cs
class - method main. So in the al.exe command line I include
"/main:program.main" like the tech net article refers to.. but it keeps
erroring out.

If anyone has suggestions please respond. I could use a little help before
the sanity fails!!! LOL

Thanks,

Aaron
Jon Skeet [C# MVP] - 13 Mar 2008 12:53 GMT
<snip>

> If anyone has suggestions please respond. I could use a little help before
> the sanity fails!!! LOL

Basically, DLLs are meant to sit alongside EXEs - they're not really
designed to be embedded within them.

It's not clear to me why you need cabs etc in the first place - why
don't you just copy all the files that you need to start with?

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Aaron - 13 Mar 2008 12:58 GMT
Umm well I would like to... however just havn't figured out how to extract
the files to disk yet... if you have any suggestions i would be more than
willing to attempt it. I have tried to use the Assembly and Stream classes
but havn't really got it to work. When reasearching that is when I stumbled
across the cab extractor.

Thanks,

aaron

> <snip>
>
[quoted text clipped - 7 lines]
> It's not clear to me why you need cabs etc in the first place - why
> don't you just copy all the files that you need to start with?
Jon Skeet [C# MVP] - 13 Mar 2008 13:13 GMT
> Umm well I would like to... however just havn't figured out how to extract
> the files to disk yet...

But you've already *got* the files, haven't you? After all, you wrote:

<quote>
So using that I created a small progy to create the cab file containing
the the two other files I need.
</quote>

If you created the cab file, you must already have the files you need.
So why bother with the cab file? Just copy the files over directly in
the first place, and leave cab files out of it.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Aaron - 13 Mar 2008 13:42 GMT
ok maybee i'm not being very clear. I'm attempting to write a small program
what will call the free vnc edition by command line to connect to my viewer
with no interaction from the user with the exception of hitting the connect
button. However I have to get the vnc and the supporting dll copied to the
local machine. What I would like to do is have then click on my executable,
that would then extract the files into the appropriate directory and then
call it from the command line. My issue is getting the files extracted to
the users hard disk. Can you help with that?

Thanks,

aaron

>> Umm well I would like to... however just havn't figured out how to
>> extract
[quoted text clipped - 10 lines]
> So why bother with the cab file? Just copy the files over directly in
> the first place, and leave cab files out of it.
Jon Skeet [C# MVP] - 13 Mar 2008 13:55 GMT
> ok maybee i'm not being very clear. I'm attempting to write a small program
> what will call the free vnc edition by command line to connect to my viewer
[quoted text clipped - 4 lines]
> call it from the command line. My issue is getting the files extracted to
> the users hard disk. Can you help with that?

How is the user getting your executable to their computer to start
with? Why can't the VNC files be copied in the same way?

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Aaron - 13 Mar 2008 13:57 GMT
Not really,

they will be downloading it from the web or sent through email

>> ok maybee i'm not being very clear. I'm attempting to write a small
>> program
[quoted text clipped - 12 lines]
> How is the user getting your executable to their computer to start
> with? Why can't the VNC files be copied in the same way?
Lasse Vågsæther Karlsen - 13 Mar 2008 14:32 GMT
> Not really,
>
[quoted text clipped - 18 lines]
>> How is the user getting your executable to their computer to start
>> with? Why can't the VNC files be copied in the same way?

This is what installation programs are typically for...

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3

Jon Skeet [C# MVP] - 13 Mar 2008 14:44 GMT
<snip>

> This is what installation programs are typically for...

Or self-extracting zip files, if full installers aren't required.
There's no need for any code though.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.