|
Thanks, it worked just fine!
Is there a way to set which tab of the property dialog box that´ll be selected when launched?
/Jii
|
|
|
|
|
How do I get at the information that is entered in VS_VERSION_INFO in a VC++ app? I'm trying to get the information for my About Dialog and am having trouble getting at the information that I have entered there.
|
|
|
|
|
Haven't checked it out completely, but this might help...
http://www.codeproject.com/dll/showver.asp
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
I believe GetFileVersionInfo() is what you are after
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
I am very new to programming. I have started using Visual C++ 6.0. I am not very familier yet with the terms used in programming.
I would like to put a bitmap in place of mu button using CBitmapButton.
I have looked over many different sites from MSDN to codeguru trying to find out how to do it. Either I get to the end and it doesn't work for some reason or the words being used are too advanced for me to understand.
are there any simpler instructions for using CBitmapButton, on the web?
Thank you.
|
|
|
|
|
It's in MSDN. Here is it's example followed by my example. Make sure you do as it says and either call create with BS_OWNERDRAW or edit the button in the resource workshop and check on OwnerDraw in the properties for the button.
Example
CBitmapButton myButton;
myButton.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,
CRect(10,10,100,100), pParentWnd, 1);
myButton.LoadBitmaps(IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE);
I put this in the header file.
CBitmapButton btnStop;
CBitmapButton btnMonitor;
Then in the .cpp's OnCreate() function....
if (!m_wndToolBar.btnStop.LoadBitmaps(_T("StopUp"), _T("StopDown"), _T("StopFocus"), _T("StopDown")) ||
!m_wndToolBar.btnMonitor.LoadBitmaps(IDB_MONUP, IDB_MONDOWN, IDB_MONFOCUS, IDB_MONDOWN) )
{
TRACE0("Failed to load bitmaps for buttons\n");
AfxThrowResourceException();
}
|
|
|
|
|
If you want only to get a bitmap into the button CBitmapButton is Ok, but if you want more functionality (flat buttons, changing images depending on the mouse cursor...) without effort take a look at Davide Calabro's CButtonST, it's easy to use and will give you the possibility to use buttons as if you where programming in Delphi or VB (setting properties)...
NOTE1:
I'm novice too and it works fine for me...
NOTE2:
I'm new speaking english too...
NOTE3:
you can find CButtonSt and some other classes at codeproject in the button control related web page.
Best regards..
|
|
|
|
|
Hey all. I have run into a problem with the MessageBox command. I need the MessageBox to close as soon as a keyboard event occurs, but have yet to find an efficient way to do it. My project is a multiple document MFC program done under Visual C++ 6. Any help you can give would be cool.
|
|
|
|
|
Replace MessageBox with modal MFC dialog and override PreTranslateMessage.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I had done something similar to this earlier and it kind of worked but it continued executing the current function even with the modal dialog open. Before I try this method, I was wondering if this would do the same?
|
|
|
|
|
Anonymous wrote:
it continued executing the current function even with the modal dialog open
Sounds strange. Did you use multiple threads?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Hey, thanks. Your first reply just gave me an idea.
|
|
|
|
|
Anyone have any idea where the DLGTEMPLATEEX struct is defined??
It's explained and defined in MSDN, but I can't seem to use it in my source, as it isn't defined in any headers that I've included.
It seems to be defined in some of the ATL includes, but as a "local struct used for implementation" (ATLCTL.H).
Now I know that it is used, because if I load a DialogEx into memory and examine it, it's structure conforms to DLGTEMPLATEEX.
Any ideas, short of defining the struct myself where I need it?
TIA,
Pete
|
|
|
|
|
DLGTEMPLATEEX
typedef struct {
WORD dlgVer;
WORD signature;
DWORD helpID;
DWORD exStyle;
DWORD style;
WORD cDlgItems;
short x;
short y;
short cx;
short cy;
sz_Or_Ord menu;
sz_Or_Ord windowClass;
WCHAR title[titleLen];
// The following members exist only if the style member is
// set to DS_SETFONT or DS_SHELLFONT.
WORD pointsize;
WORD weight;
BYTE italic;
BYTE charset;
WCHAR typeface[stringLen];
} DLGTEMPLATEEX;
Happy programming!!
|
|
|
|
|
Thanks Wolfram, but I actually already had the structure, I just need to know where it's defined, so I don't have to typedef it myself.
|
|
|
|
|
I found it in the ATL include, atlhost.h, for class _DialogSplitHelper. Again, it appears to be local. HTHs.
|
|
|
|
|
I'd like to use LockFile() to lock a full file, is this possible?
MSDN doesn't mention how to do this.
Please help
|
|
|
|
|
Can you not specify 0 as the starting offset, and the file length as the length to lock?
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
What happens if the file size is increasing because I append data to the file? Sometimes I want to lock a file and make sure nobody else can modiy or append data to it.
|
|
|
|
|
According to MSDN, it is not an error to set the locking range past the end of the file, but I am not sure if that would lock anything you append. To be safe, I think you should re-call LockFile() after you append data, specifying the new file length.
This is just a guess, I have never done this myself
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
According to MSDN, it is not an error to set the locking range past the end of the file
thx, I need to do some testing.
|
|
|
|
|
Anonymous wrote:
Sometimes I want to lock a file and make sure nobody else can modiy or append data to it.
Can't you just open file using CreateFile and FILE_SHARE_READ flag?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Tomasz Sowinski wrote:
Can't you just open file using CreateFile and FILE_SHARE_READ flag?
that's not portable. on the other hand, file locking mechanism do exist on various platforms (open file, lock file, do something, close file).
|
|
|
|
|
Anonymous wrote:
that's not portable.
So on these 'various platforms', when you open file, other processes can also open the same file and write at the same time?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Tomasz Sowinski wrote:
So on these 'various platforms', when you open file, other processes can also open the same file and write at the same time?
that's why you lock files. e.g. you gain the exclusive right to modiy data in a file ata specific time.
|
|
|
|