473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

is it possible to embed a native win32 dll as resource and use pinvoke?

if I have a Win32 DLL - X.DLL
can I embed it to a .Net Application and invoke it's exported functions?

normally i have to put the X.DLL in the file system and use DllImport to
import/invoke the function
I just wanna combine everything into a single .exe

thank you
Nov 15 '05 #1
1 3133
What you can do is embed it as a manifest resource stream and then at
runtime extract it, save it to the app's directory and then call it. You'll
have to specify only the filename in your [DllImport] statement for that to
work.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"babylon" <am***@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
if I have a Win32 DLL - X.DLL
can I embed it to a .Net Application and invoke it's exported functions?

normally i have to put the X.DLL in the file system and use DllImport to
import/invoke the function
I just wanna combine everything into a single .exe

thank you

Nov 15 '05 #2

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

Similar topics

3
by: rashid | last post by:
Sorry for posting this message on general . kindly direct this message to the specific group. I know we can invoke the Native Code from .Net but can we generate Native Code in .Net( Native Code...
3
by: M | last post by:
Hi Folks, Does anyone know how to embed a file into a resource in C#? You seem to be able to embed Icon, Bitmap, Cursor's & Strings. But how do you embed a file??? In VC++ version 6 you...
1
by: adrian maull | last post by:
Anyone know of a good resource thats maps win32 APIs (structs, functions, etc) to c#?
12
by: Nak | last post by:
Hi there, This might sound like a dumb question but how would I use a Win32 resource DLL in VB.NET? I presumed there were API's for this purpose but am unsure which ones, my API guide has...
2
by: Marek | last post by:
Hi I'm trying to call a native C++ dll using the following code (both C# and C++ code segments included). When I make the call to the method (AddTwoDoubles) that has no return value all is fine. ...
2
by: pkcser | last post by:
Hi, I am new to .Net development, so please excuse me if some of the questions .... So I have Win32 library (using Bluetooth) and I have to expose its functionality to .Net developers. I think...
8
by: CodeLeon | last post by:
Hi, All. I am creating a setup program. The way it works is that the user creates their setup info, my program generates the C# code for a setup executable, embeds the xml file containing the info...
14
by: pigeonrandle | last post by:
Hi, This is an answer, not a question. I hope it helps you since i was messing around for ages trying to get information on this: For anyone else wanting to create a test c++nativedll/c# project...
0
by: VigneshS | last post by:
Hi, I am a newbie to Globalization and Localisation Concepts. I tried almost all the methods of the Globalization concepts. But i cannot be able to embed a text file within a Resource. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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,...

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.