|
Trap the KeyDown message (in PreTranslateMessage method) and on VK_RETURN set the focus according to your need.
|
|
|
|
|
Just to clarify - OK doesn't keep the focus, but it is the default button (that's one of the button styles), so pressing ENTER triggers that button.
--Mike--
http://home.inreach.com/mdunn/
A recent survey reports that 1/4 of all internet users in England surf for porn.
The other 3/4 just didn't want to admit it.
|
|
|
|
|
Hi!
Does anyone know how to convert:
1. An integer to a string
2. A string to an integer
I know you can do this in Borland Delphi (IntToStr(), StrToInt()) so I wondered if it is possible to do the same in Visual C++...
Any help would be greatly appreciated...
James Bird - birdjames@bigfoot.com
|
|
|
|
|
itoa() int to string
atoi() string to int
both are part of stdlib.h
Cheers,
-Erik
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My thoughts are my own and reflect on no other.
|
|
|
|
|
Integer to a string, use itoa, ltoa, or ultoa:
char str[4];
itoa(number, str, 10);
String to an integer, use atoi or atol:
int i=atoi("12");
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Also, if you are using std::string (which by the way is a lot easier to deal with than char arrays), you can use std::stringstream for your conversions. The nice thing, too, is that if you know how to use cout, then you can use stringstream. It can handle ints, floats, whatever.
#include <string>
#include <sstream>
#include <iostream>
using namespace std;
int main()
{
int i = 1;
float f = 2.0;
stringstream ss;
ss << "Let's print some numbers: " << i << "\t" << f;
string s = ss.str();
cout << s << endl;
return 0;
}
The output is:
Let's print some numbers: 1 2.0
|
|
|
|
|
Whoops, btw, the three #includes that got deleted were for string, iostream and sstream. Darn these HTML tags.
|
|
|
|
|
I am using the rich edit control to preview a report.
I have every just the way i want it execpt, i can not figure out how to draw a line(to separtate the header from the body)
Thank you anyone.
|
|
|
|
|
My guess would be to calculate where abouts on the rich edit control the line has to go, and then draw using its dc:
int x = 2; // X = X Position Of Line In The Richedit Control
int y = 20; // Y = Y Position Of Line In The Richedit Control
int xs = 200; // XS = Size Of The Line (Horizontal)
CRichEditCtrl m_richedit;
CDC pDC = m_richedit.GetDC();
pDC.MoveTo(x, y);
pDC.LineTo(xs, y);
...
Hope this helps,
James Bird - birdjames@bigfoot.com
|
|
|
|
|
I implemented the following
my font height is 12
so an x of 20 should be between the two lines.
but the line does not show up.
any thought ?
thank you
CDC* pDC = m_richedit.GetDC();
m_richedit.SetSel(-1,-1);
m_richedit.ReplaceSel("Report Header\n\n");
pDC->MoveTo(20,20);
pDC->LineTo(20,100);
m_richedit.ReplaceSel("Report Data");
+++many more lines
|
|
|
|
|
Can't you just underline the text "Report Header"?
--
Alex Marbus
www.marbus.net
But then again, I could be wrong.
|
|
|
|
|
I could if I had to but it would not look that pleasing to the eye.
What i really need is a fomatted line divider.
I would like to also control the width of the line.
|
|
|
|
|
Setup: The application I am developing allows the user to import artwork onto the document via an import dialog (this is a Quark Xpress/MultiAd Creator type application). Once imported, there is a need for the user to get back to the original piece of artwork so that they can further manipulate it in an image program (Photoshop/Illustrator). This application is designed to run under Windows NT/2K.
Problem: What I need to do is programmatically open the folder that contains the artwork, select the artwork, and bring this window to the foreground.
Thanks for your input.
Andy Brace
SW Development Engineer II
Qwest
Reality's The Only Obstacle To Happiness.
|
|
|
|
|
Call ShellExecute(), passing the fully-qualified path to the directory and the verb "open". This will launch Explorer, and since it's a new program its window will be brought to the top.
--Mike--
http://home.inreach.com/mdunn/
A recent survey reports that 1/4 of all internet users in England surf for porn.
The other 3/4 just didn't want to admit it.
|
|
|
|
|
Thank you very much! That works perfectly for opening the folder that contains the artwork. Do you happen to know a way to select the file icon once the folder is open or at least make sure the file is in view?
Andy Brace
SW Development Engineer II
Qwest
Reality's The Only Obstacle To Happiness.
|
|
|
|
|
If I remember well, there's a command line option for explore.exe to select a shell object passing its PIDL (LPITEMIDLIST) as a hex number.
But I can't remember the exact syntax, also because I think it's not documented, so you have to search in some sites "full of tips" or similar.
If you find it, please LMK.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hi,
Can anyone please explain to me the details of the various columns show in the WIndowsm NT task manager?
Thanks in advance.
|
|
|
|
|
Hey guys
I have written a dll which is a shell extension so when you right click on my file type it brings up a menu. What i was wonering is if anyone knew how to get the double click of the file to launch one of the right click menu options on the file.
At the moment i found the registry entrys to get it to load a dll on double click or open but i was wondering what the registry passes in to the dll and what function i need to add to the dll to get it to react to the open command.
Cheers for the help
Peter
|
|
|
|
|
Hi all there,
I have to implement registered file opening by double clicking on it in windows explorer.Please guide me to do so.
Regards
Abid
|
|
|
|
|
Hi, you can do that with ShellExecute()
|
|
|
|
|
How can I design a component that import/export image (bmp or gif) to and from the database.
|
|
|
|
|
Hi!
My program send an email via MAPI. i use the following code :
// Build the message
MapiMessage Msg;
MapiRecipDesc Dest;
MapiFileDesc ReportFile;
memset(&Msg, 0, sizeof(Msg));
memset(&Dest, 0, sizeof(Dest));
memset(&ReportFile, 0, sizeof(ReportFile));
ReportFile.nPosition = (ULONG)-1L;
ReportFile.lpszPathName = szFileName;
Dest.ulRecipClass = MAPI_TO;
Dest.lpszName = "Philippe Mignard";
CString szEmail;
szEmail.LoadString(IDS_EMAIL_ADDRESS);
Dest.lpszAddress = (LPTSTR)(LPCTSTR)szEmail;
Msg.lpszSubject = "[MSS-EasyScan] Source Info Report";
CString szMailBody;
szMailBody.LoadString(IDS_MAILREPORT_BODY);
Msg.lpszNoteText = (LPTSTR)(LPCTSTR)szMailBody;
Msg.nRecipCount = 1;
Msg.lpRecips = &Dest;
Msg.nFileCount = 1;
Msg.lpFiles = &ReportFile;
// Send message
HINSTANCE hInst=LoadLibrary("MAPI32.DLL");
if(hInst!=NULL)
{
ULONG (PASCAL *lpfnSendMail)(ULONG, ULONG, MapiMessage*, FLAGS, ULONG);
(FARPROC&)lpfnSendMail = GetProcAddress(hInst, "MAPISendMail");
lpfnSendMail(NULL, NULL, &Msg, MAPI_DIALOG, NULL);
FreeLibrary(hInst);
}
// End
In my computer, it work well but when i try it into another computer (winMe based OS), it crash in WAB32.DLL. I don't know why. Somebody can help me ?
Thanks a lot.
PS : I hope u understand my 'frenchy' english
F.JULIEN
|
|
|
|
|
i need a GOOD tutorial on winsock programming without MFC. I can already program winsocks with MFC now i want to do it without it but it seems to be veeeeeeeeeeeery complicated, it would also be great if the tutorial wouldn't just expect u to use MSVC but like..it would work under Borland or the mingw compiler also. Now, i am very dumb so i'll need something that'll show me exactly how to use winsock.h 'n stuff cause otherwise i wont understand. Does anyone know such a tutorial??? I'd be very thankfull if i would ever see one on the net.
Thanks thanks thanks lol;P
Kuniva
Want, take, have.
|
|
|
|
|
|
Thank u, this is exactly what i was looking for
Kuniva
Want, take, have.
(oh btw, best way of learning some language is by looking at examples, start large!) :p
|
|
|
|