Link error: missing function AlphaBlend from msimg.dll

G

Guest

I'm trying to call the Microsoft image-processing function AlphaBlend() in my
Visual C++ application. My software compiles okay, but gets a link error
(details below) that says it cannot find the symbol AlphaBlend().

I'm calling dozens of other Microsoft bitmap and imagery functions without
error.

The MS documentation says that AlphaBlend is in msimg32.dll. I have this
file, in folder C:\Windows\System32.

I tried to add file msimg32.dll to my Visual C++ link (using "Additional
Dependencies") but VIs C__ rejects msimg32.dll as a "invalid or corrupt file".

Two questions:
1) Why is the linker not finding AlphaBlend() when it is able to find all
the other MS functions I call, including BitBlt() and many others?

2) Assuming that AlphaBlend is inside msimg32.dll, how can I tell Visual C++
linker do use that DLL to resolve the missing symbol?

Thanks in advance for any help,
neal




=== HERE is the original linker error ==============
TestPlugIn error LNK2019: unresolved external symbol __imp__AlphaBlend@44
referenced in function "void __cdecl drawMemoryImageIntoWindow(unsigned char
*,unsigned int,unsigned int,class VSTGUI::CFrame *,unsigned int,unsigned
int,unsigned char)"
(?drawMemoryImageIntoWindow@@YAXPAEIIPAVCFrame@VSTGUI@@IIE@Z)
 
W

William DePalo [MVP VC++]

noleander said:
I'm trying to call the Microsoft image-processing function AlphaBlend() in
my
Visual C++ application. My software compiles okay, but gets a link error
(details below) that says it cannot find the symbol AlphaBlend().
OK.

The MS documentation says that AlphaBlend is in msimg32.dll. I have this
file, in folder C:\Windows\System32.

That's good.
I tried to add file msimg32.dll to my Visual C++ link (using "Additional
Dependencies") but VIs C__ rejects msimg32.dll as a "invalid or corrupt
file".

Two questions:
1) Why is the linker not finding AlphaBlend() when it is able to find all
the other MS functions I call, including BitBlt() and many others?

Well, it is the job of the linker to statically add object modules to the
executable, or to leave information for the loader to patch the references
in your code to function at runtime. To perform the latter function it needs
what is called an "import" library.

You need to add msimg32.lib to your project.
2) Assuming that AlphaBlend is inside msimg32.dll, how can I tell Visual
C++
linker do use that DLL to resolve the missing symbol?

Enter the name of the import library msimg32.lib in the edit box

Project->Properties->Linker->Input->Additional Dependencies

The folder that contains the library will need to be one of the folders that
the linker searches for libraries.

Tools->Options->Projects->VC++ Directories

FWIW, I don't do much GDI, but on this box that folder is below a part of
the Platform SDK tree and not VS.Net 2003 tree.

Regards,
Will
 
G

Guest

Thanks for the tip.

I tried it and it works.


William DePalo said:
That's good.


Well, it is the job of the linker to statically add object modules to the
executable, or to leave information for the loader to patch the references
in your code to function at runtime. To perform the latter function it needs
what is called an "import" library.

You need to add msimg32.lib to your project.


Enter the name of the import library msimg32.lib in the edit box

Project->Properties->Linker->Input->Additional Dependencies

The folder that contains the library will need to be one of the folders that
the linker searches for libraries.

Tools->Options->Projects->VC++ Directories

FWIW, I don't do much GDI, but on this box that folder is below a part of
the Platform SDK tree and not VS.Net 2003 tree.

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top