473,513 Members | 6,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is New needed? Dim lPF2 = New PARAFORMAT2

The below seems to work. But I just saw similar code the did:
Dim lPF2 = New PARAFORMAT2
Now I'm wondering, do I need the New?
If not, why not?

Thanks

Dim lPF2 As PARAFORMAT2
lPF2.dwMask = RichEdit.PFM_SPACEBEFORE Or RichEdit.PFM_SPACEAFTER
lPF2.cbSize = Marshal.SizeOf(lPF2)
lPF2.dySpaceAfter = 1440 * lSpaceAfter
lPF2.dySpaceBefore = 1440 * lSpaceBefore
SendMsg(hwnd, EM_SETPARAFORMAT, 0, lPF2)
Nov 21 '05 #1
4 2033
" Just Me" <gr****@a-znet.com> schrieb:
The below seems to work. But I just saw similar code the did:
Dim lPF2 = New PARAFORMAT2
Now I'm wondering, do I need the New?


'PARAFORMAT2' is a structure and structures value types. You only need
'New' if you are calling a non-parameterless constructor of the structure.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
> 'PARAFORMAT2' is a structure and structures value types. You only need
'New' if you are calling a non-parameterless constructor of the structure.


I think I read, that New should be called even for
Structures. As a matter of good practice.
Roger
Nov 21 '05 #3
thanks
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
" Just Me" <gr****@a-znet.com> schrieb:
The below seems to work. But I just saw similar code the did:
Dim lPF2 = New PARAFORMAT2
Now I'm wondering, do I need the New?


'PARAFORMAT2' is a structure and structures value types. You only need
'New' if you are calling a non-parameterless constructor of the structure.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4
"Roger" <ro***@pcsrevenuecontrol.com> schrieb:
'PARAFORMAT2' is a structure and structures value types. You only need
'New' if you are calling a non-parameterless constructor of the
structure.


I think I read, that New should be called even for
Structures. As a matter of good practice.

Sematically there is no difference in whether you use 'New' in this
situation or not. Do you really always type 'Dim i As New Integer'?!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5

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

Similar topics

0
2762
by: System | last post by:
Hello All, Redhat 9.0 Mysql 3.23.56 ==> Running I want to upgarde to 4.0.13 but this is the error it says: # rpm -Uvh MySQL-server-4.0.13-0.i386.rpm warning: MySQL-server-4.0.13-0.i386.rpm: V3...
8
1588
by: Stephen | last post by:
I am trying to add some code to below to include a datatable and fill the datatable. The reason for doing this is so as I can check to see whether there are any rows returned by the stored...
13
1721
by: Joe Feldman | last post by:
This position is located in the South Bay Area in Northern California. If you are interested please send me your resume in a word .doc so that I can review it. If this does not look like a match,...
0
1780
by: Cindy B | last post by:
Please send your resume and position to Cindy@AtlanticResource.com! I CAN NOT accept candidates that ARE OUTSIDE OF THE US! NO PHONE CALLS PLEASE! Email your resume to me! Position:SQL...
3
2236
by: Wade | last post by:
I would like to install the .Net 1.1 framework on a Web Server running W2K to be able to run ASP.NET files, but I'm not sure where to find the files I need for the .Net framework. I have ".NET...
5
1698
by: Steve | last post by:
Hi, I am sitting down to design our next set of internal apps. I would like to approach this in a way that would allow me to break logical parts of the application that handle specific tasks...
0
1453
by: ultradiv | last post by:
I have a VB.NET application partly built that produces an xml output (just a file at present) I have a .NET webserver and SQLserver 2000 I need to be able to send the xml to the webserver/database...
28
1908
by: Ian Davies | last post by:
Hello I would appreciate some help from someone who has knowledge of working with css, php javascript and how they interact. Ive been working on a task for the last few days and have started to...
37
2364
by: C_guy | last post by:
Does anyone know of a (hopefully free) tool that can traverse a project and determine which "#include"s are not needed or needed in every .C file? This would be helpful in removing header...
0
7153
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
7373
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
7519
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
5677
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,...
0
4743
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...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
796
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.