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

C#-WinCE5.0 - Creating a custom DLL for DLLIMPORT

Plater
7,872 Expert 4TB
I am having trouble finding examples of creating your own .DLL for use with the DLLIMPORT function.
All I can find is an MFC dll which has so much overhead it's rediculous.
I just need two c++ functions to be available to me through the DLLIMPORT.

Here are my psuedo-code prototypes for the two functions:
Expand|Select|Wrap|Line Numbers
  1. bool WriteLocalBus(INT32 Address, UIN16 Data);
  2. UINT16 ReadLocalBus(INT32 Address);
  3.  
Now I need a .dll that implements them and allows me to import the functions into a C# project.

Anyone have any insight they can offer?
Apr 23 '07 #1
3 2359
Motoma
3,237 Expert 2GB
Are you creating the C++ functions yourself? Is there a reason why you cannot write these in C#?

I believe that you will need to utilize the DllExport keyword in your DLL code in order to be able to import the functions using DllImport.

But if you are using VS2003/VS2005, I believe you can just include the C++ project in your solution, and add that project as a reference to your C# project. Then use the extern keyword in the declaration.

Hope this is a push in the right direction,
Motoma

I am having trouble finding examples of creating your own .DLL for use with the DLLIMPORT function.
All I can find is an MFC dll which has so much overhead it's rediculous.
I just need two c++ functions to be available to me through the DLLIMPORT.

Here are my psuedo-code prototypes for the two functions:
Expand|Select|Wrap|Line Numbers
  1. bool WriteLocalBus(INT32 Address, UIN16 Data);
  2. UINT16 ReadLocalBus(INT32 Address);
  3.  
Now I need a .dll that implements them and allows me to import the functions into a C# project.

Anyone have any insight they can offer?
Apr 23 '07 #2
Plater
7,872 Expert 4TB
I was writing both the C# and C++ parts and ended up using the MFC DLL. Yes, I needed to use the DLLEXPORT, it is working now.
It's a hog, almost 2megs to run 3lines of code but I cannot do direct memory acces in C# in seems.
May 15 '07 #3
Motoma
3,237 Expert 2GB
Yikes!

Glad you got it figured out though.

I was writing both the C# and C++ parts and ended up using the MFC DLL. Yes, I needed to use the DLLEXPORT, it is working now.
It's a hog, almost 2megs to run 3lines of code but I cannot do direct memory acces in C# in seems.
May 15 '07 #4

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

Similar topics

2
by: Tom Alcendor | last post by:
I am building a chess game application that allows a user to click on a piece and move it to a new square. When the user clicks on a piece the mouse pointer must change to the image associated...
0
by: Albinas | last post by:
Dear all, I am a beginner in VB.NET and I have just taken the course 2565. (So, you can see how fresh I am.) I am creating a custom textbox and adding some new attributes to the textbox. ...
4
by: NutJob | last post by:
Hello, I'm faced with the following problem: I have a (secondary) thread that monitors a socket for incoming message traffic using the select.select() function. Besides that I also have the...
0
by: Jai | last post by:
Dear All Creating Custom Controls but Not User Controls,How to create custom controls,i.e Extending the functionality of the Existing Controls.(Web Custom Controls). Previously i have...
4
by: Alvo von Cossel I | last post by:
hi, i have been asked to make a good-looking app for a friend. i have an options form with a big tabstrip in it. 1. how can i customize it e.g. change from the standard system style...
3
by: Kyle Fitzgerald | last post by:
I've started a web control library project and can build my own controls to add to the toolbox in the .NET environment. The problem I'm having is I want to create a control just like the HTML...
0
by: Julien | last post by:
Hi ! I'm creating a custom control, in which I would render an image with client-side script code to display/hide a calendar control which also belong to my custom control. In this control I've...
0
by: Nenefta | last post by:
Good afternoon everyone, I would like to create a custom GridViewand use that in the rest of my project, so all GridViews look the same. I thought it would be as easy as creating a usercontrol...
0
by: Ric | last post by:
I have a mandate from a customer to create custom bubble and gannt charts that are viewable in their Web browser. We explored some of the charting tools and controls but because of the complexity...
1
by: Abdo Haji-Ali | last post by:
Previously I used to create user controls if I wanted to use a specific set of controls in multiple pages, however I want to deploy my control in other applications so I thought of creating custom...
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?
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
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
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.