|
In OnInitDialog() your Dialog, uses MoveWindow or SetWindowPos functions for move your dialog
Best regards,
Eugene Pustovoyt
|
|
|
|
|
can you give me a example how i can use the function "SetWindowPos" ?
I must place the dialog box in a corner (at the bottom left hand corner)forever and ever.
thanks
lucky
|
|
|
|
|
You're must get the coordinates of a corner and then ...
SetWindowPos(HWND_TOP, x, y, 0, 0, SWP_NOSIZE);
Best regards,
Eugene Pustovoyt
|
|
|
|
|
i want to show a string in vs.net debug output window.
i think i can use Trace or Debug class. but i dont now how to use them to display a string in managed code ?
if there exist some other way plz tell?
i want to see the execution and flow of my program
can any bode tell?
plz write the complete syntex.i will be very thank full to u.
r00d0034@yahoo.com
|
|
|
|
|
I'm trying to get data from the controls on a seperate application. I can get the HWnd and can do some things to the controls (DeleteAll from a ListBox for example) but other things cause the other application to crash. In particular I have had no luck at all trying to access the TreeCtrl from the handle to a TreeView. I'm trying to do this using MFC, if possible. But attach() and subclasswindow() don't seem to be designed to do what I want. Anyone have more of a clue than I do? Thanks in advance.
This works for a ListCtrl as long as I have a valid m_hWnd:
CListCtrl test;
test.SubclassWindow(theWin->m_hWnd);
test.DeleteAllItems();
test.UnsubclassWindow();
This does not work for a TreeView:
CTreeView test;
CTreeCtrl test2;
test.SubclassWindow(theWin->m_hWnd);
test2.SubclassWindow(test.GetTreeCtrl());
test2.DeleteAllItems();
test2.UnsubclassWindow();
test.UnsubclassWindow();
|
|
|
|
|
I'd say you're lucky your subclassing scheme hasn't crashed yet --basically you're instructing the external process to divert code execution to your own window proc, which is a guarantee to failure.
You can look at the source code for the methods you're interested in: they reduce mostly to various SendMessage s which you can easily replicate in your code without subclassing.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks,
What would I do for a TreeView. I need the handle to the TreeCtrl to do anything but I can't use SendMessage (as far as I can tell) to get it.
|
|
|
|
|
You could use macros like TreeView_DeleteAllItems(hWnd) to manipulate the TreeView.
The macros for the TreeView are here[^].
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|
|
They are the same window. MFC keeps them logically separate so they can be delt with in different ways by other objects, but as far as Windows is concerned there is just the TreeCtrl.
Shog9
------
If you really what to get shitfacde tell a crowded bar that is is yourt borthday and hife your wallet. you ka will many more friends.
- David Wulff, Brithday selebrations, 9/19/02
|
|
|
|
|
Thanks guys, seems to do what I need!
|
|
|
|
|
Each program runs in its own protected memory space. You cannot just pass in pointers because memory in your app's space cannot be accessed by another app (not without doing shared memory).
The subclass window calls effectively redirect the control's window proc to your own, which is not in the same process, so it will crash immediately.
Some messages can be passed, as long as they don't involve pointers. That's why LVM_DELETEALLITEMS works, it has no parameters.
Now, the exception is the USER controls (the ones from Win 3.1, list box being one of them). The OS is designed to handle messages sent between processes for Win 3.1 compatibility (where this was possible because all apps shared the same memory). However this is a special case, no controls introduced with Win 95 or later work this way.
--Mike--
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
|
|
|
|
|
I have an app created with the CreateDialog function. When i want to show a popup dialog in my app i use the CreateDialog function again. But when the user closes the popupwindow both windows get closed, why?
|
|
|
|
|
It's hard to say without further info, but it could be that your popup is calling PostQuitMessage on exit time.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How could I modify the following code so that the if, else if, and else conditions are counted and printed at the bottom?
{
int a, b, c, d, e, f; /* For key cuts 1, 2, 3 ... */
int pins, cuts;
cuts = 6;
pins = 5;
for (a=1; a <= cuts; ++a)
for (b=1; b <= cuts; ++b)
for (c=1; c <= cuts; ++c)
for (d=1; d <= cuts; ++d)
for (e=1; e <= cuts; ++e)
for (f=1; f <= cuts; ++f)
if( a == b && b == c && c ==d && d == e && e == f)
printf("%3d %3d %3d %3d %3d %3d Unacceptable per Rule #2\n", a, b, c, d, e, f);
else if(( (b > (a+4) | b < (a-4)))
| ((c > (b+4) | c < (b-4)))
| ((d > (c+4) | d < (c-4)))
| ((e > (d+4) | e < (d-4)))
| ((f > (e+4) | f < (e-4))))
printf("%3d %3d %3d %3d %3d %3d Unacceptable per Rule #1\n", a, b, c, d, e, f);
else
printf("%3d %3d %3d %3d %3d %3d\n", a, b, c, d, e, f);
}
|
|
|
|
|
What is the purpose of this problem? Are the for-loops at the top for incrementing or for setting values?
Kuphryn
|
|
|
|
|
I want to convert a vc regular dll project to a static library.
Is there any way i can do this w/out having to create a new project and import all the files into it.
Can i do this using TMAKE or something...
any advice would be appreciated.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Do you want to know how to set Visual C++ to compile the DLL project in static-library mode? If yes, you can set the mode in properties.
Kuphryn
|
|
|
|
|
You have to create a new project and then e.g. drag'n'drop the files from your DLL project to your newly created static library project.
|
|
|
|
|
I can't believe i didn't think of that.. brilliant.
Cheers.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Does anyone know where to get an addin that will automatically wrap DaoRecordsets around a Table? I miss this feature in VS.NET. or a better way of getting info from a DAO database?
Keep Slacking,
slack
|
|
|
|
|
why I try to add a resource useing the menu option 'add resource' the Visual Studio .NET IDE looks like its doing something then just dissapears. Has anybody seen this before or know what could be causeing it? I'm using it to write unmanaged VC++ and I added a registry explorer macro that i removed when this started to happen. Anybody got any ideas. I've checked all the knowledge bases i could find and can't find anything like it.
Keep Slacking,
slack
|
|
|
|
|
When I switch to release build, I get the following error
C:\AMS\src\Apps\DynamicDataCollector\Viewer\ViewerDlg.cpp(792) : error C2664: 'MessageBoxW' : cannot convert parameter 1 from 'char [46]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
This is the offending line of code:
MessageBox("No Data available for the selected parameters", "Data", MB_OK);
This code is fine under debug build. What is happening?
|
|
|
|
|
building unicode?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks a lot for the hint, yes, building in Unicode.
Forget all the _T
|
|
|
|
|
#include <stdio.h>
void main( void )
{
int a, b, c, d, e, f; /* For key cuts 1, 2, 3 ... */
int pins, cuts;
/*int cmbArray[6]; Array for each combination*/
cuts = 6;
pins = 5;
for (a=1; a <= cuts; ++a)
for (b=1; b <= cuts; ++b)
for (c=1; c <= cuts; ++c)
for (d=1; d <= cuts; ++d)
for (e=1; e <= cuts; ++e)
/*for (f=1; f <= cuts; ++f)*/
if(a=b=c=d=e)
printf("%3d %3d %3d %3d %3d Unacceptable per Rule #2\n", a, b, c, d, e);
else
printf("%3d %3d %3d %3d %3d\n", a, b, c, d, e);
}
This outputs only the if condition. Why doesn't the else statement print? I should get a few thousand lines instead of only six.
Thanks.
|
|
|
|