|
|
Hmmm.. _stscanf() would probably be a better idea..?
--
100% natural. No superstitious additives.
|
|
|
|
|
Michael Dunn wrote: Your build settings are set to unicode,
What are the advantages and disadvantages of using unicode settings?
Kitty5
|
|
|
|
|
Pros: you can support more languages, runs faster on NT and upwards (native strings are unicode)
Cons: Strings are represented using 16 bit characters - eats up twice as much memory as ordinary ascii strings, requires conversions back and forth if you need to read/write text files from/to other (non-unicode) apps, runs slower on win9x (you need the unicode layer).
--
100% natural. No superstitious additives.
|
|
|
|
|
This CDialog is launched from a dll called by another app. After the app is done I hide it, and the dialog stays up. Now if some other windows happen to obscure this CDialog, there is no icon in the task bar with which I can bring it up again. I have to minimize the windows that obscured it and then I can see it again. I gave the CDialog minimize/maximize buttons (though that would fix it). Any way to get around this?
thanks,
sb
|
|
|
|
|
modeless?
GetDesktopWindow()
Kuphryn
|
|
|
|
|
Hi
I need to hide some windows using ShowWindow API using 0x0 flag. Then I should show them again. But the problem is that I when I set the flag to show windows, I should set it to SW_MINIMIZE, SW_NORMAL, SW_MAXIMIZE but this causes all the windows to show in the i.e. NORMAL mode, since when I did hide them, some where Maximized and some Minimized...
What I need is to show them in the window state that they were before hiding.
Thanks
|
|
|
|
|
MohammadAmiry wrote: I need to hide some windows using ShowWindow API using 0x0 flag.
Why are you not using SW_HIDE ?
MohammadAmiry wrote: But the problem is
that I when I set the flag to show windows, I should set it to SW_MINIMIZE, SW_NORMAL, SW_MAXIMIZE...
How do you propose to set a window to both minimized and maximized?
MohammadAmiry wrote: What I need is to show them in the window state that they were before hiding.
Use IsIconic() and IsZoomed() .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
MohammadAmiry wrote: What I need is to show them in the window state that they were before hiding.
ShowWindow(SW_SHOW);
should do.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Thank you!
Worked perfect...
|
|
|
|
|
Dear all,
I'm using some GDI+ functions in my project. Is there any way to let my program start peacefully if file gdiplus.dll is not available (of course, some functionalities should be disabled)?
By other words, I want to load this dll dynamically. If file gdiplus.dll is unavailable, some functionalities will be disabled and the program should start normally.
Thanks in advance.
Regards,
|
|
|
|
|
Refer to LoadLibrary as mentioned in this article[^].
Maxwell Chen
|
|
|
|
|
Thanks,
Do you know any articles explicitly written about using GDI+ dynamically?
Regards,
|
|
|
|
|
|
Tuan Dang wrote: start peacefully if file gdiplus.dll is not available (of course, some functionalities should be disabled)?
With or without GDI+, your app should start peacefully.
You probably don't want to load GDI+ dynamically, as GDI+ (like GDI) is pretty much a programming model. Although you may mix GDI with GDI+ to some extent, people usually avoid doing so. Unless there is some absolute reason that you have to mix them together, a good practice is to load GDI+ statically. This way it won't create any complexity to your app.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Jun Du wrote: people usually avoid doing so
That's quite a statement to make. Do you think you just made that up? Maybe?
|
|
|
|
|
If you think people should mix GDI and GDI+ in their design, make an argument why you think so. I've used both a lot and it's certainly debatable.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Jun Du wrote: With or without GDI+, your app should start peacefully.
Is it true?
When starting in Windows 2000 (in which gdiplus.dll is unavailable), my program caused an error saying that "The dynamic link library gdiplus.dll could not be found in the specified path...". Then it terminated.
With that error, I don't think we can say the program starts peacefully.
My question is that do we have any ways to smartly use GDI+ functions only when its DLL is avaialabe. Otherwise, all program's functionalities related to GDI+ should be quietly and programmatically disabled.
I realize that whether the GDI+ functions are actually called or not, file gdiplus.dll is always required.
Thanks y'all. Unfortunately, my problem has still unsolved yet.
Regards,
|
|
|
|
|
I think I know your situation better now. The issue should be resolveable.
Tuan Dang wrote: Jun Du wrote:
With or without GDI+, your app should start peacefully.
Is it true?
Yes. It's your respossibility to handle this more properly.
Tuan Dang wrote:
When starting in Windows 2000 (in which gdiplus.dll is unavailable), my program caused an error saying that "The dynamic link library gdiplus.dll could not be found in the specified path...". Then it terminated.
With that error, I don't think we can say the program starts peacefully.
If the app was linked to gdiplus.lib, it will look for the corresponding DLL at the start-up. That's how it works. You've already realized that, as you stated in the following:
Tuan Dang wrote: I realize that whether the GDI+ functions are actually called or not, file gdiplus.dll is always required.
But even you dynamically load the DLL, your app has no clue whether the DLL is present or not.
Tuan Dang wrote: My question is that do we have any ways to smartly use GDI+ functions only when its DLL is avaialabe. Otherwise, all program's functionalities related to GDI+ should be quietly and programmatically disabled.
Yes. I can think of two options:
1) Include gdiplus.dll in your final deliverables. I've noticed many venders do this and a couple of CP articles do so as well.
2) Add code to check if gdiplus.dll exists in the target computer. I remember it's part of Platform SDK for Winows 2000 (SDK 2003?). To guarantee that you can load, you also may include in the documentation that the target machine must have a recent Platform SDK installed.
Hope this helps.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Jun Du wrote: target machine must have a recent Platform SDK installed
That's absurd!
The GDI+ redistributable for pre-XP boxes can be found at
GDI+ Redistributable[^]
It's a slight bit smaller methinks
|
|
|
|
|
|
Hi,
I am coding a program in vc++6. I have a wizard with 5 property pages. There is an edit box on each page.
Each time text is entered in the edit box and a button called Add is pressed, the text is listed in a listbox.
I want the text to be entered in the list box when the Enter key is pressed.
I used the PreTranslateMessage to capture the Enter key and after that, I am assiging the tab key to it. But i do not want that to happen.
If i do not assign the tab key, the wizard goes to the next page of the property sheet How do I not let it happen.
BOOL CSelectPayroll_PP2::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message== WM_KEYDOWN && pMsg->wParam==13)
{
OnAdd() ;
pMsg->wParam=9;
}
return CPropertyPageEx::PreTranslateMessage(pMsg);
}
Thanks,
Tara
Fortitudine Vinsinues!
|
|
|
|
|
I wouldn't recommend to alter the message type; rather discard it after it's handled. Have you tried to change
return CPropertyPageEx::PreTranslateMessage(pMsg);
to
retrun TRUE;
- It's easier to make than to correct a mistake.
|
|
|
|
|
I had tried it. With retutrn TRUE that page appears blank.
With return FALSE it acts as usual i.e. it goes to the next page.
Is there any thing else that may be done?
Fortitudine Vinsinues!
|
|
|
|
|
I got it!!
BOOL CSelectPayroll_PP2::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message== WM_KEYDOWN && pMsg->wParam==13)
{
OnAdd() ;
pMsg->hwnd= NULL;
}
return CPropertyPageEx::PreTranslateMessage(pMsg);
}
Fortitudine Vinsinues!
|
|
|
|