473,405 Members | 2,294 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,405 software developers and data experts.

adding c style dll to c# app

hi,

i have a dll with its .h file,in the .h i found the [ extern "C" ] .
when i tried to add the dll to a c# app ,it give me that error
[please make sure that it is a valid com or assembly component]

so does anyone could help me to add the .dll to my app.

note: i don't have the source code.

thanks.

Dec 19 '06 #1
3 1462
Hi,

Try this link http://ablog.apress.com/?p=383

--
Cheers,
Gary
http://www.garyshort.org/

saleh wrote:
hi,

i have a dll with its .h file,in the .h i found the [ extern "C" ] .
when i tried to add the dll to a c# app ,it give me that error
[please make sure that it is a valid com or assembly component]

so does anyone could help me to add the .dll to my app.

note: i don't have the source code.

thanks.
Dec 19 '06 #2
hi Gary ,

thanks for your reply ,but it solve diifrent problem not mine

my problem is:the VS don't allow me to add reference to the dll from
the start and give me that error.

thanks,
saleh

Dec 19 '06 #3
"saleh" <na*********@gmail.comwrote in message
news:11*********************@a3g2000cwd.googlegrou ps.com...
hi,

i have a dll with its .h file,in the .h i found the [ extern "C" ] .
when i tried to add the dll to a c# app ,it give me that error
[please make sure that it is a valid com or assembly component]

so does anyone could help me to add the .dll to my app.

note: i don't have the source code.

thanks.

You can't add a "native code" dll to a C# project, C# cannot statically link to DLL's . If
you need to call "C" style functions exported from DLL's from C#, you'll have to import the
functions using the DllImport attribute. Search MSDN for details on PInvoke and DllImport.

Willy.
Dec 19 '06 #4

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

Similar topics

0
by: Andrés Giraldo | last post by:
Hi! I'm adding an asp button to a datagrid on the ItemDataBound event, when the user clicks on this button, I basically remove the button and create other 2 buttons... my problem is.. the 2 last...
4
by: Tonya | last post by:
Hi, Does anyone know how i can add controls to a progress bar. I have searched the internet but could not find any examples. what i want to add is a progress bar and a button. thx
10
by: Melissa Mussitsch | last post by:
I've done this before while creating a brand new table. But the code below is not working and I keep getting the error: "Internet Explorer cannot open the Internet site ..... Operation aborted" ...
32
by: Ed Jay | last post by:
A complete js newbie is asking this question: I have a form comprised of several questions, each answered with a radio button. I'd like to use onClick to bring up additional text at the end of...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
11
by: Ørjan Langbakk | last post by:
I'm parsing a CSV-file into a table on a webpage - and I'd like to be able to change the alignment for the _last_ <td> in each <tr> - but, as the file is today, it's not possible for me to assign a...
11
by: Daz | last post by:
Hello everyone. I am sure the answer to my question is simple, but I can't seem to dynamically add an onClick event to my script. I have a table which is generated dynamically, I am just...
4
by: Rob Meade | last post by:
Hi all, Ok - this might sound kinda stupid - but I cant see how to do it... I've got an update panel which contains, on one horizontal line, a drop down list, then an image, then another drop...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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.