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

Declaring p/invokes different ways?

Hi!

I'd like for someone to please explain something about p/invoking that i
havent managed to find out else where.

I believe that following two snippets both are p/invokes?
<DllImport("rapi.dll", CharSet:=CharSet.Unicode)> _
Private Shared Function CeRapiUninit() As Integer
End Function
Private Declare Unicode Function CeRapiUnInit Lib "rapi.dll" () As Integer

The only difference I know of is that the latter one does not work in my
code, and throws an entrypointnotfound exception. There are on the other hand
other functions such as CeRapiInit that works with both declarations.
I find it easier to read the latter and would prefer using them, but
apparently the declarations differ in more than just looks ;)
Jul 28 '05 #1
2 1411
On 2005-07-28, smurf75 <sm*****@discussions.microsoft.com> wrote:
Hi!

I'd like for someone to please explain something about p/invoking that i
havent managed to find out else where.

I believe that following two snippets both are p/invokes?
<DllImport("rapi.dll", CharSet:=CharSet.Unicode)> _
Private Shared Function CeRapiUninit() As Integer
End Function
Private Declare Unicode Function CeRapiUnInit Lib "rapi.dll" () As Integer

^

If this was a copy and past operation... Do you see the error?
--
Tom Shelton [MVP]
Jul 28 '05 #2


"Tom Shelton" wrote:
On 2005-07-28, smurf75 <sm*****@discussions.microsoft.com> wrote:
Hi!

I'd like for someone to please explain something about p/invoking that i
havent managed to find out else where.

I believe that following two snippets both are p/invokes?
<DllImport("rapi.dll", CharSet:=CharSet.Unicode)> _
Private Shared Function CeRapiUninit() As Integer
End Function
Private Declare Unicode Function CeRapiUnInit Lib "rapi.dll" () As Integer

^

If this was a copy and past operation... Do you see the error?
--
Tom Shelton [MVP]


Thanks a lot for letting me know Im sloppy ;)

But the question still remains, just out of curiosity. Are there any
differences between the declarations or can I use which ever I like best?
Jul 28 '05 #3

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

Similar topics

2
by: lou zion | last post by:
hi all, i've got a class that takes a parameterless function pointer as a parameter. i want to store that function pointer in a variable and i'm trying to figure out the syntax. i came up with...
16
by: G Patel | last post by:
Hi, If I want to call functions that don't return int without declaring them, will there be any harm? I only want to assign the function(return value) to the type that it returns, so I don't...
2
by: smurf75 | last post by:
Hi! I'd like for someone to please explain something about p/invoking that i havent managed to find out else where. I believe that following two snippets both are p/invokes? ...
1
by: ctor | last post by:
Hi, I'm experimenting with using a lot of different namespaces in my current project to see if it helps me keep my code more organized. In some ways I'm finding that it causes more problems...
2
by: Barkster | last post by:
Which one of these is the proper or suggested way to declare session variables. I've seen so many different ways but when I use session_register the pages are way slower. 1....
2
by: pagekb | last post by:
Hello, I'm having some difficulty compiling template classes as containers for other template objects. Specifically, I have a hierarchy of template classes that contain each other. Template...
12
by: gcary | last post by:
I am having trouble figuring out how to declare a pointer to an array of structures and initializing the pointer with a value. I've looked at older posts in this group, and tried a solution that...
16
by: dejavu33 | last post by:
Hi! I dont understand arrays very much. Im trying to create an array of up to 100 positive numbers with the use of -1 to stop entering if the user needs an array containing less than 100...
8
by: bintom | last post by:
What are the differences between the following methods of declaring strings? char string1 = "C++ forum"; char* string2 = "C++ forum"; I know that the first uses the array notation, whereas...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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.