473,473 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

omg plzzzz help impossible conversion vb--->vb.net

can anyone lend some assistance on how to convert some code to vb.net
from vb5?

in VB5 the code succeeds and the IF statement is processed, in Vb.NET
the code returns error and the msgbox returns an 18 digit error code!

thanks in advance

the code is:

Private Const SE_FILE_OBJECT = 1&
Private Const DACL_SECURITY_INFORMATION = 4&

Private Declare Function GetNamedSecurityInfo Lib "Advapi32.dll" Alias _
"GetNamedSecurityInfoA" _
(ByVal ObjName As String, _
ByVal SE_OBJECT_TYPE As Long, _
ByVal SecInfo As Long, _
ByVal pSid As Long, _
ByVal pSidGroup As Long, _
ByVal pDacl As Long, _
ByVal pSacl As Long, _
ByVal pSecurityDescriptor As Long) As Long

Dim result As Long
Dim pSecDesc As Long
Dim ea As Any
Dim pNewDACL As Long
Dim pOldDACL As Long

result = GetNamedSecurityInfo("c:\test1", SE_FILE_OBJECT, _
DACL_SECURITY_INFORMATION, 0&, 0&, pOldDACL, 0&, pSecDesc)

If result = ERROR_SUCCESS Then
... snip snip snip ...

Else
MsgBox("GetNamedSecurityInfo failed with error code : " & result)
End If
Jul 21 '05 #1
2 1449
Hi Isaac,

There are newsgroups

microsoft.public.dotnet.languages.vb (one of the three most active dotnet
newsgroups), there is also a newsgroup
microsoft.public.dotnet.languages.vb.upgrading (however very inactive)

I would ask this question if mine does not solve your problem there.

My answer is in this always the same, have first a look in this page

http://msdn.microsoft.com/library/de...l/win32map.asp

Finding an equivalent dotnet method will save you from problems in future,
(Think also on 64bit systems).

(The quicker answer is that a long in VB is an integer in VB.net)

I hope this helps?

Cor
Jul 21 '05 #2
chrz for the reply

hmmmm i did try using Integers instead of Longs, but i got overflows all
over the place at build time...

also, the reason i am keen to use GetNamedSecurity and
SetNamedSecurityInfo calls is that they can set permissions on AD
Objects (my example is OU's and Exchange Address Lists) as well as
Files, and even shares.

thanks for the www link i'll check it out, and ill make my umpteenth
shift to another newsgroup!!!

Cor Ligthert wrote:
Hi Isaac,

There are newsgroups

microsoft.public.dotnet.languages.vb (one of the three most active dotnet
newsgroups), there is also a newsgroup
microsoft.public.dotnet.languages.vb.upgrading (however very inactive)

I would ask this question if mine does not solve your problem there.

My answer is in this always the same, have first a look in this page

http://msdn.microsoft.com/library/de...l/win32map.asp

Finding an equivalent dotnet method will save you from problems in future,
(Think also on 64bit systems).

(The quicker answer is that a long in VB is an integer in VB.net)

I hope this helps?

Cor

Jul 21 '05 #3

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

Similar topics

30
by: Tim Johansson | last post by:
I'm new to C++, and tried to start making a script that will shuffle an array. Can someone please tell me what's wrong? #include <iostream.h> #include <string.h> int main () {...
22
by: kalio80 | last post by:
Hi everyone I am trying to create a file that converts text files from unix to windows and windows to unix I understand the general concept of it as unix uses line feed LF Windows uses CRLF...
3
by: BigMan | last post by:
Here is a piece of code: #include <memory> using namespace std; template< typename SomeType > void f(auto_ptr_ref< SomeType >) { }
23
by: Matt Garman | last post by:
Is there a clean, portable way to determine the maximum value of converted numerical fields with printf()-like functions? Doing this at compile-time would be preferable. For example, %i should...
3
by: Egbert Nierop \(MVP for IIS\) | last post by:
Example... This would make that i can assign a ULONG to a CComBSTR2 class while the body of the code performs necessary conversion. CComBSTR2& operator=(ULONG ulong) {
4
by: isaac rainsford (MCSE) | last post by:
can anyone lend some assistance on how to convert some code to vb.net from vb5? in VB5 the code succeeds and the IF statement is processed, in Vb.NET the code returns error and the msgbox...
5
by: Pavils Jurjans | last post by:
Hello, I am somewhat lost in the implicit/expicit possible/impossible type casting in C#... I need to write a class, which among other things, must have wat to read a numeric value type, and...
5
by: shakthi | last post by:
Hi all, Am new to MFC appilcation programming.Plese tell me how to display a file with its path that is chosen from a file dialog.Am trying to create a dialog box displaying a list of...
11
by: 1230987za | last post by:
Hi, I am totally confused now about C type conversion. I know that C does some implicit type conversion like integer promotion and float to double. I imagine that such conversion must keep the...
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
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...
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,...
0
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
muto222
php
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.