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

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
Nov 20 '05 #1
4 969
Hi Isaac,

You did not change that "long", when you do not change it that will be the
answers you get.

Cor
Nov 20 '05 #2
Hi Isaac,

I did not look in the general group before I was sending this, however see
this thread

http://tinyurl.com/yq6q8

Than you see what I mean.

Cor
Nov 20 '05 #3
* "isaac rainsford (MCSE)" <ro****@dr.com> scripsit:
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!


The code must be converted to VB.NET first. Sample code can be found
here:

<URL:http://groups.google.de/groups?selm=p287w1KWCHA.2084%40cpmsftngxa10>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
chrs again! i've changed the Long's to Int32's... i did not know of
Int32 before...

previously, the error code would increase by a few billion every time i
clicked on my button "Command1"... now the error code is static and it
is 87... how should i go about finding what the error code means?

isaac.

Cor Ligthert wrote:
Hi Isaac,

I did not look in the general group before I was sending this, however see
this thread

http://tinyurl.com/yq6q8

Than you see what I mean.

Cor

Nov 20 '05 #5

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

Similar topics

11
by: Faheem Mitha | last post by:
Hi, I'm not sure what would be more appropriate, so I'm ccing it to both alt.comp.lang.learn.c-c++ and comp.lang.python, with followup to alt.comp.lang.learn.c-c++. While working with a...
2
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...
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) {
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.