|
I have tried this. But still, its not working. Where exactly should i implement this UpdateAllviews(NULL);
Sorry for the inconvenience.
thanx
mughi
|
|
|
|
|
Mughi wrote:
Where exactly should i implement this UpdateAllviews(NULL);
After finishing the process.
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
Thats true. But my code flow is like this.
All i have created is an MDI application of the following.
class CComputeApp : public CWinApp
class CComputeView : public CEditView
class CComputeDoc : public CDocument
1. I haven't coded anything on File open / save / close.
2. Everything is taken care automatically.
3. Imagine a file named compute.txt is opened in my application.
4. And after that, I run a process (thats a different class) from CComputeApp.
5. And the process returns a string (contains the filename).
6. Using the string, i call CDocument* CComputeApp::OpenDocumentFile(LPCTSTR lpszFileName) to open the file.
7. The problem is, if the file is already opened, this OpenDocumentFile method doesn't call CComputeDoc::OnOpenDocument(LPCTSTR lpszPathName).
8. And so, the view is not updated.
This is where my problem is. And thats why, i was curious about the place of code.
Sorry for all the frustrations. And hope that, i would overcome this problem.
Again, I thank in advance.
thanx
mughi
|
|
|
|
|
I hope i don`t get you wrong. I think I get the same problem with you before. I haven`t got the solution yet. I tried using CDocument::OnCloseDocument (if i`m not mistaken) and it close the application. I think we should code to call the File Close.
<italic>Work hard and a bit of luck is the key to success.
|
|
|
|
|
call Document's UpdateAllViews()
There is no spoon.
mail
|
|
|
|
|
Hi
U can call updateAllViews() which calls the update function which we have added.
I do hope this may help you.
Sujan
|
|
|
|
|
Thats true. But my code flow is like this.
All i have created is an MDI application of the following.
class CComputeApp : public CWinApp
class CComputeView : public CEditView
class CComputeDoc : public CDocument
1. I haven't coded anything on File open / save / close.
2. Everything is taken care automatically.
3. Imagine a file named compute.txt is opened in my application.
4. And after that, I run a process (thats a different class) from CComputeApp.
5. And the process returns a string (contains the filename).
6. Using the string, i call CDocument* CComputeApp::OpenDocumentFile(LPCTSTR lpszFileName) to open the file.
7. The problem is, if the file is already opened, this OpenDocumentFile method doesn't call CComputeDoc::OnOpenDocument(LPCTSTR lpszPathName).
8. And so, the view is not updated.
This is where my problem is. And thats why, i was curious about the place of code.
Sorry for all the frustrations. And hope that, i would overcome this problem.
Again, I thank in advance.
thanx
mughi
|
|
|
|
|
hi all,
I am doing MFC Project..There is a Dialog to LOG ON to the Program.If any one enter user name & password & click "SIGN IN" Button ,I want to display a Dialog Box with "WAIT" Text until the usename validate.
So How do I add wait dialog using Threads or some thing else?
please help me
thanks..
|
|
|
|
|
Hi
You @ VC++ components there is a component called "Splash screen". You can use this / U will get some idea on looking @ that class.
Hope this helps you
SUjan
|
|
|
|
|
hi,
thank u very much.But do u know that how do we do it using Threads?
|
|
|
|
|
Hi
Create a worker thead call the showing code and once the process is over kill the thread. Again sometimes kill the thread may be a problem. I think.
Sujan
|
|
|
|
|
Create a CDialog with text "waiting". DoModal() this dialog.
When the validation is over ::SendMessage(gh_WaitDlg,WM_CLOSE,NULL,NULL);
to close the waiting dialog.
For this your validation should be from a different thread and that thread should have a handle to the waiting dialog.
There is no spoon.
mail
|
|
|
|
|
Using POSIX pthreads, implement the finite buffer consumer/producer code on chapter 5 slide 51. The buffer size is 10, and stores integers. The producer producers the values from 1 to 100 and puts them in the buffer. The consumer removes them and prints them as they are removed.
The program should compile and run on Unix.
aravind
|
|
|
|
|
I can send you the source code for the program for chapter 5, slide 50. Will that do? My program was rated very highly by Consumer Reports, but I don't know about the producer part.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
nivsah wrote:
chapter 5 slide 51
You don't seriously expect us to do your homework for you, do you?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I have a help file that I wrote and saved as a .pdf file. I want to be able to click a help button and have the file pop-up in Acrobat reader. I have coded a system command as follows:
system("start help.pdf");
and this works but it is slow and always pops up a DOS command window. Is there a better way to do this?
|
|
|
|
|
use the windows shell: ShellFileExecute
|
|
|
|
|
Can use ShellExecuteEx / ShellExecute. Have a look @ MSDN
|
|
|
|
|
Thanks, this works great!
|
|
|
|
|
Hi all,
I am relatively new to api programming.I am trying to automate a process and am using EnumWindows to get all window handles. I am then using GetWindowText and strcmp to check which of the window handles corresponds to the relevent window. However it doesnt seem to work i.e., it doesnt simulate the push of the button....
I have pasted the code snippet below.. Any suggestions on how to resolve this will be terrific.
In the main program i have
EnumWindows((WNDENUMPROC) WinCallback, 0);
My function is:
BOOL CALLBACK WinCallback(HWND win, LPARAM nadda)
{
char temp[512];
GetWindowText(win, temp, 512);
printf("%s",temp);
if(!strcmp(temp,"RBNal_Optocomm"))
{
HWND hcomm = FindWindowEx((HWND) win,NULL,"BUTTON","COM 1");
LRESULT lResult2;
lResult2 = SendMessage((HWND) hcomm,(UINT) BM_CLICK,0,0);
return FALSE;
}
}
Please let me know of any suggestions.
D
|
|
|
|
|
BM_CLICK message will fail if the window that will recieve the is not active. Try the code below.
if(!strcmp(temp,"RBNal_Optocomm"))
{
HWND hcomm = ::FindWindowEx((HWND) win,NULL,"BUTTON","COM 1");
if (hcomm)
{
::SetActiveWindow(hcomm);
LRESULT lResult2;
lResult2 = ::SendMessage((HWND) hcomm,(UINT) BM_CLICK,0,0);
return FALSE;
}
}
|
|
|
|
|
Thanks.. It still isnt working though.. I have passed an LPARAM value of 0 into the function.. Would this matter??
D
|
|
|
|
|
Hi,
try calling SetActiveWindow(win) before the line SetActiveWindow(hcoom). It should look like this
if (hcomm)
{
::SetActiveWindow(win);
::SetActiveWindow(hcomm);
LRESULT lResult2;
lResult2 = ::SendMessage((HWND) hcomm,(UINT) BM_CLICK,0,0);
return FALSE;
}
I had tested this and i had sent a sample applications (sender and receiver) in your email.
|
|
|
|
|
Hi
Thanks.. it worked....
Deepak
|
|
|
|
|
Hi all,
here is some interesting problem.... the problem setup goes like this...
a plane paper is placed on a table and a sphere is placed over it at some height and on that sphere at certain height a light was placed.
Noow as we all know it produces a shadow on the paper which will be some what elliptical if the light is not on the center line of the sphere. In this condition if we assume the paper as a 2D image then how can we calculate the pixels tht are covered under the elliptical shadow ( or to put it in other way while scannin form top how can we decide whether a pixel falls under the shadow).
any ideas ot thoughts are appreciated.
thanks in advance,
Suman
|
|
|
|