|
one way to do it is to use the CTRL + D when you are in the resource view and then set the order of your components.
so the first one has to be the edit box in your case and the last one the Ok button.
i hope it helps.
Fred
|
|
|
|
|
Apart from settin gth tab order as suggested by Fred, you can set the control you want to have the focus in the OnInitDialog() function for the dialog by calling SetFocus() on that control. Remeber that you will need to return FALSe to let the CDialog class know that you set the focus to a control.
As your control is in a property page, you will need to get a pointer to that page in the OnInitDialog() and then a pointer to its control before being able to set the focus.
HTH
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
|
|
|
|
|
Anyone know how I can get a list of all local and network printers installed on a PC? I have a program that when it detects a fire, I'd like to print a fire report on every printer possible. Anyone got any ideas please? Thanks
Jeremy Davis
http://www.astad.org
|
|
|
|
|
See EnumPrinters and OpenPrinter.
|
|
|
|
|
Alex Farber wrote:
See EnumPrinters and OpenPrinter.
Thanks! I'll try that.
Jeremy Davis
http://www.astad.org
|
|
|
|
|
sorry to sound like i'm laughing at you ... i'm not but i can't help but imagine the printouts:
"THERE IS A FIRE AND YOU SHOULD RUNNING THAT WAY!!!"
with an arrow pointing at the the nearest fire escape
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
lauren wrote:
sorry to sound like i'm laughing at you ... i'm not but i can't help but imagine the printouts:
"THERE IS A FIRE AND YOU SHOULD RUNNING THAT WAY!!!"
with an arrow pointing at the the nearest fire escape
No problem! Anyway if there's a fire, all the printers and network cables could have been fried by then anyway!
Jeremy Davis
http://www.astad.org
|
|
|
|
|
Hi,
I would like to add a command ( menu or toolbar button), to my word automated app, and when the users presses over that toolbar button in word, then execute code of my application.
I have read that Ms Word has some sink interface, but only for some events like close/quit/Doc Change..., does it go further ?
Thanks, Bye !
Braulio
|
|
|
|
|
Has anybody any info how the mp3 playlist format is written, i.e. how the Length=xxx is calculated etc. Has any body maybe a Class to read/write to andfrom such a file? (win32 API/ATL/WTL if poss.)
Thanks in advance
|
|
|
|
|
is it this thing you're looking for ?
#EXTM3U
#EXTINF:270, ...
LENGTH=270 // it means that this song is 270 s long.
Fred
|
|
|
|
|
No, that format is for the *.m3u playlist format, If you have info for this that would be great as well
|
|
|
|
|
ok, so here another file, a .pls this time
[playlist] // head of the file
File1=(U2) Pride.Mp3 // mp3 file
Title1=(U2) Pride // how it will be displayed
Length1=227 // 227 stands for 227seconds (3min47)
...
NumberOfEntries=23 // total nb of files in the list
Version=2 // ?
the coding is pretty straightforward.
Fred
|
|
|
|
|
Thanks Fred, got it up and running now..
|
|
|
|
|
Do you know how to change the background color of a CDateTimeCtrl control ?
Thanks.
Where there is a WISH, there is a WILL.
|
|
|
|
|
Have you tried CDateTimeCtrl::SetMonthCalColor ? It allows great flexibility on which colors you can change.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Silly me. I took a look at the help on CDateTimeCtrl but I did not see this method.
Thank you. That should do the job. I try it right away. Thanks.
Where there is a WISH, there is a WILL.
|
|
|
|
|
Too bad. This is not really what I needed. SetMonthCalColor() only applies to the calendar that pops up when you click on the combo box'x arrow.
What I want to change is the background color of the EditCtrl-like control of the CDateTimeCtrl.
Thanks anyways.
Where there is a WISH, there is a WILL.
|
|
|
|
|
Maybe (not sure) this color can be changed the same way the background color of other controls (CStatic s, CEdit s) is. Check §4.9 of Mike Dunn's C++ FAQ. Good luck!
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I built a dll with a simple function in it.
the question is:when i call the function using static linking,no error occur.
but when using dynamic linking,after the function execute complete,an error alway ocurred?
WHY?
the relative code is:
(1)with the dll project:
#include "math.h"
extern "C" __declspec(dllexport) double SquareRoot(double d)
{
CString strText;
if(d>=0.0)
{
strText.Format("%f",sqrt(d));
AfxMessageBox(strText);
return sqrt(d);
}
return 0.0;
}
(2)within the caller project:
*.h:
typedef double (WINAPI *TCSV2DVS)(double);
HINSTANCE m_hInstance;
TCSV2DVS FCSV2DVS;
*.cpp:
void CCallerDlg::OnButtonConvert()
{
m_hInstance = ::LoadLibrary("C:\\DLL\\CsvDvs\\Debug\\CsvDvs.dll");
if (m_hCsvDvs == NULL) {
AfxMessageBox("Load CsvDvs.dll error!");
}
FCSV2DVS = (TCSV2DVS)::GetProcAddress(m_hCsvDvs,"SquareRoot");
double ret = FCSV2DVS(9.0);
::FreeLibrary(m_hInstance);
}
Thanks advance.
(sorry for my poor english)
|
|
|
|
|
I guess the problem has to do with this two lines:
extern "C" __declspec(dllexport) double SquareRoot(double d) and
typedef double (WINAPI *TCSV2DVS)(double); Either include the WINAPI specifier in the first line or remove it from the second.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It does work!
Thanks a lot.
|
|
|
|
|
Is it possible to use 24bit BMP when creating a DirectDraw game?
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Well it depends on your graphics card, but yes DirectDraw will support 24bit graphics. Look at IDirectDraw4::SetDisplayMode
Michael
|
|
|
|
|
Hi,
Selection of an item in my tree control does not always work, how come??
What is funny is that the item(s) which can't be selected are always located from the fifth visible item to the 9th item. If I scroll the visible items, the ones which I couldn't select become selectable, and other become unselectable.
The unselectable items can however be selected by clicking on the left side of their icon... but clicking on the right side or onto the text won't work
Keyboard selection always work.
Does someone have a clue what is happening??
Thanks
|
|
|
|
|
Does it have this problem just on your computer?
Or on every box it's run on?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|