flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 20 Jan 2008, 20:04
impossible. proper way is to define IDD_DIALOG as LPCSTR directly:
Code: #define IDD_DIALOG1 (LPCSTR)1001 |
|||
![]() |
|
dap 20 Jan 2008, 20:40
Try to use this : http://msdn2.microsoft.com/en-us/library/ms648029.aspx
[Edit] In C it's possible to remove the type checking, just don't give any prototype : Code: void f (); int main (void) { f(1), f(2.0), f((void*)NULL); return 0; } void f () { } I guess there is something similar in C++ but if so I don't recommend you to use it. |
|||
![]() |
|
f0dder 20 Jan 2008, 21:00
Find a different programming language if you aren't going to use the programming language properly.
Yes, using Win32 API is a bit of a pain in C++, because the PlatformSDK was designed badly. Can't really blame Microsoft for that, though, since it was started back in the early days, and was made for C not C++. |
|||
![]() |
|
drhowarddrfine 20 Jan 2008, 23:45
Quote: using Win32 API is a bit of a pain in C++ |
|||
![]() |
|
f0dder 21 Jan 2008, 01:11
drhowarddrfine wrote:
We can blame users that insist on heavy backwards compatibility. The PlatformSDK includes could be rewritten to be (a lot) more C++ friendly (while still being binary compatible with windows), but it would be a massive undertaking, and all windows apps would need large rewrites. Less radical changes could be done which would still be very nice, but would probably end up breaking a few apps nonetheless... and Microsoft always gets a lot of flak whenever a tiny little thing breaks, even if it's because some developer used undocumented calls/whatever. Remember that the the windows includes were started before C++ became popular. Heck, I've considered moving all UI glue (which is where the PSDK is most annoying, imho) to .c files, simply to reduce casting hell. _________________ ![]() |
|||
![]() |
|
joz 21 Jan 2008, 05:25
With Visual C++ 2003, if you go in the options and change compiler type from C++ to C, you'll get a warning instead of an error. That's much better, why isn't it this way with C++
![]() I can't believe this. They believe people can handle pointers in C++ but not type checking? This is madness! (Don't give me the Sparta joke, I'll see it coming ![]() |
|||
![]() |
|
f0dder 21 Jan 2008, 11:19
If you change compiler type from C++ to C, you are using C and not C++, and you really should use ".c" instead of ".cpp" file extension, which will do this automatically.
Type checking in C++ is nice and catches a good deal of errors, but is annoying when you deal with legacy C code. For "real" C++ code, you hardly ever need casts. |
|||
![]() |
|
Vasilev Vjacheslav 22 Jan 2008, 10:27
imho, proper way is
DialogBoxParam(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),0,DialogProc,0); |
|||
![]() |
|
vid 22 Jan 2008, 10:31
sorry, quite possible... never been to much into API stuff.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.