|
I would think if there are no exceptions or errors when the program disappears, it must have terminated properly. Or, if it is a console app, you might need to run it from the console to see the errors when the program terminates. I suggest you have the program produce a very detailed log of its activities in a file somewhere. This data should get you started.
Lorenz Prem
Microsoft Corporation
|
|
|
|
|
yup, data data data ...
i think its time for me to just suck it up and put in some RT logs
thanks.
todo....
:: insert inpirational text here ::
|
|
|
|
|
ahhh!! you got me thinking, and I got less lazy, and did some looking into the way the admins were running the program (which i should care, but usually to busy to care about)
they run a mover script (batch file) to move the neccesary files from one folder, to 2 seperate locations.
Then they run 2 copies of my app , on the 2 seperate folders.
So in those off instances that a copy of my program was trying to access the same files that were still being manipulated by the mover program, i was getting NULL returns on my file open. which , i was doing a natural exit in that case.
I modified the program to not exit if it recieves NULL, and to just be patient and retry to go about its business w/ the next file and no more disappearing app!
thanks for the time / brain power, everyone
we have solved 'the case of the disappearing app'..
todo....
:: insert inpirational text here ::
|
|
|
|
|
In case you cannot (don't have time to) fix the problem, you can use XYNTService[^] to run your program, which will check your program automatically and restart it if neccesary (You need to set CheckProcess to 5 and set Restart to Yes in the XYNTService.ini file to have it check your program every 5 minutes).
Good luck.
[Edit] If you haven't had any idea what a service is about, may be you don't want to waste time on my suggestion. Not all programs are sutible to run from a service. [/Edit]
My articles and software tools
|
|
|
|
|
I need to graphically represent dynamically changing physical grid (300x300) on maximal logical display coordinates, which is usually much larger (~600x600 and more). To avoid blinking, I, first, create Bitmap (according to the grid size) in the memory and thus, using BitBlt, extend it graphically to maximal display size. My problem is that such extension makes Bitmap quality unacceptable. However, using physical grid with the same size (or more) as the display projected, doesn’t reduce the quality.
Enclosed below please find the code.
void CRecDrawView::OnDraw(CDC* pDC)
{
CRect rect ;
int X, X1, Y, Y1, MatrixPart, DrawPart;
COLORREF color = RGB( 128, 128, 0 );
GetClientRect(rect );
int oldBkMode = pDC->SetBkMode(TRANSPARENT);
DrawPart = (rect.Width( ) < rect.Height( ) )
? rect.Width( ) : rect.Height( ) ;
if(DrawPart > MaxCoordinate) DrawPart = MaxCoordinate;
MatrixPart = MaxCoordinate/DrawPart ; // part of matrix, which must be displayed
X = 0 ;
X1 = X + DrawPart;
Y = 0 ;
Y1 = Y + DrawPart;
CDC memdc, * myDC;
pDC->SetMapMode(MM_ISOTROPIC);
SetWindowExtEx(*pDC,DrawPart,DrawPart,NULL);
SetViewportExtEx(*pDC,rect.right, -rect.bottom,NULL);
SetViewportOrgEx(*pDC,0,rect.bottom,NULL);
CBitmap bmp, *poldbmp;
memdc.CreateCompatibleDC( pDC);
bmp.CreateCompatibleBitmap (pDC, DrawPart, DrawPart);
poldbmp = memdc.SelectObject( &bmp );
memdc.BitBlt( 0,0,DrawPart, DrawPart,&memdc, 0, 0, WHITENESS );
myDC = &memdc;
...
}
I’ll be much appreciated for any kind of help.
German
|
|
|
|
|
I need to be able to create some number of checkboxes, this number depends on the number of items that the user previously selected. What I have done is created a loop for the number of selected items, and in the loop I:
for(x = 0; x < numberSelected; x++)
{
CButton button;
CRect rect;
CString buttonText;
GetClientRect(rect);
ClientToScreen(rect);
buttonText.Format("%d", x);
button.Create(buttonText, WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX, rect , this, x);
}
UpdateData(false);
Now, I know that *if* this were to work, they would all show up in the same spot because the rect structure never changes, but I just wanted to make sure it would work in a loop like this before I went too far into it. But, this doesn't work anyway, can anyone help me out?
Thanks.
|
|
|
|
|
one more thing, that for loop is inside my OnInitDialog function.
|
|
|
|
|
One thing that might cause problems is that you are defining a single CButton object - and then trying to call it's Create() member over and over again.
You might want to create an array of buttons as a member variable for that dialog box (if you know the maximum number you might possibly have - say 117 if you were doing chemical elements) and then make visible the ones you need visible and use MoveWindow() to position them.
|
|
|
|
|
Once the for loop goes out of scope, the CButton object ceases to exist. Try this:
CButton *pButton;
for (...)
{
pButton = new CButton;
pButton->Create(...);
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
hi all,
i want to do some action when user selects some text in my text box which is an AutoRichEditCtrl. i dont want any button clicks after selection to perform that action. Instead on selecting the text,automatically the corresponding action has to take place.how do i do that???
can anyone please help me.......
Thanks!
ramya.
|
|
|
|
|
I would think you'd want to respond to the WM_LBUTTONUP message.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
If a AutoRichEditCtrl is derived from CRichEditCtrl , you can handle the EN_SELCHANGE notification:
MSDN says:An application can detect when the current selection changes by processing the EN_SELCHANGE notification message. The notification message specifies a SELCHANGE structure containing information about the new selection.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I doubt this would work as the text is not being changed. It is being selected.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Maybe you are confusing EN_CHANGE and EN_SELCHANGE?
MSDN is very clear about EN_SELCHANGE:
The EN_SELCHANGE message notifies a rich edit control's parent window that the current selection has changed. A rich edit control sends this notification message in the form of a WM_NOTIFY message.
I think he could very well use this notification.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Fair enough. Indeed I confused the two. Good catch.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
hi,
Thanks a lot!! This works the way i want to.
ramya.
|
|
|
|
|
Does anyone know if there's a plug-in of sorts that will do smart disk mirroring....
In the process of doing client/server programming, I do a lot of multi-machine debuggin... I am looking for a good way to replicate files across a few machines....
The worst part of this process, is moving files between machines.
or is there another suggestion for doing this kinda stuff?
Can you setup the IDE (C++) debugger to allow everything on a shared drive? My experience is that this doesn't really work...
Help?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Hi,
I wants to create RitchEdit control in my form view dynamically and wants to set font and alignment according to user choice. Here I have a problem. CFontDialog return CHOOSEFONT structure while font setting is done in RitchEdit control using CHARFORMAT structure. Is there any translation mechanism between two structures or I have to do it manually. If there is any better mechanism, Please let me know.
Thanks
I am looking to design a application which will help to design a form run time. Any suggestion are welcomed. Is there is open source code on any side?
|
|
|
|
|
hi,
there is something called AutoRichEditCtrl a derivative of RichEditCtrl. with this u can easily set font. for this u need to include a .cpp and a .h file.
the source code and demo is available in this site itself.
try to get it. it might b useful for u.
ramya.
|
|
|
|
|
Thanks Ramya, I searched on MSDN and could not find any AutoRichEditCtrl refrence. Can U help me to locate this.
I am looking to design a application which will help to design a form run time. Any suggestion are welcomed. Is there is open source code on any side?
|
|
|
|
|
Thanks Ramya, I searched on MSDN and could not find any AutoRichEditCtrl refrence. Can U help me to locate this.
AutoRichEditCtrl
|
|
|
|
|
plz check out this link
http://www.codeproject.com/richedit/autoricheditctrl.asp
this has a demo and also gives instructions on how to use this control.
ramya.
|
|
|
|
|
How to load C# form in MFC project?
|
|
|
|
|
hello ppl
well need some start on socket programming i wrote the following code in Visual C++ 6.0
CSocket mysocket;
mysocket.Create();
now the problem is here the Create function returns FALSE i tried to find the last error by using the function getLastError and the error no is 109 and i cant get a description of what it means i have used the second version of Create function as well
i tried a loop on all the 65535 ports
mysocket.Create(i,SOCK_STREAM,"172.16.64.97")
but that didnt work either
please help me out i have even tried the CAsyncSocket class but that also fails to create a socket please help me out
|
|
|
|
|
Go through MFC Sample CHATSRVR code.
The chosen One
|
|
|
|