|
I have a doc/view program (sdi) and I want to be able to load and display bitmaps on the fly from .bmp files. I have an array of cells that the document keeps track of and I want the view to draw the correct bitmap who's filename will be stored in the cell object so that when OnDraw is called it looks up which bitmap it should be displaying and loads and displays it, opposed to having the bitmaps as resources. I have gathered that to load a specific bitmap you use the code...
HBITMAP hImage = (HBITMAP)LoadImage(NULL, "c:\\nick.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_DEFAULTSIZE);
but I cannot work out how to display it because everything I blit to the screen is blank. I've checked and the bitmap is loading ok, just not displaying.
How do you do this?
Cheers for any help
Nick
|
|
|
|
|
|
Thx a lot, looks like this'll work
Nick
|
|
|
|
|
An option I have used is using IPicture. It has a Render method that takes dc to draw the image onto. You can use gif, jpg, bmp, etc. Look in MSDN "How To Load and Display Graphics Files w/LOADPIC.EXE Q218972".
|
|
|
|
|
Hi
in my app I gave CFtpConnection class. how can i duplicate this variable? i mean, how can i make another excactly the same variable?
I've tried this:
CFtpConnection *pFtp;
....
pFtp = Session.GetFtpConnection(...);
...
...
CFtpConnection dFtp;
dFtp = *pFtp
...
and it didnt work...
so how can i do that?
thanks
|
|
|
|
|
Try this:
CFtpConnection *pFtp;
....
pFtp = Session.GetFtpConnection(...);
...
...
CFtpConnection *dFtp;
dFtp = pFtp
...
|
|
|
|
|
but that will create a new CFtpConnection pointer that points to the first CFtpConnection class, so if i change it, the first variable will change too, and that is something i dont want....
(i need the second CFtpConnection variable for a new thread that downloads a file from a FTP server that assosiated with the first CFtpConnection variable)
any other ideas?
thanks...
|
|
|
|
|
How about this:
CFtpConnection *pFtp;
....
pFtp = Session.GetFtpConnection(...);
...
...
CFtpConnection& hFtp = *pFtp;
|
|
|
|
|
Hi,
we are building up a collection of articles. A few of them are ready. I hope our collection of tips and tricks will grow up in the next time.
Take a look at it ...
http://www.klangwerker.de/developer/
CU Mario ///
----------------------
www.klangwerker.de
mario@klangwerker.de
----------------------
|
|
|
|
|
http://www.klangwerker.de/developer/
Ps! This is probably the most ugly website ever made
But the content is good beginner stuff.
Jimmy Hoffa
|
|
|
|
|
I am having the problem described at http://support.microsoft.com/support/kb/articles/Q240/8/69.ASP
(basically one of my operators thinks its ambiguous when it isnt, and I presume its because of this bug.) I cant work out if this document is giving me a way around it??
thanks,
Ben
|
|
|
|
|
If you post the code you're having a problem with we might be able to help
|
|
|
|
|
I don't know if this helps but this works:
template<class t=""> void f(T value);
void main() {
int nNum = 3;
const int *p = &nNum;
f(*p);
}
template <class t=""> void f(T value)
{
printf("%d", value);
}
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I would like to use data in CCombobox in my code with a switch method. So, i have choosen the option drop list, because i need that my variable is an integer. In my example i have put firstly in the data of the Combobox a data1, then data2...So, i would like to know if this order stay the same all the time, and if in switch method, case 0 is for data1....
thanks in advance
gerald
|
|
|
|
|
Did you make a member variable with ClassWizard? If so, the value of the variable is the index of the selected item - the same value you get with CComboBox::GetCurSel().
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
Hi
How do I get a cdialog to know it's finished whit initializing and painting all controls on board? Is there a message going out or something?
Per
|
|
|
|
|
WM_INIT ?
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
I have a drawing consisting of several lines.
I need some actions to be made when user clicks at some line. How can I implement this using MFC?
I have already done this calculating distance from the clicked point to each line, but it seems to be too complicated.
Andrei the Adroit
|
|
|
|
|
Use a RECT or CRect for the coordinates of your lines. Create a CRgn from your rectangle using CreateRectRgn. Use PtInRegion in your LButton function, to verify whether or not the mouse is in the rectangle. Use OnMouseMove, in which you can move the rectangle.
Note: you can use a CList if you have a large number of lines.
|
|
|
|
|
How to include a MFC DLL in to a project created without MFC ?
|
|
|
|
|
|
Sorry, I put the question in a bad mode.
I have a project that didn't include MFC. I try to include a library file (.lib). This lib file use MFC (I don't have the sources of this lib). I put the lib file and heaer file (.h) in the same directory with the project and I try to build... but I get message like this:
"fatal error C1189: #error : include 'stdafx.h' before including this file for PCH"
and the line where I get the error is in header file and contain:
"#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif"
But, "stdafx.h" don't exist because the project don't use MFC.
Thanks,
Gabi
|
|
|
|
|
Hi,
I want to find references & code samples for changing the icon of any files.(not only dlls or exes).. Is it possible to change icons of other files... Please help me ASAP..
Thanks in advance
Hami
Hami
|
|
|
|
|
|
Miri
try the following, you need to add Carriage Return and Line Feed characters to the end of the string to get it to create the file in DOS format and not Unix.
CString strMsg = "Line 1\r\nLine 2\r\n";
CFile OutFile;
OutFile.Write(strMsg, strMsg.GetLength());
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|