Supress error/warning of winapi in class?

E

Edwin Knoppert

I have this error:

Warning 1 Access of shared member, constant member, enum member or nested
type through an instance; qualifying expression will not be evaluated....

This because i have a call in a win32 dll:
Public Declare Ansi Function TheCall Lib "MyDll.DLL" Alias "TheCall" (ByVal
szKey As String) As Int32

Option Explict or Strict don't do anything here.

I'm looking for a solution hopefully placed in the class itself if possible.
The call is executed through the dimensioned class var.

??
 
B

Bruce Barker

you are referencing a static method from an instance rather than its class.
use ClassName.MethodName (class referenece), not myObj.MethodName (instance
reference)

-- bruce (sqlwork.com)
 
E

Edwin Knoppert

Hey, thanks, thought the declares where not public, brain-dead of course.
It says: PUBLIC :)

To bad i couldn't reuse my WITH statement with these calls.
I swapped it for the dimmed object but MS does not like that :)

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top