Declaring p/invokes different ways?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 ;)
 
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 said:
^

If this was a copy and past operation... Do you see the error?

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?
 
Back
Top