473,770 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Importing Custom Types from DLL into C#

4 New Member
Good day sirs,

I am currently working on creating windows GUI software for a hardware device. The hardware's functions are stored in a DLL. Here is the structure for a function I need to import

Expand|Select|Wrap|Line Numbers
  1. CustomType CustomFunction (CustomType1, CustomType2)
I use DLLImport to import functions. It seems to work as long as the functions all use default types like int, char and others. My question is how will I go around importing functions which use custom types?

This is what I'm doing right now
Expand|Select|Wrap|Line Numbers
  1. [DllImport("stapi.dll")]
  2. LPSKYETEK_DEVICE;
  3.  
  4. [DllImport("stapi.dll")]
  5. static extern int SkyeTek_DiscoverDevices(LPSKYETEK_DEVICE **lpDevices);
  6.  

It really is not working at all. Some errors include the ff
- "The type of namespace name 'LPSKYETEK_DEVI CE' could not be found (are you missing a using directive or an assembly reference?)"
- "Cannot take the address of, get the size of, or declare a pointer to a managed type ('LPSKYETEK_DEV ICE')"


I'm using Visual C# Express Edition 2008 on a Windows XP machine. I have .NET 3.5 installed.

I am extremely unfamiliar with Windows Development as all my prior programming work has been with assembly, Java and Matlab. This has also been the first time I used Visual Studio. Thanks for your help!

Paulo
Aug 28 '08 #1
1 1558
poldoga
4 New Member
Any help here? Would really appreciate any input. This has been bugging me for days already. Thanks in advance.
Aug 30 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2238
by: Steve George | last post by:
Hi, I have a scenario where I have a master schema that defines a number of complex and simple types. I then have a number of other schemas (with different namespaces) where I would like to reuse some of these master complex and simple types. This I believe will assist me in transforming between the master schema and the other smaller schemas that contain a subset of the elements in the master schema. I understand that I can import an...
2
1402
by: chudson007 | last post by:
I have a .txt file that I need to add to an existing table, which is made up of Varchar, Char, numeric and int fields. What is the best way to do it. The first thing I tried was importing the .txt file, and then going into the design and changing the field type, but I hit problems on the Numeric fields. Then I tried changing the field types from varchar to different types at the transfom stage of importing, but that failed too.
29
4229
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using System.Text.RegularExpressions; using System.Web; using System.Web.Caching;
6
2337
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without having to do a httpwebreqeust call.
3
3005
by: scoots987 | last post by:
What do others do if you need to import excel files into SQL Server? My main problems are 1) zipcode formatting issues. If the column is a mix of zip and zip+4, I have problems retrieving all zipcodes. 2) If the last column contains NULL no information is imported. All this with using the Management console using Import data in SQL Server 2005. I am simply trying to import the data into NEW databases.
0
1269
by: twostepted | last post by:
I'm writing because I saw an earlier post with a similar title dealing with importing xml content into mysql and I couldn't respond to it. I've created a really nice tool for automating this process called SportsFeed. It can be configured to fetch xml data regularly and has scheduling and monitoring support. The content can be saved to disk or database, allowing individual xml element / attribute content to be mapped to database command...
2
19491
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
0
2897
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
0
9617
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9453
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10254
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8929
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.