NewState parameter

Interested in developing new plug-ins? Got one to share? Post here!
markm
Posts: 4
Joined: Fri Oct 07, 2005 2:50 pm

NewState parameter

Postby markm » Fri Oct 07, 2005 2:59 pm

this is probably because i'm only a c++ novice, but i'm confused on the NewState parameter. the c++ plug-in template produces this prototype:

Code: Select all

int WINAPI DesignTimeEdit(
        int Window,
        const char* State,
        const char* NewState
);


the docs say to copy my buffer to NewState on the second call, but how does one modify a const? i was only able to make this work by modifying the def to:

Code: Select all

int WINAPI DesignTimeEdit(
        int Window,
        const char* State,
        char* NewState
);


which works fine... but i was curious how you are able to make it work with the prototype provided... i asked some more knowledge programmers and they didn't understand it either so please enlighten us!

sinan
Site Admin
Posts: 1020
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Fri Oct 07, 2005 6:49 pm

This is certainly a bug in the template generated code. Thank you for pointing this out. I will have this corrected immediately. Your revised declaration is correct.

Guest

Postby Guest » Sat Oct 08, 2005 8:22 am

Well at least that means I'm not as crazy as previously thought. It's also worth pointing out that the same declaration exists in the documentation (which is why I didn't think it was a mistake to begin with).

Thanks for the quick response!

sinan
Site Admin
Posts: 1020
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Sat Oct 08, 2005 5:45 pm

Yes, both the documentation and the template project were wrong. Both have been fixed. Thanks for pointing this out :)


Return to “Plug-In Development”

Who is online

Users browsing this forum: No registered users and 37 guests