|
I've spotted this in one of the files I'm maintaining:
#ifdef AFX_COLL_SEG
#pragma code_seg(AFX_COLL_SEG)
#endif A quick look on MSDN tells me that the code_seg part "specifies a code section where functions are to be allocated". What does that actually mean, what's happening here? MSDN also says I can reset allocation with #pragma code_seg() - do I need to do this, as it's not allready done?
Dylan Kenneally
London, UK
|
|
|
|
|
Comments in MFC source (afxver_.h) suggest that this is 'swap tuning'. Using code_seg changes the ordering of the functions in resulting executable; by placing commonly used functions together you may get some performance boost.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Read up on the PE format (knowing MS COFF a bit couldn't hurt either).
What it in practice means is that for a "normal" program your code is located in the PE section ".text", and this pragma changes it to something else.
|
|
|
|
|
I want to create an auto-complete edit control. The text that user keydown and the text that automatically appear at end have difference color.
How can I override CEdit to print characters in difference color in the same edit control?
|
|
|
|
|
sonshiro wrote:
The text that user keydown and the text that automatically appear at end have difference color.
Usually auto-complete control just selects the completed part - user will see background and text colors reversed.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
I don't want to do that way. I want the completed part be shown with difference text color but have same background color.
|
|
|
|
|
Hi !
For my app, I need to display a virtual keyboard on screen. This virtual keyboard will be used through a touch screen. I have to follow specific norms, and the size of the keys have to be at least 1 centimeters wide.
I also would like to be able to show and hide this keyboard from my app.
I tried to find such keyboard on the internet, but didn't find something which would fullfill my needs (in particular regarding the size of the keys). Do you know of any virtual keyboard which would be suitable for me ?
I also was thinking of developping my own virtual keyboard, in VB or in C++, as an ActiveX, but I'm facing some problems : as soon as I click on a key, this key get the focus and thus, sending a keystroke to the control having the focus is actually sending a keystrock to the virtual keyboard !
Any suggestions to help me get started ?
Thank you for your help !
Jerome
|
|
|
|
|
What about using the one built in into Windows? Should do the trick. Just install the accessibility features.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
I tried it, but the problem, that I mentionned in my post, is that the keys are far too small for my needs !
I also wouldn't know how to control it from my app to display it and to close it when I want.
Thanks anyway !
Jerome
|
|
|
|
|
Look at http://www.madentec.com/[^] the original creator of the windows virtual keyboard.
But if you go for a roll-your-own solution, start with not processing the activation and focus messages. Just use mouse events. Its a bit tricky but not too difficult to do.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
Hi all,
I have added a tool tip control to my dialog.How can i get the tool tip text in a string when mouse is over a cotol?
With regards
shibu
|
|
|
|
|
Your dialog will get TTN_NEEDTEXT notification.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Can you tell me how can i handle this in a dialog based application?
|
|
|
|
|
Have a look at DLGCBR32 Visual C++ sample.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Hi
Does anyone know how can I install a printer driver from VC++ code ?
And how can I set the driver to print always to a file not to a real printer?
Please help if you can (also if you have the answer for only 1 question)
Thanks a lot
Jancsi
xxx
|
|
|
|
|
There's a system API called AddPrinterDriver , seems like a promising starting point.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
The RASENTRY struct is defined differently for XP than for 2K.
Now this is an issue for me.
The XP version has a member called dwfOptions2 which the 2K version does not!
Now if I define WINVER as 0x501 I get the XP struct, but now the program won't work on 2K. If I don't do this, it will work on 2K and XP. Except that on XP I require to set an option for dwfOptions2. Now I don't see a way out other than 2 separate exes
Any ideas anyone?
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Have to .cpp s that handle the RasSetEntryProperties for 2k and XP respectively (providing functions say SetEntryProps2k and SetEntryPropsXP ), and set the WINVER macro appropriately in each file. At run-time you can select one or another version depending on the OS the program is running on.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
You'll make me blush
Happy rasdialing
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Another approach: copy the struct definition, split it into w2k and xp (kind of RASENTRY_XP) and just do a if(os == XP) whatever((RASENTRY*)&my_rasentry_xp); - spares you different executables.
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
|
Hello I want to save and print the window generated by my Dialog based application. If any body knows the solution please tell me.
Ravi
|
|
|
|
|
Alt+PrintScreen copies current window to clipboard.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
RasSetEntryProperties returns ERROR_INVALID_SIZE on 2K but works fine on XP
Code follows :-
RASENTRY re={0};<br />
re.dwSize = sizeof(RASENTRY);<br />
re.dwfOptions = RASEO_ModemLights|RASEO_ShowDialingProgress|RASEO_PreviewUserPw;<br />
re.dwfNetProtocols = RASNP_Ip;<br />
strcpy(re.szLocalPhoneNumber,"0,35");<br />
strcpy(re.szDeviceName,s);<br />
strcpy(re.szDeviceType,"modem");<br />
re.dwFramingProtocol = RASFP_Ppp;<br />
DWORD err = RasSetEntryProperties(NULL,"HelloWorld",&re,sizeof re,NULL,0);
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|