|
Which hook do I need to use? I was thinking SYSMSGFILTER since its a global hook.
|
|
|
|
|
i get the handle of a textbox in an opened window using the function
EnumChildWindows(,,)..
after i obtained the handle of this textbox i want to set a specific
string in this textbox.
"HINT" : the function SetWindowText(,) isn't a valid to this task(why?)
more--->
the opened window has a textbox ,a button ,a label;
and when i used the spy++ program of Microsoft tools to get the caption
to each of them after using SetWindowtext(,),i observed that:
the caption of the label is same as the value appears on it<the
caption="" and="" value="" appears="" are="" equal="" to="" each="" other="" the="" string
posted="" by="" setwindowtext()=""> ,BUT
the caption of the textbox isn't the same as the value appears on it
<the value="" is="" nothing="" but="" the="" caption="" equal="" to="" string="" posted="" by=""
setwindowtext()="" function="">then i want an API function to set the value of the textbox not the
caption..
thank you very much for any help..
Sender :Amr abdel mohsen
Email: app_prog@yahoo.com
|
|
|
|
|
amr abdel mohsen wrote:
then i want an API function to set the value of the textbox not the
caption..
I think you are a bit confused as to the purpose of the WM_SETTEXT message. For an edit control, the text is the contents of the edit control. For a combobox, the text is the contents of the edit-control portion of the combobox. For a button, the text is the button name. For other windows, the text is the window title. SetWindowText() is the function you want.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hello, there.
I have a dll, which is loaded by the host application, and in the exported function I show a dialog. I had no problem until I put a custom control in the dialog. If custom control is present in the dialog m_dlg.Create(IDD_DIALOG1) returns 0. (does not properly create a dialog).
I traced the problem down to the
hWnd=::CreateDialogIndirect(hInst,lpDialogTemplate,pParentWnd->GetSafeHwnd(),AfxDlgProc);
All parameters has some values (not NULLs), but, if a custom control is present in the dialog, returned value is 0, which makes hWnd to be NULL. If custom control is deleted everything is just fine!
Immidiatly after that there is ::GetLastError(), but it also returns 0 (operation is successful) even though hWnd is NULL.
I do not associate custom control with any class. I just drop it down on the dialog (it does not work with an associated custom control either).
Any ideas? Thanks in advance.
Regards,
Alexander.
|
|
|
|
|
Hi:
I have an MFC dialog based app. When someone clicks on ENTER button while dialog is up, the dialog window disppears. I have no idea how to make the dialog responds to "Enter" clicks.
Any help will be appreciated.
Thanks.
|
|
|
|
|
I guess you just have to override the OnOK() method, like this...
SampleDialog.h:
virtual void OnOK(); SampleDialog.cpp:
void CSampleDialog::OnOK()
{
} If a user now presses enter the dialog won't close anymore...
Regards, mYkel
|
|
|
|
|
I tried that, and thanks it worked.
|
|
|
|
|
Maybe you also want to to another action when the Enter button is pushed. for that, you have to change the default button of your dialog. the default button is the one that is pushed when Enter is pressed. you also have one associated to the Esc key.
TOXCCT alias Nicolas C.
|
|
|
|
|
Hi all;
I am writing an application which will have an ADO-based database connection. In order to send stuff to the DB, i need to convert variables from CString, char, int or Date into variants. However, it does not work for int and i still cannot figure out how to add data in a field whose type is date.
Could somebody please help me.
Thanks guys
Krugger
|
|
|
|
|
_variant_t( double dblSrc, VARTYPE vtSrc = VT_R8 ) Constructs a _variant_t object of type VT_R8 or VT_DATE from a double numerical value. Any other VARTYPE results in an E_INVALIDARG error.
(msdn...)
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
int is an oddity, try casting it to a long.
Steve S
|
|
|
|
|
Hi all.
I am building an application with a web-browser in the main view. Hence, each time the application loads, i get the browser which can be used to display different HTML files. However, when i choose a specific file from the menu of my tool, i should allow specific pages to load. However, i just don't know how to do it. D'you get the point? When i click on a menu item, i need to display the associated page in the web browser but i do not know how to get access to the browser when i am calling it from another class.
Can somebody please help me.
Hope that i made myself clear.
Thank you guys;
By the way, i'm new to VC++ and i must say that you give killer advices. Thanks guys!
Krugger
|
|
|
|
|
Que's Special Edition Using Visual C++ 6 by Kate Gregory (www.gregcons.com) has a sample that is close to what you are trying to achieve. They also publish Building Internet Applications with Visual C++.
Ger
|
|
|
|
|
Hi,
As the rest of this message will show well enough I'm new to Visual C++ and trying to resolve a rather elementary problem :
I have a function that accepts an input from the console and I need to check that the type of the value received is 'int' before attempting some computation on it.
1) Does anybody know how to do that ?
2) I desperately tried to find the answer in Visual Studio documentation but have drowned in the sea of documentation offered... is there any clear language reference supplied with the tool, organised in such a way you can actually find something in it ?
Many thanks,
~David
|
|
|
|
|
it's not a language feature.
You need to do this manually; for example, check if the value is smaller than zero, will return from the method.
bool AClass::AMethod( int anInt )
{
if ( anInt < 0 )
return false;
return true
}
(also, look for ASSERT/assert in MSDN )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote:
for example, check if the value is smaller than zero...
But an int can have a less-than-zero value. Negative values are not invalid int s.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
|
Anonymous wrote:
I have a function that accepts an input from the console and I need to check that the type of the value received is 'int' before attempting some computation on it.
1) Does anybody know how to do that ?
If the function accepts an int as a type, there's nothing else it could be.
Anonymous wrote:
2) I desperately tried to find the answer in Visual Studio documentation but have drowned in the sea of documentation offered... is there any clear language reference supplied with the tool, organised in such a way you can actually find something in it ?
Depending on what you are seeking, Google and MSDN are useful resources.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
|
Always accept input from the console as a string: fgets is the old standby,
or cin.getline() to use c++ style
Then there are a couple of possibilities for extracting data from the string
and checking its type. You might look at the sscanf function.
|
|
|
|
|
Anonymous wrote:
I have a function that accepts an input from the console and I need to check that the type of the value received is 'int' before attempting some computation on it.
1) Does anybody know how to do that ?
That depends on how you are reading it. If you use
int x;
std::cin >> x;
then a simple way to test for failure is with
if(std::cin)
after the read operation. This will return true if all went well and false if it didn't.
Because there are different failure conditions, there are different flags that can be set following failure and there are different functions for checking on them. If you want this level of detail, then it isn't simple because the same flag can be set in response to more than one type of failure and because there is not a one to one mapping between flags and the functions for retrieving them.
If there is a read failure, then you need to reset the input stream (using cin.clear()) so that reading can continue. You also need to tell cin to ignore the erroneous input with cin.ignore(...). I suggest you consult a good C++ book that covers IO Streams.
Anonymous wrote:
I desperately tried to find the answer in Visual Studio documentation but have drowned in the sea of documentation offered... is there any clear language reference supplied with the tool, organised in such a way you can actually find something in it ?
Unless you already know what you are looking for, you are unlikely to find it. Get yourself several good C++ books plus The C++ Standard Library by Nicolai Josuttis.
John Carson
"I wish to propose for the reader's favourable consideration a doctrine which may, I fear, appear wildly paradoxical and subversive. The doctrine in question is this: that it is undesirable to believe a proposition when there is no ground whatever for supposing it true."
- Bertrand Russell
|
|
|
|
|
I need help Using HTMLHelp topic templates. I am trying to find out how to use topic templates on a HTMLHelp project so the style will be consistant. Can you point me to some direction? I have researched from the HTMLHelp help file and the web. I found information on sample codes of templates, but I do not see any example on how to use the templates.
Elizabeth
|
|
|
|
|
Hi ,
I"m working on an image processing application and I need a way to convert/return a BITMAP handle to IPicture, so that I can show the return IPicture in VB.PictureBox control.
Nathani
|
|
|
|
|
Hi Nathani,
In VC++ use CoCreateInstance() to create the IPicure COM object. Then select the bitmap and everything and then pass the handle to VB using IPicture::get_Handle(). Do not worry about process boundaries, since it is the same process.
Ivor S. Sargoytchev
Dundas Software
|
|
|
|
|
i have a flexgrid and i want to enter time into one cell with a date time control
i have managed to make it visible at the click of that particular cell and invisible at lost focus
now what i need is to position the datetime control during run time relative to the click event
for this i think i need the handle of the datetime control
so how can i get that and tell me if there is any other way out to get this done
the codes which i use now r as follows
on click event of the flex grid
******
if((m_fgAppRem.GetCol())==3) //if col 3 is clicked
{
GetDlgItem(dtpFlexGrid)->ShowWindow(true); //Date time control made visible
m_dtpFlexGrid.SetFocus(); //set focus to datetime control
}
where
m_fgAppRem is the member variable of flex grid(CString)
m_dtpFlexGrid is the membervariable of datetime control(CDaateTimeControl)
*******
i think i have to add the following line to position the control at run time
::SetWindowPos(m_dtpFlexGrid.m_hWnd,
wndNoTopMost,
ParentPosition.left + 555,
ParentPosition.top + 3810,
0, 0, // ignores size arguments
SWP_NOSIZE);
where m_dtpFlexGrid.m_hWnd is the handle of the date time control
but i am not getting the handle of the datetime control
ie (m_dtpFlexGrid.m_hWnd0) 's control
so please give me a solution
Salil cheeran
Bangalore
INDIA
|
|
|
|