Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3406406
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:37:26+00:00 2026-05-18T05:37:26+00:00

In one STATIC class (my helper class named AutoItX3Delcarations.cs ) i have wrapped up

  • 0

In one STATIC class (my helper class named AutoItX3Delcarations.cs) i have wrapped up a dll like so:

//AU3_API void WINAPI AU3_Send(LPCWSTR szSendText, /*[in,defaultvalue("")]*/long nMode);
        [DllImport("AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
        static public extern void AU3_Send([MarshalAs(UnmanagedType.LPWStr)] string SendText, int Mode);

Basically, creating a static method within a static class.

Now, in my main program execution I attempt to perform this method like so:

 AutoItX3Declarations.AU3_Send("Test Text", 1); 

which, by the MSDN should work…? But it doesn’t! I have attempted to search through here and on google for about an hour but can’t see why this isn’t working.. I am calling the method by using it’s class as the location and then the function as brought in by DLL import.

The error i get is "....AU3_Send(string,int)' is a 'method' but is used like a 'type' " ...

But how am i using it as a type?? I thought this is how you correctly call a static method?

Please help 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:37:27+00:00Added an answer on May 18, 2026 at 5:37 am

    Are you sure your method call is within the body of a method? If you could post the surrounding code, that would help.

    For example, this should compile fine:

    static void Foo()
    {
        AutoItX3Declarations.AU3_Send("Test Text", 1);
    }
    

    I suggest you try that, just to confirm that it really is the call context rather than the method declaration which is causing the problem (although I fully expect that’s the case).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes, and want to include a static instance of one class
How does one go about referencing a class's static properties in xaml? In other
Let's say you've inherited a C# codebase that uses one class with 200 static
I have two threads, one needs to poll a bunch of separate static resources
I have a Person and an Organisation Entity: Person looks like this: public class
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
My question is about one particular usage of static keyword. It is possible to
I'm trying to write a static member function in C# or find one in
I have a re-occurring design problem with certain classes which require one-off initialization with
I have an enumeration like Enum Complexity { NotSoComplex, LittleComplex, Complex, VeryComplex } And

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.