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

any help from any c# guru

any help from any c# guru,

[DllImport("somedll.dll")]public static extern void GenerateKeys(int algo,
int len, [MarshalAs(UnmanagedType.BStr)] out string
privKey,[MarshalAs(UnmanagedType.BStr)] out string
pubKey,[MarshalAs(UnmanagedType.BStr)] out string
dsPrivKey,[MarshalAsUnmanagedType.BStr)] out string dsPubKey);

can someone pls convert this c# snippet into vb.net
Nov 20 '05 #1
4 1453
Cor
Hi Kerberoz,
I am not a guru but here are some links, I think you can do it yourself with
this.

http://www.kamalpatel.net/ConvertCSharp2VB.aspx

http://csharpconverter.claritycon.com/Default.aspx

http://www.ragingsmurf.com/vbcsharpconverter.aspx

http://www.aspalliance.com/aldotnet/...translate.aspx

http://www.gotdotnet.com/Community/U...7-979975d5957d

I hope this helps?

Cor
[DllImport("somedll.dll")]public static extern void GenerateKeys(int algo,
int len, [MarshalAs(UnmanagedType.BStr)] out string
privKey,[MarshalAs(UnmanagedType.BStr)] out string
pubKey,[MarshalAs(UnmanagedType.BStr)] out string
dsPrivKey,[MarshalAsUnmanagedType.BStr)] out string dsPubKey);

can someone pls convert this c# snippet into vb.net

Nov 20 '05 #2
Hi

1. Replace all square brackets with angle brackets (the VB .NET syntax for
attributes)
2. Replace out with ByRef
3. Add necessary Imports statemets (like Imports
System.Runtime.InteropServices)

You'll get something like:

<DllImport("somedll.dll")> _
Public Shared Sub GenerateKeys(ByVal algo As Integer, _
ByVal len As Integer, _
<MarshalAs(UnmanagedType.BStr)> ByRef privKey As String, _
<MarshalAs(UnmanagedType.BStr)> ByRef pubKey As String, _
<MarshalAs(UnmanagedType.BStr)> ByRef dsPrivKey As String, _
<MarshalAsUnmanagedType.BStr)> ByRef dsPubKey As String)

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"kerberoz" <de****@hotmail.com> wrote in message
news:eL**************@TK2MSFTNGP11.phx.gbl...
any help from any c# guru,

[DllImport("somedll.dll")]public static extern void GenerateKeys(int algo,
int len, [MarshalAs(UnmanagedType.BStr)] out string
privKey,[MarshalAs(UnmanagedType.BStr)] out string
pubKey,[MarshalAs(UnmanagedType.BStr)] out string
dsPrivKey,[MarshalAsUnmanagedType.BStr)] out string dsPubKey);

can someone pls convert this c# snippet into vb.net


Nov 20 '05 #3

Public Shared<DllImport("somedll.dll")> _
Sub GenerateKeys(algo As Integer, len As Integer,
ByRef<MarshalAs(UnmanagedType.BStr)> privKey As String,
ByRef<MarshalAs(UnmanagedType.BStr)> pubKey As String,
ByRef<MarshalAs(UnmanagedType.BStr)> dsPrivKey As
String,<MarshalAsUnmanagedType.BStr()> __unknown As __unknown)
Dim dsPubKey As String '
'ToDo: Error processing original source shown below
'
'
'---------------------------------------^--- Syntax error: ']' expected
'
'ToDo: Error processing original source shown below
'
'
'----------------------------------------^--- Syntax error: '{' expected
'
'ToDo: Error processing original source shown below
'
'
'------------------------------------------^--- expression expected
'
'ToDo: Error processing original source shown below
'
'
'-------------------------------------------------------------^--- Syntax
error: ';' expected
'
'ToDo: Error processing original source shown below
'System.Char[]
'^--- Syntax error: '}' expected
End Sub 'GenerateKeys

kerberoz wrote:
any help from any c# guru,

[DllImport("somedll.dll")]public static extern void GenerateKeys(int
algo, int len, [MarshalAs(UnmanagedType.BStr)] out string
privKey,[MarshalAs(UnmanagedType.BStr)] out string
pubKey,[MarshalAs(UnmanagedType.BStr)] out string
dsPrivKey,[MarshalAsUnmanagedType.BStr)] out string dsPubKey);

can someone pls convert this c# snippet into vb.net

Nov 20 '05 #4
Public Shared<DllImport("somedll.dll")> _
Sub GenerateKeys(algo As Integer, len As Integer,
ByRef<MarshalAs(UnmanagedType.BStr)> privKey As String,
ByRef<MarshalAs(UnmanagedType.BStr)> pubKey As String,
ByRef<MarshalAs(UnmanagedType.BStr)> dsPrivKey As String,
ByRef<MarshalAs(UnmanagedType.BStr)> dsPubKey As String)
Nov 20 '05 #5

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

Similar topics

11
by: Mike Cox | last post by:
After writing an article trashing java, and C++, notable LISP guru Paul Graham is getting roasted on slashdot. Apart from AutoCAD and Emacs, what has LISP done anyway? Most real work is done in...
2
by: rmn | last post by:
Hi, I'm looking for the translation betwen the color spaces, but I must be mistaken with the methods to use, losing the values. Please, I need a little help of a "coloured guru"....
4
by: Accolo1 | last post by:
Help we are looking for this person, do you know them? William wjohnson@accolo.com Title: BEA WebLogic Portal Guru Job #: 03-04468 Check the pulse of your career! Evolve our eCommerce web...
3
by: Michael Suess | last post by:
Hi, please feel free to correct me if this is the wrong group to ask this question. I have a blog about parallel programming and concurrency (http://www.thinkingparallel.com if you are...
21
by: lesperancer | last post by:
I've got an access97 reporting mdb that pulls data (77,000 rows) from a sql server table into a local table to run reports if the local table is part of the reporting MDB, the insert statement...
16
by: Singulus | last post by:
Hello all, I've searched for similar threads, I've found some bit of useful info here and there, but nevertheless I want to post my questions...So, how can I (we, in fact the forum can benefit...
1
by: stevenjs | last post by:
Greeings, all, Flash 8 has quiz templates which are coded for multiple choice, true/false, text statement, and matching types of questions, along with hotspots and probably anoher type I am...
27
by: Tak | last post by:
Exercise 1-9. Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank. Exercise 1-10. Write a program to copy its input to its output,...
204
by: Masood | last post by:
I know that this topic may inflame the "C language Taleban", but is there any prospect of some of the neat features of C++ getting incorporated in C? No I am not talking out the OO stuff. I am...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...

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.