473,396 Members | 2,029 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.

Help with CSharp syntax [xxx()] and ~xxxx() ???

I have two intro books that all of sudden jump into programs with the
following syntax:

[DLLImport("dll.dll")]
static etern int GetWindowsResource();

and

~ResourceWrapper()
{
Dispose(false);
}

Can sombody tell me what is [] and ~ telling the compiler?

Aug 30 '06 #1
1 1279
Hi,

[] indicates an attribute. The DllImport attribute is used when
calling an unmanaged DLL function from managed code (see also
"P/Invoke"). Here's an MSDN link:

http://msdn.microsoft.com/library/de...ClassTopic.asp

~ indicates a class finalizer (similar to a C++ destructor, or
Class_Terminate if you're familiar with VB). Here's an MSDN link:

http://msdn.microsoft.com/library/de...alizetopic.asp

John

we*******@1stmiami.com wrote:
I have two intro books that all of sudden jump into programs with the
following syntax:

[DLLImport("dll.dll")]
static etern int GetWindowsResource();

and

~ResourceWrapper()
{
Dispose(false);
}

Can sombody tell me what is [] and ~ telling the compiler?
Aug 30 '06 #2

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

Similar topics

4
by: Andy | last post by:
I have the following script to send my website form. The problem is when the form is submitted it sends a blank form Can anyone advise how i get the below to include the contents of all the...
5
by: adolf garlic | last post by:
Im trying to return xml from sql. The xml is made up of different fragments, some using FOR XML ... syntax. The result is a valid xml doc. There is a working stored proc that returns the xml In...
7
by: Gb | last post by:
Hi There, I have: select myTable.*, Case When myTable.problem_CLOSE_date = myTable.problem_creation_date then 2 When myTable.problem_CLOSE_date >0 and myTable.problem_status='C' then 3...
0
by: Disccooker | last post by:
hi, i am trying to serialize the following class : namespace MyNameSpace { public class StationData { public Station Station; }
0
by: Josema | last post by:
Hi, Im making an asyncronous application that will detect broken links inside a web site. the question is that i have a tree view in my windows form application, and when a person enters a...
8
by: gmclee | last post by:
Hi there, I need a program to extract a substring from the following pattern xxxx<XXXXX>xxxx therer, x and X are any character and the string between < and is what I need. I use the following...
4
by: i m gr8 | last post by:
Hello, I need to make a pyramid 20 lines long showing Xs like this: X XX XXX XXXX and so on . I have made this code so far:
6
by: freeskier | last post by:
Hello, I have a text field used for phone numbers. Unfortunately many have been entered in different formats. For example, some are (xxx) xxx-xxxx, some are (xxx)xxx-xxxx, and some are xxxxxxxxxx....
1
by: cmc12 | last post by:
Hi, I want to open MqSQL and run a command using a DOS batch script like this, it runs but doesn't update dB. any ideas is the command line tag -e correct? mysql -e "USE <database name" -e...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
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...

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.