|
Use an OLE Clipboard for sending and receiving text data type. I recommend MFC. Otherwise, you are looking implementing your own COM solution.
Kuphryn
|
|
|
|
|
ummmmm
cant he just do GetText() and send it to the clipboard?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
Thanks,
A small example will be apprtiated.
Shay
|
|
|
|
|
Here is on solution to copy text to the clipboard via MFC wrapper to OLE Clipboard.
-----
CString szText(TEXT("October"));
HANDLE cbData = ::GlobalAlloc(GMEM_MOVEABLE, szText.size() + 1);
PTSTR pData = static_cast<ptstr>(::GlobalLock(cbData));
_tcscpy(pData, szText.data());
::GlobalUnlock(cbData);
COleDataSource *pODS = new COleDataSource;
pODS->CacheGlobalData(CF_TEXT, cbData);
pODS->SetClipboard();
-----
Kuphryn
|
|
|
|
|
HI
When I try to :
COleDataSource *pODS = new COleDataSource;
I get a comiple error of undeclared identifier.
Do I have to #include anything out of the ordinary to use the ole clipboard ?
Thanks once again for you effort, I appreciate it.
Shay
|
|
|
|
|
Greetings...
In a dialog box I am creating one cutsom drawn grid, now when the user presses TAB in the dialog box, the focus is changed to all other control except the Grid ?
I belive since I am creating Grid in the WM_INITDIALOG message of the dialog box the tab is not making focus move to the GRID ?
How do I make the focus move to the grid ?
Thanks
Ritesh
|
|
|
|
|
Try this
form the menu bar when you are in dialog edit screen chhose:Layout->Tab order and force it to be the fist one
Shay
|
|
|
|
|
You need to use the WS_TABSTOP style when creating the window.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
Greetings...
I have 3 edit boxes which are children of a tab control. The tab has 3 tab items with each edit window for its respective work.
Now when the user changes the tab how I make sure that the last page of edit box is always seen ?
I am getting the TCN_SELCHANGING message and am able to trap it but how to show the last page of text fully viewable in the editbox ?
Thanks in advance.
Ritesh
|
|
|
|
|
Did I miss something in the MSDN help files or what? I came to the conclusion that when accessing the serial port (using CreateFile) without overlapping that control remains on the process being performed on the serial port until it is completed (or timed out). The problem I am having is that when I attempt to read a response in from the serial port, its picking up part of the second to last write and all of the last write as well as the incoming data. Any suggestions welcome.
Of all things I've lost... I miss my mind the most
-mjf
|
|
|
|
|
In over 5 years of working with serial ports I have never seen CreateFile do that. However, that will happen when:
1. You are using a radio system.
2. Your remote device echos
3. Your serial line is one of those with only 1 T/R line so you get the cross talk.
This is actually very standard in communications and you will need to be able to ignore your own output.
Tim Smith
"Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
Hoare - 1980 ACM Turing Award Lecture
|
|
|
|
|
Five years with serial ports... my hats off to you. Been kicked there and back trying to learn to use efficiently this last week. I am nearly ashamed to admit that I didn't realize the device's echo was causing my problem (guess I couldn't see the forest on account of all them trees). Do you have any suggetions as to how I can elimate the echo's just prior to reading the incoming data? If I could just write a little code to strip off the last write that would be good enough be I'm not in control of just what it will be (on account that diffent address's will be sending data and each requires a different (albliet slight) command (the Write).
Either way, thanks for your input... it never ceases to amaze me how a second pair of eyes can that which I cant, even when its right in front of me.
-Mel Feik
Of all things I've lost... I miss my mind the most
-mjf
|
|
|
|
|
will give me all key strokes on all child windows on a CFrameWnd derived class... i need to have capture function key strokes also and have the ability to decide whether they pass through or not
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Just a guess
Try looking into PreTranslateMessage()
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Thomas George wrote:
i need to have capture function key strokes also and have the ability to decide whether they pass through or not
I think you need OnKeyDown or PreTranslateMessage
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I do this using PreTranslateMessage().
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hello,I need a full list of the windows hooks, could someone tell anything abaut this?
thanks
|
|
|
|
|
Anonymous wrote:
I need a full list of the windows hooks
That doesn't mean much IMO...
What do you mean a ful list of windows hooks...???
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
documentation here.
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2002 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Can you delete a toolbar icon from inside the Toolbar Resource Editor?
It seems the Resource Editor can only create them, but not remove them.
Thanks.
William
|
|
|
|
|
You can delete them. Just drag the button outside of the toolbar and drop it.
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
Thanks. I appreciate it.
William
|
|
|
|
|
Is there a way to do a bulk insert into an Access database that has no system DSN? I've created the DB on the fly with ADOX and now I want to be able to do a bulk insert using VC++. I know that there is a BULK INSERT command for SQL Server and I believe it is supposed to work with Access, however, I only see examples in the context of having a DSN defined. I just want to do so on the fly using a file path to the database. Any help would be greatly appreciated.
Thanks.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
I am trying to get a tooltip to show up for an entire window, not just a control. I know I am creating the window correctly, so I think it must be the values I am putting into the Toolinfo structure. If any one has any insight to what might be causeing the AddTool call to be failing I would appreciate it!
Here is my exact code of how I am doing it:
HWND hwndTT; // handle to the ToolTip control
TOOLINFO ti;// struct specifying info about tool in ToolTip control
WCHAR wszTTtext[]= L"This is your ToolTip string.";
/* INITIALIZE MEMBERS OF THE TOOLINFO STRUCTURE */
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
ti.hwnd = hwnd;
ti.hinst = _Module.GetModuleInstance();
ti.uId = (UINT_PTR)hwnd;
ti.lpszText = (LPTSTR)wszTTtext;
// ToolTip control will cover the whole window
ti.rect.left = rect.left;
ti.rect.top = rect.top;
ti.rect.right = rect.right;
ti.rect.bottom = rect.bottom;
if(!SendMessage(hwndTT,TTM_ACTIVATE,(WPARAM)TRUE,0)){
WriteLog(_T(" > Could not Activate TooltipControl\r\n"));
}
/* SEND AN ADDTOOL MESSAGE TO THE TOOLTIP CONTROL WINDOW */
if(!SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti)){
WriteLog(_T(" > Did not Create TooltipControl\r\n"));
}
|
|
|
|