Thread: TransparentBlt error

  1. #1
    C++ Enthusiast jmd15's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    532

    TransparentBlt error

    I was trying to load a bitmap and have a certain color of it be transparent, I was using magenta. So I tried to use the TransparentBlt function but it came up saying implicit declaration. I know it is used correctly because I checked it and even in a book I have it is used the same way. I did link the msimg32.lib file but still have errors. I am using Dev-C++ 4 on Windows XP Pro. Why would it do this when it is being declared correctly, and yes I do have #include <windows.h> in my header. The code is kinda long otherwise I would have posted it. If need be I will take out that snippet and explain. Thanks.
    Trinity: "Neo... nobody has ever done this before."
    Neo: "That's why it's going to work."
    c9915ec6c1f3b876ddf38514adbb94f0

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    TransparentBlt is conditionally declared, together with the other msimg.lib functions, within wingdi.h (look up the function in the header to see how it's done for yourself). So, to avoid the error you are getting you should #define WINVER 0x0500 for your project or simply #define WINVER 0x0500 prior to #including windows.h. This msdn page will probably be of some interest to you and for future reference for problems of this kind.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    C++ Enthusiast jmd15's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    532
    It comes up with a new error saying I'm redefining WINVER.
    Trinity: "Neo... nobody has ever done this before."
    Neo: "That's why it's going to work."
    c9915ec6c1f3b876ddf38514adbb94f0

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    try checking your project options. look for preprocessor symbols. change definition of it there or just undef it before redefining it.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM