|
Hello.
Include the GDI+ headers in your source file mahadlgDlg.cpp
(AFTER #include <stdafx.h>)
I.e:
using namespace Gdiplus;
#include "GdiPlusBitmap.h"
#include "GdiPlusHeaders.h"
And
#pragma comment(lib, "gdiplus.lib")
That should do the trick.
Kakan
|
|
|
|
|
maharaja pandian wrote: Is it possible to use GDI+ in VC++ 6.0
yes!, why not
maharaja pandian wrote: but it through the ERROR as
Since above class are defined under namespace Gdiplus, so you have to make call for
using namespace Gdiplus
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi, there
Can anyone teach me how to make the digital clock 'bigger' as in the number size ? I tried the whole day still failed. pls help.
C++ noob
Many thanks in advanced.
|
|
|
|
|
and why don't you ask its author on the forum ot the bottom on the article[^] ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
how to print a .bmp or .png file in dialog based applicatio
Regards.
sachin gupta
-- modified at 23:46 Friday 18th November, 2005
i gota program for printing .txt file ,
but how i can print a image that is stored in a predefined path.
|
|
|
|
|
Hi,
I have a file that i want to associate it with my program. Then, if i double click it in explorer, it should automatically open in my program.
What event should i handle? How to do this?
Usman
|
|
|
|
|
i thing using ShellExecute function this could be done
|
|
|
|
|
uus99 wrote: I have a file that i want to associate it with my program. Then, if i double click it in explorer, it should automatically open in my program.
you have to associate the file extention with your program... for that you have to change entry in HKEY_CLASSES_ROOT in registry
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
once i associate the the file extension, which function will be called if i open the file in explorer?
I mean, for example, my program is Program.exe, and the file is file.zzz. I associate the files *.zzz to my program, and if i open it in explorer, which function in my program will it be called?? OnOpen() etc?? Do i have to add an event handler?
THanks,
Usman
|
|
|
|
|
|
To complete the answer of Alok, in fact what really happen is that your program is called with the name of the file passed as command line argument. But, like Alok said, if it is a SDI or MDI app, the framework will handle all the job for you (it will call automatically the serialize methods thus loading the file). But of course, you have to implement the loading,saving of data in the serialize handlers.
|
|
|
|
|
WHat about dialog based programs? My project is a dialog based project, and i wan to associate TIFF files so that it opens in my program.
|
|
|
|
|
See here.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I need to draw circles, squares, and lines between them,
with some colors and digits
in simple way.
can someone advice me-
are there such controls ?
please type link or Name.
better with some comment.
thanks
|
|
|
|
|
hi,every one!
i want to change the companyname in my .exe file dynamicly,how to do?
there is a sample at http://www.codeproject.com/samples/UpdateVersion.asp, but it
does not deal with it.who can help me?thanks a lot!
|
|
|
|
|
I didn't get your question exactly. if you are trying to change the title of the application take the handle of the dialog and using SetWindowText() function you can change the name of the exe.
give me some more information about your problem.
|
|
|
|
|
The sample u mentioned has got complete code for changing the CompanyName. I have used this code myself. You just need to understand it fully before using and yes, dont forget to compile your application as unicode to do this. It wont work without that. I am just pasting a snippet of code here from the same article which does this.
CString strSubBlock;
LPTSTR pValueBuffer;
strSubBlock.Format(_T("\\StringFileInfo\\%04x%04x\\CompanyName"),
lpTranslate->wLanguage,
lpTranslate->wCodePage);
VerQueryValue(lpBuffer, (LPTSTR) ((LPCTSTR) strSubBlock),
(LPVOID *) &pValueBuffer, &uTemp);
ZeroMemory(pValueBuffer, _tcslen(pValueBuffer) * sizeof(TCHAR));
_tcscpy(pValueBuffer, _T("My Company, Inc."));
And yes, this Article is by one of the most respected members here. Mr. David Crow
Regards,
Aamir
|
|
|
|
|
Thank you,Aamir Butt!
Yes,i use like that you write, but how can i use UpdateResource function whit the variable 'pValueBuffer'?
This is my code:
CString strSubBlock;
LPTSTR pValueBuffer;
strSubBlock.Format(_T("\\StringFileInfo\\%04x%04x\\FileDescription"),
lpTranslate->wLanguage,lpTranslate->wCodePage);
VerQueryValue(lpBuffer, (LPTSTR) ((LPCTSTR) strSubBlock),
(LPVOID *) &pValueBuffer, &uTemp);
ZeroMemory(pValueBuffer, _tcslen(pValueBuffer) * sizeof(TCHAR));
_tcscpy(pValueBuffer, _T("My Company, Inc."));
if (UpdateResource(hResource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO), lpTranslate->wLanguage, lpBuffer, dwSize) != FALSE)
{
if (EndUpdateResource(hResource, FALSE) == FALSE)
dwResult = GetLastError();
}
else
dwResult = GetLastError();
But it does not replace the original companyname with "My Company, Inc." finally,perhaps where is wrong, can you help me? thanks a lot!
|
|
|
|
|
freemme wrote: there is a sample at http://www.codeproject.com/samples/UpdateVersion.asp, but it
does not deal with it.
Are you sure?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thank you for your code,DavidCrow,they help me very much!
perhaps i don't understand them fully.
Yes,i use like that you write, but how can i use UpdateResource function whit the variable 'pValueBuffer'?
This is my code:
CString strSubBlock;
LPTSTR pValueBuffer;
strSubBlock.Format(_T("\\StringFileInfo\\%04x%04x\\FileDescription"),
lpTranslate->wLanguage,lpTranslate->wCodePage);
VerQueryValue(lpBuffer, (LPTSTR) ((LPCTSTR) strSubBlock),
(LPVOID *) &pValueBuffer, &uTemp);
ZeroMemory(pValueBuffer, _tcslen(pValueBuffer) * sizeof(TCHAR));
_tcscpy(pValueBuffer, _T("My Company, Inc."));
if (UpdateResource(hResource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO), lpTranslate->wLanguage, lpBuffer, dwSize) != FALSE)
{
if (EndUpdateResource(hResource, FALSE) == FALSE)
dwResult = GetLastError();
}
else
dwResult = GetLastError();
But it does not replace the original companyname 'xxx Company' with
"My Company, Inc." finally,i dont know what is wrong, can you help me? thanks a lot!
|
|
|
|
|
freemme wrote: But it does not replace the original companyname 'xxx Company' with
"My Company, Inc."
Why would you expect it to? You called UpdateResource() with lpBuffer instead of pValueBuffer .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Sorry,DavidCrow!It is OK now!
Your code is right,it is the question myself.
Thank you very much!
|
|
|
|
|
I am a bit of a newbie and tend to take on projects that are over my head. Anyway, my problem is that I am trying to include header files from one program to another, and commands for winsock are causing an ambiguity in the compilation. The host program compiles fine until I #include stdafx.h which also includes the following (syntax modified because include files not showing up on forum):
#include afxwin.h // MFC core and standard components
#include afxext.h // MFC extensions
#include afxdisp.h // MFC Automation classes
#include afxdtctl.h // MFC support for Internet Explorer 4
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include afxcmn.h // MFC support for Windows Common Controls
I tried to track down the instance of winsock in these afx files to change it (can I do that since the winsock 1 & 2 look almost identical?), but the includes are just compounding.
Does anyone know where I can find the instance of winsock.h in the afx headers? Or maybe there's an easier fix for this? Thank you for any help!
-- modified at 2:04 Friday 18th November, 2005
|
|
|
|
|
In stdafx.h, before all the #include's add:
#define _WINSOCKAPI_ // prevent inclusion of winsock.h in windows.h
Then later on, if you need it, you can add:
#include <winsock2.h>
...cmk
Save the whales - collect the whole set
-- modified at 7:25 Friday 18th November, 2005
|
|
|
|
|
[typeof(MC++)]
If I have a class that inherits from CollectionBase...
and I have an default accessor: Item
__property Object * get_Item(int index)
{
return List->Item[index];
}
How can I get this to serialize as another object (the only one I'm using for this collection)
I've tried changing what is returned, and it breaks when trying to access and claims the class is violating ICollection....
When i use:
[XmlInclude(__typeof(Vehicle))]
The compiler claims:
The type Vehicle was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known static
The vehicle class is labeled serializeable.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|