Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Different ways to p/invoke?

Status
Not open for further replies.

SMURF75

Programmer
Aug 28, 2004
87
GB
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?
Code:
<DllImport("rapi.dll", CharSet:=CharSet.Unicode)> _
        Private Shared Function CeRapiUninit() As Integer
    End Function
Code:
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.
I find it easier to read the latter and would prefer using them, but apparently the declarations differ in more than just looks ;)

- - - - - - - - - - - - - - - - - -
Im three apples high, Im blue, and i most certainly like that cold beer that should be every mans right after a hard days work!
 
Okay so on antoher forum a most kind person informed me about the reason why my samples behaved different... Uninit and UnInit is not really the same... stupid sloppy me I say :)

But the question still remains? Is there any difference in the declarations, or is it just a matter of taste?

- - - - - - - - - - - - - - - - - -
Im three apples high, Im blue, and i most certainly like that cold beer that should be every mans right after a hard days work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top