|
How intuitive is a ReplaceSel() function compared to InsertText()?? Give me a break. I, as a user, should not need to scour through the entire documentation to do something so inherent to RichEdit boxes. This is what I have to do to insert text at the end of the current text in the control:
int len = GetWindowTextLength()
SetSel(len,len);
ReplaceSel("whatever")
What I'm saying is this is far too much unecessary work to do something so simple. Besides, the documentation is not even clear about whether to do this or use the StreamIn() method. All I'm saying is that this can be far simpler than it is right now.
Sriram
|
|
|
|
|
To me it's very intuitive. ReplaceSel with no selection inserts. What would you expect it to do when there is no selection (or more precisely, a selection of 0)?
Taking your example one step farther, why should it alway add text to the end when inserting text? What if you want it inserted at the beginning, or in the middle?
This is standard. Look at the C Runtime library, which forces you to seek in the file to the point you want to overwrite. There is no "Write to end of file" function.
Microsoft gives you the flexibility to do what you want. And yes, as a programmer you *SHOULD* be familiar with every word of the documentation for what you're working with. You don't have to remember it all, but you should be familiar with it and be able to find what you're looking for easily.
StreamIn is used for (not surprisingly) streaming data into the control from a file, not for general replacement or insertion of text.
|
|
|
|
|
Hi,
In our application we have the requirement that all edit boxes should have the data right-aligned. I have set the properties for the edit box reource as 'multi-line' and 'Alignment = Right'. The problem is that when I use the mentioned settings, the cursor becomes a thick line (Similar to the cursor observed in 'Notepad'). Is there any way in which Right-alignment can be obtained in Edit Boxes, retaining the normal thin line cursor?
Kindly let me know if there is a solution
Thanks,
Unnikrishnan Nair
|
|
|
|
|
HELP!
How do I hide the right-top toolbar of CFileDialog.
When I do:
CWnd* pWnd;
pWnd = GetParent()->GetDlgItem(lst2);
pWnd->ShowWindow(SW_HIDE);
I can instantly hide the Listcontrol in the CFileDialog but what's the
address of the toolbar
CWnd* pWnd;
pWnd = GetParent()->GetDlgItem(0x.???); // = the address I need, not
defined in dlgs.h
pWnd->ShowWindow(SW_HIDE);
Does anyone have any idea's?
|
|
|
|
|
I would like to create font in my native language to use it with msword. Is it possible in VC.
If so give me the guidelines
Advanced thanks
|
|
|
|
|
Goto www.microsoft.com/truetype to find information about TrueType fonts. You may find links to TrueType font editor programs too.
Make sure your native language is supported by UNICODE, then you can use GDI to display these characters. Otherwise, you may have to use glyph indexes directly.
www.fengyuan.com
|
|
|
|
|
If CF_UNICODETEXT is only available when performing clipboard operations under NT / 2000, is that saying that it's impossible to copy / paste Unicode characters under Windows 9x?
Is there any way around this, for instance, to copy / paste Cyrillic characters while under Windows 9x??? Or am I screwed completely?
Do these rules apply to MBCS too, can MBCS even display cyrillic characters???
Any help appreciated.
|
|
|
|
|
9x/Me only use Unicode in limited areas, like OLE/COM and FAT LFN filenames. If you want/need to put Unicode text on the clipboard, you'll need to compose the Unicode strings by hand.
You can do an ANSI-to-Unicode conversion on a Cyrillic string (with MultiByteToWideChar() ), but that only works if the system's current ANSI codepage supports those Cyrillic characters. With DBCS strings, you must be running a Japanese/Chinese/Korean language version of the OS, and you can only deal with strings in the same language as the OS. Non-DBCS languages of Windows do not handle DBCS strings.
--Mike--
http://home.inreach.com/mdunn/
Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?
|
|
|
|
|
New to MFC, so if this is a simple question, don't nail me for it;
I have a CEdit-like control I wrote from scratch. Baring some niceties, it works okay. One thing that always
bugs me though, when I right click to get my context-menu, the cursor (IDC_BEAM) stays a beam. I want it to
be an arrow (IDC_ARROW) as per normal usage. The menu is defined only programatically, ie, not loaded from
a menu resource or the like:
inside my OnContextMenu() {
CMenu pop;
pop.CreatePopupMenu();
pop.AppendMenu(MF_STRING,ID_IMPEDIT_UNDO,"&Undo");
pop.AppendMenu(MF_SEPARATOR,0," ");
pop.AppendMenu(MF_STRING,ID_IMPEDIT_CUT,"Cu&t");
pop.AppendMenu(MF_STRING,ID_IMPEDIT_COPY,"&Copy");
pop.AppendMenu(MF_STRING,ID_IMPEDIT_PASTE,"&Paste");
pop.AppendMenu(MF_STRING,ID_IMPEDIT_DELETE,"&Delete");
pop.AppendMenu(MF_SEPARATOR,0," ");
pop.AppendMenu(MF_STRING,ID_IMPEDIT_SELECTALL,"&Select All");
> validation/etc snipped <
pop.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON,
point.x, point.y, this, NULL);
pop.DestroyMenu();
}
So how do I change it's cursor to an arrow?
|
|
|
|
|
Hello,
Is there any way to invoke/run my .exe when user log in to the system, or when
system is rebooted. Is there any way to do this in VC++ / NT2000.
thanks in advance
|
|
|
|
|
There is a registry key called Run, and one called RunOnce. Put the full path of your app in Run, and whenever Windows starts, hey presto !! Works for any Windows AFAIK.It's HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run ( or RunOnce to run only the next reboot).
That's how setup programs continue after a reboot, etc.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Or HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run
if it have to work with different users...
- Anders
|
|
|
|
|
I got some problems with dll files
its when i send my application to one of my friends
then it tells him that he need some dll files, that i got
due to (i think) i got visual studio 6.0 installed.. But he hasnt
Is there a way i can figure out what dll files my program uses?? so i can send them with?
that would be great..
|
|
|
|
|
With the dependency walker that comes with VC
Type "depends" on a commandline...
- Anders
|
|
|
|
|
Everything compiles fine except this linker error...can anyone help to clear it??
I have all of the headers included.
What am I doing wrong???
Thanks in advance,
Dan
|
|
|
|
|
Add mapi32.lib to the list of import libs in your linker settings.
--Mike--
http://home.inreach.com/mdunn/
Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?
|
|
|
|
|
It is linked! Here is the error view:
--------------------Configuration: MyMAPI - Win32 Debug--------------------
Compiling...
MyMAPIDlg.cpp
E:\Compaq\C++\ATest\MAPI\MyMAPI\MyMAPIDlg.cpp(182) : warning C4101: 'szTmp' : unreferenced local variable
Linking...
MyMAPIDlg.obj : error LNK2001: unresolved external symbol _MAPIReadMail@24
MyMAPIDlg.obj : error LNK2001: unresolved external symbol _MAPIFindNext@28
Debug/MyMAPI.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
MyMAPI.exe - 3 error(s), 1 warning(s)
Thanks in advance,
Dan
|
|
|
|
|
Huh, this is weird. I searched MSDN for "mapi lnk2001" and found Q188959, which says basically you don't link with an import lib. You instead have to load mapi32.dll and call GetProcAddress() on all MAPI functions you call.
--Mike--
http://home.inreach.com/mdunn/
Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?
|
|
|
|
|
Hi Micael,
That was it! Thanks for the tip!
Thanks in advance,
Dan
|
|
|
|
|
You might be failed to define a function after its declaration.
Please check it
|
|
|
|
|
I have a dialog that has no title bar. It is still displayed in the taskbar which is what I want, but the apps icon does not show in the taskbar. How can I display it? Also if I right click on the taskbar button it does not display the apps system menu like it does if it has a title bar. How can I solve this? Thanks...
|
|
|
|
|
Is it possible to store the contents of an image list into a file for later use for e.g. to recreate a tool bar or a tree view?
thanks
Subir
|
|
|
|
|
Has your user drawn the images ? I would have thought that commonly they would have chosen an order of images you already had, and that order is all that needs saving.
The answer is yes though, if you have code to save a bitmap, just extract it and save it.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
hi
i have obtained the handle to the image list being used in the tool bar of a browser. this is the only data about the list that i have.what do i do next?
is there a way to obtain the location of the icons used in the image list
using a handle to them?
thanks
Subir
|
|
|
|
|
How would I go about trying to get two programs to communicate over a LAN.
I intend to live forever... so far so good.
|
|
|
|