|
Sample code please
Here is a piece of my code :
<br />
CEdit searchedit;<br />
CString srchstrl;<br />
searchedit.GetWindowText(srchstrl);
Remember the text is not returned, it is placed in the CString refrence.
Elaine
The tigress is here
|
|
|
|
|
Have you tried sending the control an EM_GETTEXTEX message?
Here's the link to the the msdn library entry on EM_GETTEXTEX[^]
"There is an empty room full of people who think you are creative"
|
|
|
|
|
GetWindowText should work. Post some code to see how you are doing it, and someone may be able to spot the problem.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
no. ive only tried WM_GETTEXT. ill go see if it works.
thanks for the help
|
|
|
|
|
i know im doing it right because it works for titlebars and stuff
read the post i made about the classes they are and maybe that will help u help me
|
|
|
|
|
can u fix this code for me? i dont understand how to use GETTEXTEX
<br />
GETTEXTEX gte;<br />
ZeroMemory(>e,sizeof(gte));<br />
gte.cb = 512;<br />
gte.codepage = CP_ACP;<br />
<br />
SendMessage(hwnd,EM_GETTEXTEX,(WPARAM)>e,(LPARAM)temp);<br />
|
|
|
|
|
Using GetWindowText may not work for windows created in another process, but sending WM_GETTEXT directly should work anyway.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
From MSDN's documentation for the GETTEXTEX Structure[^]:
"The GETTEXTEX structure contains information about an operation to get text from a rich edit control"
Are you trying this with a rich edit control? Otherwise, I don't think it will work.
Try this instead:
const int nBufLen = 512;
TCHAR buffer[nBufLen];
SendMessage(0, WM_GETTEXT, nBufLen, (LPARAM) buffer);
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
no, i already tried that.
the classes of the edit controls im trying to read are UsTextEditPane and Ate32Class
if that helps at all
|
|
|
|
|
Tim Zorn wrote:
no, i already tried that.
And...? What was the result? Post some code to see how you are doing it and what specific error you get.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
when we open a child window in a MDI application, and maximize it, its caption-bar diappears and its close, maximize and minimize buttons appears in the menu-bar.
when user maximizes an MDI child window and then clicks its close button, what message is sent to my program? i can't trap it.
|
|
|
|
|
I'm not shure, but isn't it a WM_PARENTNOTIFY message?
"There is an empty room full of people who think you are creative"
|
|
|
|
|
No.
it is a message that sholud be trapped after WM_COMMAND message.
|
|
|
|
|
hiho@ll
i had a look at this tutorial
to capture video from a webcam
now i need just the RGB data from the webcam!
i don't want the webcam data to be displayed on the screen (well i want it too) but i need the binary data!
anybody knows a filter which i can use to grab the data
cause i'm a noob at this topic, a tutorial or a sample code would be great
hmm
btw maybe i'm wrong, but it seems that there is no tutorial about direct show programming! or not?
i search for some, but i only get some doc about some functions
but what if i want to prog my own filter, how do pins work and what are they exactly?
it's not easy to find a good basic tutorial about directshow programming!
anybody knows a good resource?
thx@ll
|
|
|
|
|
To prevent rendering you'll need a null renderer
To capture images from the graph you'll need ISampleGrabber (or a variant)
Source Filter -> ISample Grabber -> Null Renderer
If you're looking for a simple way to do this, have a look at OpenCV (Intel's Open Computer Vision Library) hosted on sourceforge - you should be able to borrow or modify enough of their code to get started.
|
|
|
|
|
hiho
thx for your help!!
this library (OpenCV/cvcam) is damn cool!
it's exactly what i need and i just got it run
but i have a little problem, maybe you can help if you already worked with the library
i have a IplImage pointer to the image from which i want to read the image's RGB values
my problem is the access to the rawdata array!
the pointer points to a image structure with a value
imageData = the raw data
imageSize = the byte size (i think)
in an example i saw this code
memset(img->imageData, 0, img->imageSize/2);
which simply set's the first half of the image to black
this code crashes my prog!
the same happens if i use a loop to read every pixel values
i just can read the first 146047 bytes of the buffer
then it crashes
i'm sure it's because it's a segmentation fault
so my question
if i use image->imageSize as a byte limit for the image raw data buffer
and this is wrong
how do i know the exact size of the raw data buffer? because imageSize doesn't seem to be correct
thx
|
|
|
|
|
Hi,
I am a newbiew to .NET, MFC and Visual C++.
I have multiple Views (Say View A, B and C), and a Document in my Design. On the Print and Print Preview I need to print information from all the views. Currently I have overloaded the OnPrint() function in View A.
After View A 's print is done, how do I get it to Print View B and View C's Data. Should I post a Message to View B and C passing the CDC object, and each of the View (B &C) use the CDC object and continue the printing.
Please let me know if thats the right way to do or if there is a better way. Also how do I print across pages.
Thanks for your help.
|
|
|
|
|
Certainly you could pass a message with CDC as parameter - or create custom class to do printing and from the OnPrint method in one of the views create an array of pointers to all other views and pass this as a parameter to your print method that would then print all of them.
As per printing accross pages - done it few times and always a headache. One of the better techniques I used was clipping rectangles (per page) and moving CDC drawing origin according to the page being printed. I think this worked the best for me.
Good luck
Regards
JP
|
|
|
|
|
Hi All,
I have been trying to do this simple task for half a night and as simple as it sounds, I can't get it to work.
I have a listview and I am trying to get the text of the selected item when user selects one (this is a single select listview). I've tried the following but none work:
System::Void Form1::lv_files_SelectedIndexChanged(System::Object * sender, System::EventArgs * e){
String* sss = lv_files->SelectedItems->Item(0)->Text;
ListViewItem* selectedFile = dynamic_cast<ListViewItem*>(e);
String* sss = selectedFile->Text;
}
So how do I actually get the text of the selected item? Im tired, and passed the pissed off point so any help would be appreciated immensly
TraileR ParK LifE 4Ever >:{
|
|
|
|
|
|
It worked! Thanks a lot!
...And I've been trying all those complicated ways when this short line does it!
Thanks again
TraileR ParK LifE 4Ever >:{
|
|
|
|
|
gr8coaster329 wrote:
...And I've been trying all those complicated ways when this short line does it!
Exactly my feelings whenever I see James Bond seducing yet another Bond girl.
gr8coaster329 wrote:
Thanks again
No problem. Glad to be of help
--
"the name's Lamas, Jose Lamas" jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
lv_files->SelectedItems[0]->Text
Hi - I'm having this same issue. When I try the solution above, I get
error C2227: left of '->Text' must point to class/struct/union
(The intellisense also warns me that it won't work.)
My code is:
String* test = listView_Main->SelectedItems[0]->Text;
Any suggestions?
Thank you,
--Jordan
|
|
|
|
|
Hi
My program suppose to be sometimes hidden. when the user wants to show it, its button in the taskbar does not have the correct status. that means that if the program was first maximized (before hiding it) it is being shown maximized too but the minimize button (on the window corner) does not work and right click on its taskbar button shows only the maximize button.
Here is the code when hiding the window:
<br />
::GetWindowPlacement(hWnd,&sWndPlt);<br />
::ShowWindow(hWnd,SW_HIDE);<br />
And here is the code when Showing the window:
<br />
::SetWindowPlacement(hWnd,&sWndPlt);<br />
::ShowWindow(hWnd,SW_SHOW);<br />
::UpdateWindow(hWnd);<br />
::SetForegroundWindow(hWnd);<br />
::SetActiveWindow(hWnd);<br />
Is there a way to solve this problem?
Thanks a lot
mamtz
|
|
|
|
|
Is your MinimizeBox property of your form set to False?
TraileR ParK LifE 4Ever >:{
|
|
|
|