473,397 Members | 1,950 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,397 software developers and data experts.

How to link to a dll in vb.net

I have a DLL that I would like to use in VB.NET but I am not sure how to
link to it. It is called PerlinDLL.dll and is a dll that spits out a bitmap
of a fractal image.(link:
http://www.stanford.edu/~jjshed/perlin/index.html ) I do have the code that
I believe allows a C# program hook to it, but I do not know how to do it in
VB.NET. Where does the dll need to reside? system32 directory? My programs
bin directory?

Here is the C# code:

[DllImport("PerlinDLL.dll")]
static extern unsafe void TestBMP(void* ARGB32_pixels, int w, int h);
[DllImport("PerlinDLL.dll")]
static extern unsafe void GeneratePerlinTexture(void *ARGB32_pixels, int
w, int h);
[DllImport("PerlinDLL.dll")]
static extern void SetPerlinVars(float init_freq, float init_amp, float
persistance, int octaves, int random_seed);
[DllImport("PerlinDLL.dll")]
static extern void SetLinearInterpolation();
[DllImport("PerlinDLL.dll")]
static extern void SetCosineInterpolation();
[DllImport("PerlinDLL.dll")]
static extern void SetCubicInterpolation();
[DllImport("PerlinDLL.dll")]
static extern void InitializePalette(int r1, int g1, int b1, int r2, int
g2, int b2);
[DllImport("PerlinDLL.dll")]
static extern void AddColor(float pos, int r, int g, int b);
[DllImport("PerlinDLL.dll")]
static extern int GetColor(float f);
[DllImport("PerlinDLL.dll")]
static extern void SetClampAbs();
[DllImport("PerlinDLL.dll")]
static extern void SetClampTruncate();
[DllImport("PerlinDLL.dll")]
static extern void SetClampNormalize();
[DllImport("PerlinDLL.dll")]
static extern void SetOutputFlat();
[DllImport("PerlinDLL.dll")]
static extern void SetOutputTileable();
[DllImport("PerlinDLL.dll")]
static extern void SetOutputSphereMapped();

What is the vb.net equivilant?

Thank you so much!

Chris
Nov 21 '05 #1
1 2384
Hi,

http://msdn.microsoft.com/library/de...indowsAPIs.asp

Ken
--------------
"Chris" <jo*@shmoe.com> wrote in message
news:Ob**************@TK2MSFTNGP14.phx.gbl...
I have a DLL that I would like to use in VB.NET but I am not sure how to
link to it. It is called PerlinDLL.dll and is a dll that spits out a bitmap
of a fractal image.(link:
http://www.stanford.edu/~jjshed/perlin/index.html ) I do have the code that
I believe allows a C# program hook to it, but I do not know how to do it in
VB.NET. Where does the dll need to reside? system32 directory? My programs
bin directory?

Here is the C# code:

[DllImport("PerlinDLL.dll")]
static extern unsafe void TestBMP(void* ARGB32_pixels, int w, int h);
[DllImport("PerlinDLL.dll")]
static extern unsafe void GeneratePerlinTexture(void *ARGB32_pixels, int
w, int h);
[DllImport("PerlinDLL.dll")]
static extern void SetPerlinVars(float init_freq, float init_amp, float
persistance, int octaves, int random_seed);
[DllImport("PerlinDLL.dll")]
static extern void SetLinearInterpolation();
[DllImport("PerlinDLL.dll")]
static extern void SetCosineInterpolation();
[DllImport("PerlinDLL.dll")]
static extern void SetCubicInterpolation();
[DllImport("PerlinDLL.dll")]
static extern void InitializePalette(int r1, int g1, int b1, int r2, int
g2, int b2);
[DllImport("PerlinDLL.dll")]
static extern void AddColor(float pos, int r, int g, int b);
[DllImport("PerlinDLL.dll")]
static extern int GetColor(float f);
[DllImport("PerlinDLL.dll")]
static extern void SetClampAbs();
[DllImport("PerlinDLL.dll")]
static extern void SetClampTruncate();
[DllImport("PerlinDLL.dll")]
static extern void SetClampNormalize();
[DllImport("PerlinDLL.dll")]
static extern void SetOutputFlat();
[DllImport("PerlinDLL.dll")]
static extern void SetOutputTileable();
[DllImport("PerlinDLL.dll")]
static extern void SetOutputSphereMapped();

What is the vb.net equivilant?

Thank you so much!

Chris

Nov 21 '05 #2

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

Similar topics

3
by: Matt Adams | last post by:
As well known I could specify the text color in the body tag like: <BODY TEXT=WHITE LINK=WHITE VLINK=RED ALINK=WHITE> What I want to achieve now is that always (!) the text of the last visited...
26
by: Harrie | last post by:
Hi, After Brian mentioned the use for <link rel=..> for navigational purposes in another thread, I've been looking into it and found that HTML 3.2 has two other recognized link types than HTML...
4
by: Franklin | last post by:
WITHOUT KNOWING ANYTHING ABOUT THE CURRENT COLORS, I want to swap the foreground/background colors of a link when someone hovers over it. Is this possible with HTML, CSS, DOM, & JavaScript? If...
8
by: sudhirlko2001 | last post by:
How to swap two nodes of doubly Linklist
14
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant...
1
by: sri2097 | last post by:
Hi all, I have written a Link list implementation in Python (Although it's not needed with Lists and Dictionaries present. I tried it just for the kicks !). Anyway here is the code - # Creating...
8
by: Steve | last post by:
Hi; I had a big link checking job to do and it has been years since I have done anything like that so I found a test page to use that I knew had bad links on it( a friends site ) and I decided...
7
by: gehegeradeaus | last post by:
Can someone help me to make a regular expression for this sort of replacement : text with {link:pagehref}a link{/link}. replace to -> text with <a href="pagehref">a link</a> I tried...
7
by: Kurda Yon | last post by:
Hi everybody, I cannot understand the following thinks. The last line of the fillowing code produces a message about mistake (not a valid MySQL- Link resource): $link = mysql_connect(...
4
by: perryche | last post by:
Is this possible? Instead of using the link wizard, can the FE/BE link be established any other way that users can simply type the link path? Thanks, Perry
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: 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
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.