|
Just take the drive letter returned from GetWindowsDirectory() .
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am trying to get a small Windows program to follow the example in http://msdn2.microsoft.com/en-us/library/ms533844.aspx , which reads an image from a .BMP and writes it to a .JPG . I have got it to compile, except for one persistent error: "'GetEncoderClsid': identifier not found". (This is the line afer the comment "// Get the CLSID of the JPEG encoder.".) Please, is this name GetEncoderClsid mistyped in the original? or what? Thanks.
|
|
|
|
|
did you forget to forward declare it before the main() function ?
INT GetEncoderClsid(const WCHAR* format, CLSID* pClsid);
or you didn't didn't include the function implementation, which is shown on a link above the code :
"The main function relies on the helper function GetEncoderClsid, which is shown in Retrieving the Class Identifier for an Encoder[^]"
|
|
|
|
|
Thanks. I inserted the line
INT GetEncoderClsid(const WCHAR* format, CLSID* pClsid); // helper function
and it caused successful compilation but this link error:
unresolved external symbol "int __cdecl GetEncoderClsid(wchar_t const *,struct _GUID *)" (?GetEncoderClsid@@YAHPB_WPAU_GUID@@@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
|
|
|
|
|
YES !
follow the link[^] I gave you, which I got from you original link. the code of the method is there. copy it and paste it in your project.
|
|
|
|
|
Thanks. It worked!!!!!!!!!!!!!!. It copied a BMP file to a JPG file with modew conversion, like I wanted. Thanks everybody.
|
|
|
|
|
Anthony Appleyard wrote: Thanks everybody
man, I was alone on this thread
BTW, please read the WHOLE page after now, because I didn't invent anything. all you need was provided in the first related link.
|
|
|
|
|
toxcct wrote: because I didn't invent anything.
Ahh, don't be so modest, Tox. We all know that your middle name is bmp-to-jpg.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I have the free version of Visual C++ 2008.
In reply to this query, you told me to read http://msdn2.microsoft.com/en-us/library/ms533798.aspx about GDI+.
I went from there to its subpage about "Setting JPEG Compression Level", which has an example coding. Thus, I first inserted the line
#include <gdiplus.h>
in a small test program. The result was 104 compile errors and 8 warnings, of which the first were:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1>c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(74) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\include\gdiplusimaging.h(74) : error C2440: 'initializing' : cannot convert from 'const char [37]' to 'int'
1> There is no context in which this conversion is possible
...\include\gdiplusimaging.h(74) : error C2146: syntax error : missing ';' before identifier 'IImageBytes'
...include\gdiplusimaging.h(74) : error C2470: 'IImageBytes' : looks like a function definition, but there is no parameter list; skipping apparent body
...\include\gdiplusimaging.h(74) : error C2059: syntax error : 'public'
...\include\gdiplusimaging.h(280) : error C2146: syntax error : missing ';' before identifier 'id'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please, what should I do now?
|
|
|
|
|
I inserted #include (less-than-sign) gdiplus.h (greater-than-sign) :: the %^&*&* vagaries of HTLM code.
|
|
|
|
|
for < > lines just use a blank space to separate the signs from the texts
#include < header.h >
template < BLABLABLA >
or click on Ignore HTML tags in this message (good for code snippets)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Nelek wrote: for < > lines just use a blank space to separate the signs from the texts
...or just type < >
|
|
|
|
|
Yes, you are right, I forgot the new issues
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Probably you have to remove
#define WIN32_LEAN_AND_MEAN
in your stdafx.h header (or wherever else it is in your project).
see http://www.gamedev.net/community/forums/topic.asp?topic_id=303606[^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks. That cured it. ~~~~
|
|
|
|
|
I then inserted the instructions:
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
Image* image = new Image(L"C:\\Poser4\\~~~~~.bmp");
and the result was successful compilation and these 7 linking faults:
>qwerty.obj : error LNK2019: unresolved external symbol _GdiplusStartup@12 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
1>qwerty.obj : error LNK2019: unresolved external symbol _GdipFree@4 referenced in function "public: static void __cdecl Gdiplus::GdiplusBase::operator delete(void *)" (??3GdiplusBase@Gdiplus@@SAXPAX@Z)
1>qwerty.obj : error LNK2019: unresolved external symbol _GdipAlloc@4 referenced in function "public: static void * __cdecl Gdiplus::GdiplusBase::operator new(unsigned int)" (??2GdiplusBase@Gdiplus@@SAPAXI@Z)
1>qwerty.obj : error LNK2019: unresolved external symbol _GdipLoadImageFromFile@8 referenced in function "public: __thiscall Gdiplus::Image::Image(wchar_t const *,int)" (??0Image@Gdiplus@@QAE@PB_WH@Z)
1>qwerty.obj : error LNK2019: unresolved external symbol _GdipLoadImageFromFileICM@8 referenced in function "public: __thiscall Gdiplus::Image::Image(wchar_t const *,int)" (??0Image@Gdiplus@@QAE@PB_WH@Z)
1>qwerty.obj : error LNK2019: unresolved external symbol _GdipDisposeImage@4 referenced in function "public: virtual __thiscall Gdiplus::Image::~Image(void)" (??1Image@Gdiplus@@UAE@XZ)
1>qwerty.obj : error LNK2019: unresolved external symbol _GdipCloneImage@8 referenced in function "public: virtual class Gdiplus::Image * __thiscall Gdiplus::Image::Clone(void)" (?Clone@Image@Gdiplus@@UAEPAV12@XZ)
Please what now??????????
|
|
|
|
|
You have to link to Gdiplus.lib too.
Select Project properties menu item, the choose Configuration Porperties->Linker->Command Line and add Gdiplus.lib to the additional options textbox.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Uh, wonderful! Enjoy yourself with GDI+ .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
I am trying to implement my own dialog with its own style and myDialog wraps CDialog.
All works fine except Title bar buttons:
http://img517.imageshack.us/img517/2269/mydialoggv0.jpg[^]
(as you see on the picture)
When i minimize or maximize myDialog, some times its CDialog is drawing its titlebar buttons above my buttons.
Does anyone knows anything about this?
Thanks,
Cem
|
|
|
|
|
you can remove WS_MINIMIZEBOX and WS_MAXIMIZEBOX style for Dialog. then draw them youself.
Are you have gtalk ? please add me: xiangyangzhao@gmail.com
|
|
|
|
|
Hai Cem,
I just wnat to know how to implement our own dialog with its won style such as different buttons, different background.
I would appriciate if you can provide me any sample code link.
Saadhinchaali
|
|
|
|
|
Hi all,
I would like to know wheter it is better to declare a structure in a class or in a global space with regards to memory usage?
Can anyone please give me some advice?
Many Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: I would like to know wheter it is better to declare a structure in a class or in a global space with regards to memory usage?
Memory usage should be the same. Anyway, IMHO that isn't the point: nested structs are declared to avoid name collisions.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|