473,378 Members | 1,447 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,378 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 1409
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.