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

Migrating VarPtr from VB6 to VB.NET

Al
Hi

I am converting VB6 to VB. Net it is refereeing to DLL as follow. I am not
sure how I can convert it to VB.Net statement.

Declare Function Chain_DES Lib "chaindes.dll" (ByRef Data As Any, ByRef key
As Any, ByVal TripleDES As Short, ByVal Blocks As Integer, ByVal method As
Integer) As Integer

Appreciate any suggestions, I tried substituting Object for Any, well it
compiles but program doesn’t function correctly.
Thanks

Al

Nov 21 '05 #1
1 3366
Al,
Consider using overloading.

If Chain_DES allows being called with either an Integer as Data or a String
as Data, then I would define 2 overloads. Something like:
Declare Function Chain_DES Lib "chaindes.dll" (ByRef Data As Integer,
ByRef key
As Any, ByVal TripleDES As Short, ByVal Blocks As Integer, ByVal method As
Integer) As Integer
Declare Function Chain_DES Lib "chaindes.dll" (ByRef Data As String, ByRef
key
As Any, ByVal TripleDES As Short, ByVal Blocks As Integer, ByVal method As
Integer) As Integer

It really depends on what actual types are accepted by the Data & key
parameters as to how to get your Declare statements to work.

Another alternative, with possibly more work, and possibly more crashes, is
to use a System.IntPtr and the members of
System.Runtime.InteropServices.Marshal. Again what actual types are accepted
by the Data & key parameters as to how to get IntPtr to work...

Hope this helps
Jay
"Al" <Al@discussions.microsoft.com> wrote in message
news:04**********************************@microsof t.com... Hi

I am converting VB6 to VB. Net it is refereeing to DLL as follow. I am not
sure how I can convert it to VB.Net statement.

Declare Function Chain_DES Lib "chaindes.dll" (ByRef Data As Any, ByRef
key
As Any, ByVal TripleDES As Short, ByVal Blocks As Integer, ByVal method As
Integer) As Integer

Appreciate any suggestions, I tried substituting Object for Any, well it
compiles but program doesn't function correctly.
Thanks

Al

Nov 21 '05 #2

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

Similar topics

0
by: Zvika Glickman | last post by:
I'm migrating DB2 to ORACLE 9I. In the DB2 schema each table defined in diferrent tablespace. Few tablespaces are define on the same STOGROUP (there are few STOGROUP). It's a big db (few terra...
0
by: steve | last post by:
I am having huge problems migrating large db’s from one server to another. I use phpmyadmin to dump the data into a file, and then migrate it to my production server. Then I try to use this:...
4
by: Bernardo Robelo | last post by:
Hi, I am interested in migrating Microsoft Access database to Postgres database. But I do not have idea of like initiating. Maybe some tool exists for this problem. Thanks you. Bernardo
4
by: Juan | last post by:
I'm migrating a VB.Net app to c# and found the following: Private m_State(,) As Integer If anyone knows what is the analogous in c#... is it an array? Thanks, Juan.
6
by: Shai Levi | last post by:
Hi, I'm trying to migrate native c++ class to managed c++ class. The native class header definition looks as: class NativeClass { public: typedef void (CbFunc1)(int n,void* p);
3
by: BobRoyAce | last post by:
I would really appreciate recommendations for sources of materials on migrating ASP applications to ASP.NET (books, URL's, etc.). Also, is there a magazine that is particularly good for .NET stuff....
5
by: Vincent | last post by:
I have a couple of questions about the VarPtr() function of VBA. I have created my own class, lets call it MyObject and in one of my modules, I have declared an array of type MyObject. In my...
1
by: DaveS | last post by:
Hi, Is there an easy way to convert the following piece of VB6 code to VS2005? myBuffer = VarPtr(lana) TIA, Dave
34
by: subramanian100in | last post by:
Is there any difference between porting and migrating. Kindly explain
2
by: Jerry West | last post by:
I have the following code and was wondering what the .NET equivalent is for VarPtr & ByVal....it seems .NET also dislikes ByVal in this code. Perhaps it is now redundant? Any help appreciated! ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...

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.