|
Use .SetFont() on the control. It is going to want a CFont, you can call CFont's CreatePointFont(), or if your feeling picky call CreateFont() with 14 arguments of font flexibility.
|
|
|
|
|
Thanks Mark!
works good!
cheers!
|
|
|
|
|
I'm trying to load up a GDI+ bitmap using a pathname, and it does not work.
Here is what I try to do:
Bitmap bitmap(L"Images\\picture.bmp");
What DOES work is:
Bitmap bitmap(L"picture.bmp");
i.e., if the bitmap is in the same directory as the program
Bitmap bitmap(L"C:\\Images\\picture.bmp");
i.e., providing the full path name from the C drive
However, I cannot load it up from the base directory of the program for some reason. The picture is, of course, in the folder, and it works if I specify the entire path name starting from C drive, but not if I attempt to start from the program's directory.
Help ??
Thanks
|
|
|
|
|
Just a guess, but try L".\\Images\\picture.bmp".
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Since you know that the image is in the Images folder that is in the folder of the app, you could use the GetModuleFileName to get the app's folder and then append the Images\\[imagename] to it.
|
|
|
|
|
Indeed, this is what I ended up doing. I guess it ends up being the same thing in the end.
|
|
|
|
|
Hi,
I use EnumResourceTypes & EnumResourceNames to get all the Resources of my multilanguage DLLs system, trying to translate the DLLs strings.
But I can’t get the strings of the dialogs (statics, group boxs, ...), menus, ..., and I don’t know how can I do it. May you help me?
Thanks in advance.
|
|
|
|
|
Kaworu2 wrote:
But I can’t get the strings of the dialogs...
That's going to be tricky. See this article for more.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
Link doesn't works, I'll try it later, what's the article that I must see?
Thanks for reply.
|
|
|
|
|
Hi again,
Now it runs! I see this article yesterday, but I can do it works propertly, today I'll read it again.
Thanks, c u later
|
|
|
|
|
Alright lets say I want to get the value from a particular registry key. How would I go about programming that to actually accomplish this feat.
Key: HKEY_CURRENT_USER\Software\Microsoft\Windows\Test
Name: home
value: testvalue
|
|
|
|
|
RegOpenKeyEx followed by RegQueryValueEx followed by RegCloseKey
|
|
|
|
|
Would this correctly output the value located in said key, with the name of "home" into the variable value that I've defined.
char* value = NULL;
LONG l = 0L;
HKEY hKey = {0};
l = RegOpenKeyEx (
HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Windows\\Test"),
0,
KEY_NOTIFY,
&hKey );
if(l == ERROR_SUCCESS)
{
// The following call will wait until a change is made to the registry key.
l = RegQueryValueEx(
hKey,
TEXT("home"),
NULL,
NULL,
value);
RegCloseKey(hKey);
|
|
|
|
|
Matthew Devine wrote:
I want to get the value from a particular registry key
Use CRegKey defined in atlbase.h
Matthew Devine wrote:
actually accomplish this feat.
Key: HKEY_CURRENT_USER\Software\Microsoft\Windows\Test
Name: home
value: testvalue
here is the small piece of code to accomplish that
CRegKey l_regKey;
if( l_regKey.Open(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\Test")!=ERROR_SUCCESS))
return;
DWORD dwCount=0;
l_regKey.QueryValue(NULL,_T("home"),&dwCount);
LPTSTR pszRetStr=new TCHAR[dwCount+1];
if(l_regKey.QueryValue(pszRetStr,_T("home"),&dwCount)==ERROR_SUCCESS)
{
MessageBox(pszRetStr,_T("Registry Value"));
}
if(pszRetStr)
{
delete [] pszRetStr;
pszRetStr=NULL;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thanks alot for the help, I was able to implement your code perfectly Alok. Again much appreciated.
|
|
|
|
|
Matthew Devine wrote:
Thanks alot for the help,
Mention Not Please
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I was trying to now look up the registry key value of ProxyEnable:
This is located in "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", I was trying to edit your code to work with the fact that this is a DWORD. But I can't seem to get it to work, what I want to do is query the value of that key. After I have the value I just want to write a simple if-statement that will execute ProxyOn() method if the Proxy is seen as being enabled and a ProxyOff() method if the proxy is disabled. Any assistance would be greatly appreciated.
|
|
|
|
|
im trying to make myself a new library using visual studio and everything i try doesnt seem to work. i think that i got a library, but im not sure if its the right type or if i made it right. and if i did it right i have no idea which header to use or how to call my functions from each library.
i understand that this is probably a hard subject to explain over a computer but any help would be greatly appreciated.
thanks
dudeoffrance
|
|
|
|
|
How to make a library can be ambigious. There are many types. You could have .dlls, or .libs that are directly linked into the program or just a directory of headers or even headers with source. I'd consider those all libraries. So how to make each one.
To make a library which is used at runtime, use .dll. Make a new win32 application that is a dll project and then in the project you want to use the .dll, include the header to the .dll. Source is not needed, but the header will always be needed for whatever library you make. Unless you do COM or things of that nature.
To make a library where no .dll is required because you wanted it linked in statically use a .lib. Create a .lib project for your library and then in the client project add the .lib to the linker tab in project settings and include the header.
For the other two just make sure the client application includes and has access to the files needed. This is the simplest of libraries.
|
|
|
|
|
okay, i did that but what do i put in the #include< > at the top of the client app.?
dudeoffrance
|
|
|
|
|
I have a problem with images which I export from a Power Point presentation into an emf file.
When I go record by record through the file, the coordinates I receive are huge (1000's). However inside the presentation the item may only be 100x20.
Does anyone know of a way to convert the huge coordinates into the one's that are usable in the normal coordinate space?
Thank you.
Ilya
|
|
|
|
|
EMF coordinates are stored in HIMETRIC (.01 millimeter) units.
See HIMETRICtoLP() for conversion to logical device units.
|
|
|
|
|
Thank You Shog,
the function you mentioned does seem to make the coordinates more realistic. However I am still having a problem getting the accurate coordinates. The problem I am having is when I pass a RECT to the EnumEnhMetaFile function (which according to MSDN should bind all the drawing calls to within that rectangular region), the coordinates are still outside of the rect. I may pass in (0,0,100,100) but i will get coordinates that are somewhere in the seven hundreds. And to top that off, I have noticed that regardless of the RECT I pass in, the coordinates the function returns always stay the same (as long as the image is the same).
Any suggestions as to what I may be doing wrong?
Thank You,
Ilya
|
|
|
|
|
hiho@ll
anybody knows a good tool which can analyze my code (or just an C/C++ (would be cool with some MFC or "windows" features)) and show me the cross references of my code:
which function is called by which code
i know xref for linux, but is there a similar prog for windows (maybe graphical)
what i finally want is to learn "foreign"-code faster, because sometimes i have to read code from someone other and it's a little bit hard to read it without a good overview
thx@ll
|
|
|
|
|
Visual Studio has one already built into the IDE. Just select Source Browser (Alt+F12) from the Tools menu.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|