|
Have you tried CWnd::GetNextWindow.
MSDN description of function says
"Searches for the next (or previous) window in the window manager’s list. The window manager’s list contains entries for all top-level windows, their associated child windows, and the child windows of any child windows.
If CWnd is a top-level window, the function searches for the next (or previous) top-level window; if CWnd is a child window, the function searches for the next (or previous) child window."
Use this function on main frame window .
In document class you can get main window by using function AfxGetMainWnd
|
|
|
|
|
could someone plz tell me how to control mouse movement using VC++
does any one have the code for it or even the logic would do.
Thank You
|
|
|
|
|
see SetCursorPos[^]
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
your query doesn't seem to be related to what you tried to ask
Why do you want to set the cursor position explicitly.
however if you still want to do it you can use the SetCursorPos() function
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Hello All,
I've a MFC application from which I've to call a routine from a DLL.
EARLIER, This DLL was getting used by a JAVA application.
But now there is a MFC application instead.
We dont' have to change the DLL code for this in any case.
The export routines have following declaration:
JNIEXPORT void JNICALL Java_gui_config_setManufacturer(JNIEnv *env, jobject obj);
Please let me know how this routine can be called from MFC application.
Thanks in advance!
Regards!
-- modified at 22:51 Thursday 23rd March, 2006
|
|
|
|
|
In C++ how we can associate a function with a variable. means the function should be called automatically when the value of variable changes.
|
|
|
|
|
i don't really understand. this cannot be done automatically - say, when you assign the variable, the function is called automatically.
but if the variable changes, it is because you assigned it, so why no calling the function right after this assignation ?
moreover, i'm not sure, by i have the impression that we don't have the same vocabulary.
what you call by 'variable' is a control over a dialog or a frame, which is associated with a variable ; what you need so is knowing when the control's content is modified so that the framework calls its event handler ?
is so, see the events of your control (EN_CHANGE for a CEdit control).
if i'm wrong, please reformulate your question because it is really not clear enough.
|
|
|
|
|
There is no way to do that in C++, atleast that i know of.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Just a thought.
What if you create a class, encapsulating a variable of the desired type?
And then, using operator overloading, call a (class) function when the value changes?
Right out of my mind, I think it should work.
Thoughts, anyone?
|
|
|
|
|
yes, it's a good solution, as you ask my thought.
but i still have a doubt about what the guy was asking, and i suspect him not to express himself correctly and not to want this...
anyway, as he doesn't give feedback...
|
|
|
|
|
yes - and make the actual data private which force all access to happen through the methods.
|
|
|
|
|
There is no standard way to do this. In MSVC you can use __declspec(property) to do it but note this is not portable.
Steve
|
|
|
|
|
I compile a project(ATL dll based) in VS.NET 2005 under windows XP(sp2) and the build configuration is x64. The IDE will always perform a registration after project successfully compiled. This is the trouble, my machine is 32bit and target dll is 64bit, it always show an error:
Project: error PRJ0019: A tool returned an error code from "Performing
registration".
It is deservedly error for 64bit file can't register under 32bit windows.
how could i get the dll under 32bit windows? by config the project setting or something else??(Stop the perform registration action?)
|
|
|
|
|
|
Hi!
I have dynamically created a CButton. How can I remove it totally (i mean it should not be visible anymore).
|
|
|
|
|
Example
CButton *m_Button;
m_Button=new (CButton);
m_Button->Create("Butotn1",WS_CHILD|WS_VISIBLE|BS_NOTIFY,CRect(0,0,100,20),this,IDC_BUTTON1);
m_Button->DestroyWindow();
|
|
|
|
|
Not sure but try
pButton->DestroyWindow()
and then
delete pButton;
should work
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
a CloseWindow() will take it off from screen.
VuNic
|
|
|
|
|
another option that you can try is
MoveWindow(0,0,0,0);
this moves the window showing the same effect as if closing it.
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
this is howful solution, as it doesn't actually deletes the button but reduces its size to 0x0...
do you expect to have a 250Mo dialog box which only has 3 controls on it ?!
|
|
|
|
|
hi all
i m using visuat stdio.net 2003 and mfc based applicaation.
following error occur in my application
debug assertion failed at atlsmptr.h at line 472
Expression (iChar>=0 && iChar <=GetLength())
it gives this error when i reach at this line marked by * during the debugging/executing.
asc=(int)m_strBarcodeValues[index].GetAt(1); * this line give error
where CString m_strBarcodeValues[91];
m_strBarcodeValues[32]=_T("011000100");//spacebar
asc=(int)m_strBarcodeValues[index].GetAt(0); works fine for this line
ddd
|
|
|
|
|
tasleem143 wrote: (iChar>=0 && iChar <=GetLength())
Means that either you are requesting a char at a position which is less than 0 or greater than the maximun length of the string itself, post the actual code then we will know more
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
thanks for reply
actually i was not calling the function that that used to initilze that particular cstring array. thanks once again.
ddd
|
|
|
|
|
Hello Tasleem
I am not getting y u r using an array of CString.
just declare an object of it as
CString str;
for (int i=0; i < somecondition ; ++i)
str.SetAt(i, somevalue);
I hope u got it.;)
By the way r u from Poona college.
|
|
|
|
|
thanks for the reply.
no yar i had not seen poona even in my dreams. i m from islamabd, pakistan.
ddd
|
|
|
|