Re: DllImport

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



How does it make it harder to reuse, change and read?

Sometimes you want to use the entrypoint clause as you might want to name
the method something more meaningful to your application. Or you might want
to make it more unstandable as some old legacy unmanaged API calls are not
very intutive.

I think the final square bracket is a typo.

Simon.

"Gorm Braarvig" <gorm_b@xxxxxxxxxxx> wrote in message
news:%23gR8Z05bGHA.4716@xxxxxxxxxxxxxxxxxxxxxxx
D could have been possible, but C is definitely the better answer since
it tells the compiler which function to use as entry point. Also, it is
more useful if you want to rename the function.


I disagree, since it makes the code harder to maintain.
In my exp saying the same thing twice makes the code harder to reuse,
change and read.

BTW. What is the function of the last closing bracket?

<snippety>
[DllImport("user32.dll")]
public static extern string CallMe (string Name, string
Address, string Phone)];
</snipp>




.



Relevant Pages

  • Re: SMTPClient Authentication problems
    ... You can download the code and reuse the library ... ... public void SendMail(string fromAddress, string toAddress, string subject, ... string body, string Password) ... SmtpClient smtp = new SmtpClient; ...
    (microsoft.public.dotnet.general)
  • Re: Fastcode AnsiStringReplace B&V 0.4
    ... > challenges, the RTL replacement and procedure equivalent, such as ... > parameter and return a string result, ... The AnsiStringReplace challenge allows reuse of functions such as UpperCase, ... fast functions for the Delphi community ) and MakeUpperCase, ...
    (borland.public.delphi.language.basm)
  • Re: Why is lambda allowed as a key in a dict?
    ... is the same an an existing string does not necessarily result in reuse of the existing string but mey result in creation of a new, ... On the other hand, identifiers are almost always reused, often multiple times.. ... Similarly, if one is populating a LARGE structure with duplicate values, it may be worthwhile to cache values that are not cached by the interpreter. ...
    (comp.lang.python)
  • Re: String Functions
    ... > in my experience) usage of the IntToStr function. ... > effects of string "reuse". ... If you reuse the output of one function as the input to ...
    (borland.public.delphi.language.basm)
  • Re: Infos about components and code reuse
    ... class like 'String' gets reused all the time. ... Folks think they need ... "the use of a component-based methodology to ensure that component reuse ... is a standard part of the software development process. ...
    (comp.object)