Click here to Skip to main content
15,914,390 members
Home / Discussions / C#
   

C#

 
QuestionHow to make a Textbox only take numbers? Pin
dipuks11-Jun-07 11:33
dipuks11-Jun-07 11:33 
AnswerRe: How to make a Textbox only take numbers? Pin
Giorgi Dalakishvili11-Jun-07 11:44
mentorGiorgi Dalakishvili11-Jun-07 11:44 
AnswerRe: How to make a Textbox only take numbers? Pin
sxbluebird11-Jun-07 19:17
sxbluebird11-Jun-07 19:17 
GeneralRe: How to make a Textbox only take numbers? Pin
dipuks12-Jun-07 4:07
dipuks12-Jun-07 4:07 
AnswerRe: How to make a Textbox only take numbers? Pin
Revathij12-Jun-07 2:18
Revathij12-Jun-07 2:18 
QuestionMaking an animated UI Pin
RobMacAF11-Jun-07 11:20
RobMacAF11-Jun-07 11:20 
AnswerRe: Making an animated UI Pin
RobMacAF11-Jun-07 15:12
RobMacAF11-Jun-07 15:12 
QuestionDLL import, parameters, strings, etc Pin
esunder11-Jun-07 11:03
esunder11-Jun-07 11:03 
I am working on a project that needs to incorporate a C DLL. It is more like a wrapper to the DLL for C# developers. I have done some reading about unmanaged code in C#, importing a DLL and functions with the dllimport attribute. However I have not seen anything that is related to my situation.

The DLL has its own types, lets assume a connection (cxn) and a file (fh). Now I need to be able to use instances of those in C#. For example:

In C/C++ id just declare a new object

<br />
Cxn my_cxn; <br />
....<br />


Then I could go on and use that as a parameter to other functions.
How do I do this in C#?



Also, I think I am on track for strings. All of the functions in the DLL use LPCWSTR strings. So I am using the MarshalAS attribute to specify this. Example:

<br />
[DllImport("mylib.dll", CharSet=CharSet.Unicode)]<br />
    static extern int CxnOpen([MarshalAs(UnmanagedType.LPWStr)] string smtp,<br />
                               [MarshalAs(UnmanagedType.LPWStr)] string http,<br />
                               [MarshalAs(UnmanagedType.LPWStr)] string dom,<br />
                               [MarshalAs(UnmanagedType.LPWStr)] string rep,<br />
                               IntPtr temp);<br />

QuestionCompiling /unsafe and GetHashCode Pin
jon-8011-Jun-07 9:54
professionaljon-8011-Jun-07 9:54 
AnswerRe: Compiling /unsafe and GetHashCode Pin
Robert Rohde11-Jun-07 10:07
Robert Rohde11-Jun-07 10:07 
QuestionModal Popup (TCartwright's) Pin
stormcandi11-Jun-07 9:22
stormcandi11-Jun-07 9:22 
AnswerRe: Modal Popup (TCartwright's) Pin
Not Active11-Jun-07 9:28
mentorNot Active11-Jun-07 9:28 
GeneralRe: Modal Popup (TCartwright's) Pin
stormcandi11-Jun-07 9:31
stormcandi11-Jun-07 9:31 
QuestionGraphic - Exact string sizes Pin
skuggbo11-Jun-07 9:13
skuggbo11-Jun-07 9:13 
AnswerRe: Graphic - Exact string sizes Pin
Not Active11-Jun-07 9:31
mentorNot Active11-Jun-07 9:31 
GeneralRe: Graphic - Exact string sizes Pin
skuggbo11-Jun-07 10:14
skuggbo11-Jun-07 10:14 
GeneralRe: Graphic - Exact string sizes Pin
Luc Pattyn11-Jun-07 10:39
sitebuilderLuc Pattyn11-Jun-07 10:39 
AnswerRe: Graphic - Exact string sizes Pin
J. Dunlap11-Jun-07 13:13
J. Dunlap11-Jun-07 13:13 
QuestionEvent Firing Pin
tobriain11-Jun-07 8:13
tobriain11-Jun-07 8:13 
AnswerRe: Event Firing Pin
Luc Pattyn11-Jun-07 9:15
sitebuilderLuc Pattyn11-Jun-07 9:15 
GeneralRe: Event Firing Pin
tobriain11-Jun-07 10:11
tobriain11-Jun-07 10:11 
GeneralRe: Event Firing Pin
Luc Pattyn11-Jun-07 10:36
sitebuilderLuc Pattyn11-Jun-07 10:36 
GeneralRe: Event Firing Pin
Leslie Sanford11-Jun-07 10:53
Leslie Sanford11-Jun-07 10:53 
GeneralRe: Event Firing Pin
tobriain11-Jun-07 11:21
tobriain11-Jun-07 11:21 
GeneralRe: Event Firing Pin
Leslie Sanford11-Jun-07 12:03
Leslie Sanford11-Jun-07 12:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.