|
I don't think you'll be able to minimize window when its thread is suspended. What kind of applications are these child processes? Are there your apps or 3rd party code?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
hi thomasz
i managed to get them minimizing and stuff by doing a showwindow() before suspending the threads ... im ending them with terminateprocess() which it says in msdn is bad bad bad but it works ok ... unless there is a gotcha waiting for me?
two of the apps are the flash player showing diff movies and the other is an app im writing
another question that is baffling me is how do i get the apps to show on a particular display device in winxp with multiple monitors attached? i cant find anywhere in the createprocess() stuff that lets me specify that
thanks for help
"... 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" sonork: 100.18128 8028finder.com
|
|
|
|
|
lauren wrote:
i managed to get them minimizing and stuff by doing a showwindow() before suspending the threads ... im ending them with terminateprocess()
er, you may not want to do that... Sounds like a prime way to cultivate memory leaks... maybe it's all good, donno... sounds dangerous though. You couldn't just hide the windows & send them WM_CLOSE messages?
lauren wrote:
another question that is baffling me is how do i get the apps to show on a particular display device in winxp with multiple monitors attached?
Think of it as just having a huge virtual screen, bits of which (not necessarily contiguous bits...) map to actual physical monitors. You can enumerate the available monitors, retreive the bounds for the one you want, and then just position the windows onto it the same way you'd move them around the screen normally.
---
Shog9
If I could sleep forever, I could forget about everything...
|
|
|
|
|
Hi..
I have did some simple graphic (not a bitmap) about texture mapping on a sphere in the CView (using MFC). Now I want to show it in a rectangle frame in a dialog box. I dont want the code anymore in CView but only as a preview in a dialog box. Is there any way to do this? Is there any website I can refer to?
|
|
|
|
|
Derive a class from CWnd and use it as user control in dialog. OnPaint handler should perform the texture mapping or whatever you want to display.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Hi,
Is it possible that CFileDialog interferes somehow (for example due to some mistake) later opening of a file using fopen?
I have a setting dialog and its state can be loaded and saved. I'm using CFileDialog to get the file name and path to be saved/opened and serialization for the loading itself. The setting file is opened from the menu.
The error occurs if I first either load or save the settings and then try to run one thing in my program. In that "one thing" a file is tried to be opened using fopen but the opening fails. If I remove the CFileDialog from loading and use static file name instead when opening a file using CFile the opening succeedes.
Are there some other things that usually interfere fopen?
-Janetta
|
|
|
|
|
Can you check errno variable when fopen fails? This will give you more info on why fopen failed.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Hi,
the CFileDialog changes the current working directory when you select a particular file. Are you using the value of current directory in any way for opening the file?
To prevent this change in the current directory, use the OFN_NOCHANGEDIR flag in the member variable m_ofn of CFileDialog.
HTH
|
|
|
|
|
Problem solved. Thanks!
-Janetta
|
|
|
|
|
How can I get all key stoke events in my application, not just those
I get when my application window is active?
|
|
|
|
|
See SetWindowsHookEx with parameters WH_KEYBOARD and WH_KEYBOARD_LL.
|
|
|
|
|
I have seen those, but I still don't get it rigth. Can you give
me some example of it?
|
|
|
|
|
1) http://msdn.microsoft.com/msdnmag/issues/0700/Win32/Win320700.asp - example of WH_KEYBOARD_LL hook (works on WinNT and later)
2) Make search in CodeProject for "hook" word in article titles, you will see number of useful articles:
http://www.codeproject.com/dll/keyboardhook.asp, http://www.codeproject.com/dll/hooks.asp
|
|
|
|
|
Hello there,
I just add his classes to my project and i was just wondering when i got a strange error like this:
e:\microsoft visual studio\myprojects\dataentry\ado.cpp(2387) : fatal error C1010: unexpected end of file while looking for precompiled header directive
ado.cpp is his source file ...
What's the wrong ?
Help me, please ...
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
|
Hello,
Thanks for reply ...
I did a kiddy wrong, sorry :P
Thanks alot for your reply ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Consider declaration :
std::string s1=("command:userID:Password");
I want to separate s1 into three sub std::strings by searching colon ":"
How can i do so ???
|
|
|
|
|
|
Can't get this program to excute.I will be very happy if I can get help with it.I am trying to evaluate the file layout to determine the location and size of the following fields so it would look something like this: 10/06/99,3022362451,1214523251,9:00,23:00,9:00
Date
Origination Number
Destination Number
Call Durtion
Time of Call
Cost of Call
Origination Place(City,State)
Destination Place(City,State)
#include<stdio.h>
void main (void)
{
char student_name [50];
char student_class [50];
char student_id;
char course_name [50];
char student_address[50];
double quiz_grade,quiz_grade1,quiz_grade2,quiz_grade3;
double exam_grade,exam_grade1,exam_grade2,exam_grade3;
double daily_grade,daily_grade1,daily_grade2,daily_grade3;
double
assignment_grade,assignment_grade1,assignment_grade2,assignment_grade3;
double total_points;
}
student_rec student_data [3];
for(i=0.i<3,i++)
{
printf("/n Enter student name");
gets (student_data.student_name);
typedef struct student_rec;
printf("\n Enter class name");
gets(students_data.class_name);
printf("\n Enter student address");
gets(students_data.student_address);
printf("\n Enter class name");
gets(students_data.student_id);
printf("\n Enter Daily grade:");
gets(students_data.Daily_grade1);
printf("\n Enter Daily grade 2:");
gets(students_data.Daily_grade2);
printf("\n Enter Daily Grade 3:");
gets(students_data.daily_grade3 ;
daily_grade= daily_grade1+daily_grade2+daily_grade3/3*.10
printf("\n Enter quiz grade:");
gets(students_data.quiz_grade1);
printf("\n Enter quiz grade 2:");
gets(students_data.quiz_grade2);
printf("\n Enter quiz Grade 3:");
gets(students_data.quiz_grade3 ;
quiz_grade=quiz_grade1+quiz_grade2+quiz_grade3/3*.10
printf("\n Enter Assignment grade:");
gets(students_data.Assignment_grade1);
printf("\n Enter Assignment grade 2:");
gets(students_data.Assignment_grade2);
printf("\n Enter Assignment Grade 3:");
gets(students_data.Assignment_grade3 ;
Assignment_grade=Assignment_grade1+Assignment_grade2+Assignment_grade3/3*.30
printf("\n Enter exam grade:");
gets(students_data.exam_grade1);
printf("\n Enter exam grade 2:");
gets(students_data.exam_grade2);
printf("\n Enter exam Grade 3:");
gets(students_data.exam_grade3 ;
exam_grade=exam_grade1+exam_grade2+exam_grade3/3*.50
total=Assignment_grade+daily_points+quiz_point+exam_points
gets(student_data.total);
}
Can anyone help me finish it.
awillie
|
|
|
|
|
void main is not valid C++, even if your compiler does not know it.
I dunno what gets is, but printf is a C function. I also cannot see what you have included. If you use C++ ( i.e. use iostreams instead ), then reading values from a comma delimited string is easy, just use getline and make the second parameter a ','.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
I think you have misplaced }
double total_points;
}
should be at the bottom
gets(student_data.total);
}
}
BTW, one debugging technique is to remove everything and slowly add code that works until you locate the bug. So try to get
void main ()
{
}
to compile and then proceed from there.
Todd Smith
|
|
|
|
|
One way is to create an ActiveX control which can be put on a dialog box
|
|
|
|
|
I mean that I dont want the graphic to be in CView anymore. I just want it to be in a dialog box. Please anybody
|
|
|
|
|
You can do it in the dialogs OnPaint event as shown below. Most of this was generated by the wizard when I started the project. I moved two lines to the top of the function, and added two lines to the "else" clause.
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CTry1Dlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rect;
if (IsIconic())
{
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
GetClientRect(&rect);
dc.DrawText("Hello World",11,rect,DT_CENTER );
}
}
|
|
|
|
|
Which is the preferred way to terminate the modal dialog? I notice that no matter which one I use, the lines of code following it do get executed, even though the dialog itself has vanished!
i.e.
<pre>MYClass::OnOK()
{
CDialog::OnOK();
CMyDlg myDlg;
myDlg.DoModal();
}
</pre>
The original dialog vanishes and the second one gets spawned. This hapens even with EndDialog(IDOK).
That seems peculiar to me. I'd have thought that if the dialog itself is terminated, the subsequent statements would never be reached....
Thnaks,
ns
|
|
|
|