mity / mctrl

C library providing set of additional user interface controls for Windows, intended to be complementary to standard Win32API controls from USER32.DLL and COMCTL32.DLL.
http://mctrl.org
235 stars 52 forks source link

I get error "unknown type name" #34

Closed ghost closed 10 years ago

ghost commented 10 years ago

I get these two errors when trying to compile ex_button.c example in CodeBlocks ...\mCtrl\dialog.h|149|error: unknown type name 'LPCDLGTEMPLATEW'| ...\mCtrl\dialog.h|163|error: unknown type name 'LPCDLGTEMPLATEA'| and then both of them again at line 271 and 286 in dialog.h file What to do?

mity commented 10 years ago

I do not know CodeBlocks. But it seems there is something missing in system SDK header files.

Windows header winuser.h should define structure DLGTEMPLATE and there are also usually some typedefs like these: typedef CONST DLGTEMPLATE *LPCDLGTEMPLATEW; typedef CONST DLGTEMPLATE *LPCDLGTEMPLATEA;

If the header does not provide just the typedefs, you can workaround by replacing LPCDLGTEMPLATE[W|A] with const DLGTEMPLATE* in mCtrl headers and example code.

If definition of the structure DLGTEMPLATE is not present at all, then the SDK headers distributed with the CodeBlocks are fundamentally incomplete.

ghost commented 10 years ago

I found DLGTEMPLATE but no typedefs so I will try to replace them like you said.

ghost commented 10 years ago

When i change it it still displays same errors in same lines even if LPCDLGTEMPLATE[W|A] is not written anywere

ghost commented 10 years ago

Ok I found some winuser,h that works but now there is another problem. I compile and run my example and I only get press any key to continue in cmd window.

mity commented 10 years ago

Saying "it does not work" does not help much. Please start by writing proper bug report. There is no oracle here.

What mCtrl version do you use? Or is it something built from git repo? What Windows version do you have? Are you able to build some hello world Windows (not console) program in CodeBlocks or its setup may be completely broken? Do the other mCtrl examples work or everything is broken? Do you build 32bit or 64bit ex_button.exe? How do you build the example? With some Makefile from mCtrl or have you created some "project" for it? What compiler CodeBlocks uses? What compiler/linker options are used when it is built?

ghost commented 10 years ago

I use mCtrl 0.9.6 prebuilt binary package (32bit files) and examples from same version source. Windows 7 Professional SP1 64bit. CodeBlocks for itself works ok. Every example compiles ok and then console window opens and there is press any key bla bla... I try to build 32bit. I made CodeBlocks project and in build options i linked it to libmCtrl.a everything else is on default... GNU GCC.

mity commented 10 years ago

So it seems you build them as a console application. gcc needs to get option -mwindows to create GUI applicaition. I have no idea how to do this in CodeBlocks.

ghost commented 10 years ago

Do you know some easier and faster solution to make program that will show just one custom webpage ?

mity commented 10 years ago

Yes, with other technologiues (MFC, .NET, whatever). However this is complete off topic here.

Closing the "bug" as it seems more about issues with CodeBlocks then mCtrl.