|
It may be the 16x16 vs. 32x32 thing that's ailing you.
|
|
|
|
|
This is because CWinApp::LoadIcon will only load the large 32 x 32 pixel icon, and when you call CWnd::SetIcon(m_hIcon, FALSE), the SetIcon() function will shrink the 32 x 32 icon to 16 x 16. The fix is to add another icon member to your dialog class to hold the small icon, use LoadImage() to load it, and set that as your small icon
class CMyDialog : public CDialog
{
protected:
HICON m_hIcon;
HICON m_hSmallIcon;
...
};
CMyDialog::CMyDialog(...
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_hSmallIcon = (HICON)LoadImage(AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON,
16, 16,
LR_DEFAULTCOLOR);
...
}
BOOL CMyDialog::OnInitDialog()
{
...
SetIcon(m_hIcon, TRUE);
SetIcon(m_hSmallIcon, FALSE);
...
}
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you very much for the precise answer, this exactly solved my problem!
T.T.H. - *happy*
|
|
|
|
|
Hi there
i have an SDI spplication, and from one of the menu options i call a dialog, which
then calls another dialog.
on the final dialog there is a button which will allow you to exit the program
does ne1 know what code i should be puting in when this button is clicked ?
thanks
si
|
|
|
|
|
Have a look at the ExitProcess Windows API function.
Hope that helps
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Here is inserted block:
exit, _exit
Terminate the calling process after cleanup (exit) or immediately (_exit).
void exit( int status );
void _exit( int status );
Function Required Header Compatibility
exit <process.h> or <stdlib.h> ANSI, Win 95, Win NT
_exit <process.h> or <stdlib.h> Win 95, Win NT
PS. But it's better to close and clear your program and exit.
|
|
|
|
|
PostQuitMessage()
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
i have a property sheet with 3 pages in it, i need to disabel the second page....how do i do that?
thanks in advanced,
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
You can disabled button "Next" to call next sheat? (If I understand what you really want).
|
|
|
|
|
Hi, thanks for reply
i need to disable not the buttons of the sheet but one of the tab pages....can you help?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi,
I didn't test it, but in your property page there is a method OnSetActive you may override.
Buy returning false instead of true you tell the system that this page cannot be activated.
Probably this works.
G. Steudtel
|
|
|
|
|
Thanks man!
that was exactly what i needed! but i have an other question if you could answer for me, the color of the text of the disabled page remains black, how do i change it to gray???
(maybe i can play with the method OnSetFont() ???? )
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
The way my company's application did it was to remove the text from the tab. That way the tab is not clickable (because of the OnSetActive() code) and it has no text. It's very effective.
|
|
|
|
|
Thanks again for the reply....
how did they clear the text?
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
When the tab is to be disabled:
TC_ITEM ti = {0};
char szText[2] = "";
ti.mask = TCIF_TEXT;
ti.pszText = szText;
ti.cchTextMax = 1;
VERIFY(pTab->SetItem(nPage, &ti));
|
|
|
|
|
ahh using the property sheet tab control....
well, the trouble is that i don't use MFC, i am writing a MMC (microsoft managment consol) application and i use the property sheet call back interface, so there is no tab control.... can u help here?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi,
I would be really grateful for som info on this.
(1) How do I perform a javascript submit from a C++ client app. My own guess is that using CInternetFile::Write() would be a good start but I wonder whether this is enough or if perhaps special string formatting or additional data needs to be added to the written string.
(2) To do a HTML post could probably be done in a similar way but how do the the "name= " and "action= " parameters fit into the picture?
(3) Are there classes in .NET that would do this whole thing a lot easier?
thanks and cheers
Adam
_____________________________________
Action without thought is not action
Action without emotion is not life
|
|
|
|
|
Anyone know how to use data_seg() for sharing memory among a dll and an app? I have :
#pragma data_seg(".myseg")
int length = 0
#pragma data_seg()
in both my app header AND my dll? I change the variable in the dll but it does NOT affect the reference in the app Is there something I am doing wrong? How do I set it up for sharing so that when I change the variable in one set out virtual memory, it automatically changes the reference in another?
Thanks to all.
|
|
|
|
|
Oh, I'm also using the #pragma comment(linker, "/SECTION:.myseg,RWS") statement in the header too so the linker can SUPPOSEDLY share the variable data memory.
Ta.
|
|
|
|
|
The shared attribute for a section only allows a DLL to share its own data when it is loaded multiple times for multiple processes. It doesn't allow an application to share data with the DLL.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ahhh, right, I guess every subsequent dll that loads would map that variable to the same place in memory. Is there anyway of doing the same thing with an exe and a dll so a variable has application-wide scope? I'm trying to develop an interface class that keeps track of a list and ensures memory is cleaned up at the appropriate times. Trouble is the exe or the dll will both want to use it and I don't want separate instances of the class cos there is common data. Could I use _declspec(dllimport) to import it from a dll into an exe? and then have all subsequent dll's import it from the first one? or should I have a dll that sets up a shared data_seg() for sharing between other dlls and just have the exe import it? Bah, I'm running round in circles over something that should be as easy as 123. Cheers though Ryan.
|
|
|
|
|
Biped wrote:
Is there anyway of doing the same thing with an exe and a dll so a variable has application-wide scope?
No
Biped wrote:
or should I have a dll that sets up a shared data_seg() for sharing between other dlls and just have the exe import it?
Is the DLL loaded by multiple programs such that it has to share data between them? Or is it only important between the EXE and the DLL? If it has to share data between multiple programs, then what you said there is the way to go. If only the one EXE and DLL need to share the data, then you're better off having a single instance of the class, and pass a pointer to the instance between your DLL and EXE.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yeah its just between the exe and the dll, no other app should share that data. I'm thing the pointer to the instance is the best way to go about now after weeks of thought. The one thing that was holding me back was whether it would still be valid in the dll because the memory offset would be different wouldn't it? I have noticed someone suggest using COM but am unsure? Thanks for your help though Ryan, you've been very helpful.
|
|
|
|
|
Biped wrote:
The one thing that was holding me back was whether it would still be valid in the dll because the memory offset would be different wouldn't it?
No. The memory address would be the same. The DLL simply takes up space in the EXEs address space. Anything the EXE can read, the DLL reads from the same address.
Biped wrote:
I have noticed someone suggest using COM but am unsure?
You could use COM, as long as you make your object a singleton (one instance only).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yeah, the object is a singleton, and I'm thinking that I could use the COM practicality for other uses too. Trouble is I've never used COM before so I'll have to scout around for some info on it. I suppose it does make the most sense actually, since it is a structured way of programming an interface, which is pretty much what I want . Now I know it has to have a pure virtual class that defines the interface which derives off IUnknown to track reference counting. How then do I utilise in my scheme of exe and dll? The dlls will be single instances of different dlls, would I just obtain a pointer from COM and pass it to each dll or what . Help Ryan
|
|
|
|