Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i'm having to use code::blocks currently because MSVC isn't currently an option, and i'm having some difficulty finding some functions that i use occasionally when programming in MSVC. I am using the commctrl.h and libcomctl32.a files that came with mingw compiler that came packaged with Code::Blocks and i'm trying to use the functions SetWindowSubclass and DefSubclassProc, but the compiler says they're missing. Can someone help me find them? Also, if it's possible, i'm alot more comfortable with the MSVC compiler, is it at all possible to obtain the compiler itself without having to install anything? i miss being able to include libraries via #pragma comment.

EDIT: actually, a solution to all of this, does anyone know of a portable version of MSVC? because i'm trying to get a decent C++ IDE/Compiler on a computer that requires administrative permissions to install anything. For right now, i've just installed code blocks on a jump drive, copied the folder over to the computer, and it works fine minus slightly less functionality (#pragma comment and what not). For anyone who cares, the reason i need the compiler is that i'm in a high school programming class and they've rented us laptops with both mac and windows, and i use my PC at home for programming so i wanted to use MSVC on the windows portion of the laptop, but they restrict any installs, and really only give us the option of using XCode for Mac. which sucks, and i have no intention of developing Mac applications :P, no offence to macs, just not my cup of tea.
Posted
Updated 7-Sep-11 5:47am
v5

The problem is not C::B, but the version of the compiler (I suppose MinGW) and in particular of window support library.

To stay with MS documentation the function should stay in Commctrl.h, and linked by Comctl32.lib towards Comctl32.dll.

With MinGW convention, you should #include<commctrl.h> and tell the linker to link
libKernel32.a, libuser32.a, libgdi32.a and libComctl32.a
(note that the lib prefix and the .a suffix are added by the linker itself, if missing)

Also, include <windows.h> before <commctrl.h>, and check if proper TCHAR_H support exist.
May be you have to refer explicitly to DefSubclassProcW or DefSubclassProcA.
(just search in Commctrl.h for their declarations)
 
Share this answer
 
v4
Comments
FatalCatharsis 7-Sep-11 13:54pm    
Edit: uh, i think i accidently deleted that last post.

um, i just started using this compiler and IDE, is there a difference between 1 greater than sign on the end and 2 greater than signs? btw, it doesn't compile with the 2 greater thans, and i already had all that linked and included
Emilio Garavaglia 8-Sep-11 2:36am    
"is there a difference between 1 greater than sign on the end and 2 greater than signs?"

Yes, the second was a typo (fixed)
FatalCatharsis 8-Sep-11 9:34am    
actually this is interesting, i went through the header, and did find that TCHAR was indeed there and working, and i also found the prototypes for DefSubclassProc and SetWindowSubclass. So does this mean the lib file isn't linking correctly? cause it builds fine without any errors. or is it that the lib file is out of date?
Emilio Garavaglia 8-Sep-11 12:53pm    
May be: Just try to update the MinGW from here: the automated installer will download a last version of the tools.

Download them in a new directory, than swap the new and the old ones.
Why don't you just download Visual Studio 2010 Express[^]? It is free and has the full software development kit necessary for developing Windows applications already included.

When you say "MSVC" (the language: Microsoft Visual C), do you actually mean "MSVS" (the development environment: Microsoft Visual Studio)?

What does your school provide for you to do development with? If this for a school project, then maybe your IT department will install it for you.
 
Share this answer
 
Comments
FatalCatharsis 7-Sep-11 13:00pm    
like i said, installation on these computers isn't an option. when i said MSVC, i did mean MSVC express, but the installation file does not work on usb flash drives. apparently there are some dependencies that it has to install as well or something and doesn't give me the option of changing the installation directory. No, this gui isn't the actual project, but i would like to make the gui for windows, instead of mac. It just seems a bit unfair to me to force us to use Macs for our programming classes when we really have no intention of using it in our career. We do learn programming concepts, but we are also forced to learn the interfaces in macs. which i have no problem with learning, but i'd also like to learn to use WINAPI, and they make that an impossibility. And yes, we have asked, and yes, they said there is no need to learn windows.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900