|
humm. Well i dont know about ATL Service running in win98 coz i have not developed application for 98.
Background apps. You make simple SDI application and in the initinstance you call HideApplication() this will make ur SDI application invisible. I.e it will be running in the background. I guess this will work in win98 also if you are using UNICODE.
First of all this application should go in the startup option so that it is launched every time it is rebooted.
you can keep track when was the last time the operation was done then accordingly you can do the next scheduled operation.
and of cource this application should set a timer to check for the scheduler operation every now n then.
Last time I was sober, man I felt bad
Worst hangover that I ever had
It took six hamburgers and scotch all night
Nicotine for breakfast just to put me right.... Dire Straits
|
|
|
|
|
Background process is a "program that runs in the baground" lets say an unvisible one (hidden window to say it short)
About keeping record of the reboot, you can log the time when the application was started, and when it should update the files, and check on regular basis if the time is reached, or even has passes, and resync the files
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
when I use code in C++ or C# to excute SQLCommand, and it throw SQLExcetion.
Can I write another application to catch it. somebody can help me or tell me an idea.
thanks
Nho'c Ti`
|
|
|
|
|
Exceptions are errorenous program states from which it is still possible to close the program gracefully without losing data or crashing the system.
In C++, you can handle raised exceptions by using a try - catch block. You write the code you wish to execute in the try block, and then write either a conditional (specific exception) catch block or a generic one, if available.
Here is an example of handling an SQL-query exception:
try
{
CRecordset myRecordset(&db);
myRecordset.Open(...);
}
catch ( CDBException* e )
{
AfxMessageBox( e->m_strError, MB_OK );
e->Delete();
} For more hands-on information and how to write your own routines that raise exceptions, see MSDN Library for Exception handling topics (C++)[^].
Hope this helps,
Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi
I try to insert in ATL dialog my oneself ActiveX object (
ATL composite control) but wizard not found this one(in dialog box of wizard i not see it), althought when i insert it from Add to project -> Components & Control wizar i see one into list.Why???I can't use Add to project -> Components & Control wizard because of my ATL dialog allocated in ATL project without MFC support.
Thanks
|
|
|
|
|
I am trying to automate Outlook using Visual C++. Here is what I am trying to do:
void CTestOutlookDoc::OnFileTest()
{
Outlook::CApplication pApp;
COleException e;
if (!pApp.CreateDispatch(_T("Outlook.Application")))
{
CString str;
str.Format("CreateDispatch() failed w/error 0x%08lx", e.m_sc);
AfxMessageBox(str, MB_SETFOREGROUND);
return;
}
pApp.m_bAutoRelease = TRUE;
pApp.Quit();
return;
}
When the code is executed, an instance of Outlook is created. However, even I call Quit() in my code, OUTLOOK.EXE still remains in Windows Task Manager after the program is quit. What should I do in order to kill the OUTLOOK process when I call Quit() in my function?
In DavidCrow's reply, he said OUTLOOK just goes after the code is executed. However, I tried the same piece of code in several computers, but OUTLOOK still remains in my Windows Task Manager after the code is executed. To make it worse, the code cannot create another instance of OUTLOOK unless I manually take out OUTLOOK from Windows Task Manager. Also, if Word (or Excel) is being used instead of Outlook, the code is working and Word (or Excel) is closed after the code is finished.
Does anyone have any idea what to do? Or does anyone have a sample program that starts Outlook, send an email and then quit?
Regards,
CTBMei
|
|
|
|
|
Why dont u terminate the process
send a WM_CLOSE or WM_QUITMESSAGE message to outlook
or check TerminateProcess (not recomended but can do the job)
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
How to change X, Y axes of MSChart dynamically during run time?
vidya
|
|
|
|
|
I have a simple program used for a video overlay where I use a CStatic object to display the time.
I was looking at the memory usage for the program and discovered that it was increasing by 4k every 3-4 seconds I found that the following code was the culprit, to be more specific, the SetWindowText line. (The code is called every second)
<br />
CTime t1 = CTime::GetCurrentTime();<br />
std::string time_str = (LPCTSTR)t1.Format("%H:%M:%S %d/%m/%y");<br />
m_timeStatic.SetWindowText(time_str.c_str());
I swapped over to use a CString object instead but the same problem was encountered.
<br />
m_timeString = time_str.c_str();<br />
UpdateData(FALSE);<br />
Please Help me!!!! Can anyone explain this!!!
---
|
|
|
|
|
Hi All,
Suppose I have class ABC which has two constructor as follows:
class ABC
{
ABC(); //DEFAULT CONSTRUCTOR
ABC(int xx); //Overrided CONSTRUCTOR
}
Now I want to make a Array of objects of the above class but I donot want to call the default constructor rather I want to call the OVERRIDED CONSTRUCTOR such that for each element of the array i pass a different integer value.
If I do the following:
ABC * arrABC;
arrABC = new ABC[10]; //then default constructor is called 10 times --how
// can I call Overrided CONSTRUCTOR passing either different integer
//values for each elememnt or by passing the same VALUE for each element
//of the array.
Any help with this regards will be appreciated.
TIA.
Sincerely,
Amol
|
|
|
|
|
#include <iostream>
class AA
{
protected:
int _iNum;
public:
AA(int iVal) {
_iNum = iVal;
std::cout << "Exp\n";
}
int GetVal() const { return _iNum; }
};
void main()
{
const int iSize = 3;
AA a[iSize] = { 5, 6, 7 };
int i;
for(i = 0; i < iSize; i++)
{
std::cout << a[i].GetVal() << std::endl;
}
}
<b>Maxwell Chen</b>
|
|
|
|
|
Hi Maxwell,
Thanks a lot for the quick info. It really works but the array you made was at COMPILE time. I wanted to do it at RUNTIME. Something like,
AA *aa = NULL;
aa = new AA[iSize];
One workaround that I can think of is that by having a public member function to the class, say, PopulateInt(int xx) which will then be called as follows:-
for(int i=0;i
|
|
|
|
|
One way would be to implement a equality operation (operator=) inside the class, then after you've created the array of new objects, you use the returned pointer to explicitly call the constructor you desire.
For example, consider this:
AA* aa = NULL;<br />
aa = new AA[3];<br />
<br />
aa[0] = AA::AA(5);
This would create a new temporary AA object, initialize it with number 5, then copy it's contents to replace the array's first object. Finally, it destroys the temporary object. If you don't want to write an equality operator, you can always use memory-wise copying.
The last way is to write a new operator New[] for your class. This means that you must explicitly call malloc to reserve memory for your new object. Writing this operator is a tedious work and must be done very carefully to avoid memory leak problems. To use an array declaration, you could possibly implement a variable-length argument list for the operator New[] , then get arguments from this list to initialize your objects with...
That requires, however, HARD WORK. The easiest thing to do would just use a member function to initialize the objects.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks Antti. The operator overloading thing does work.
I don't know how it didnot striked me at the first place.
regards,
Amol
|
|
|
|
|
Hi there
I have declared several Object ID's in the string table, then want to use these with Update_Command in the class wizard.
However they dont appear in the Object ID drop down box when I open the class wizard.
Any ideas
Thanks
Stu
|
|
|
|
|
Hi All,
How do I disable the context menu and keyboard inputs such as Cntl+O, Cntl+N,
and in the Internet Explorer Browser.
I have gone following through the articles of web browser customization in CP
http://www.codeproject.com/atl/MouseGestures.asp and
http://www.codeproject.com/internet/CustomBrowser.asp
The second article primarly host the webcontrol in the dialog box
application. Can these functionality be extended to the actual IE browsers.
I am running out of time... please help me
Thanks in advance,
Abhi Lahare
|
|
|
|
|
Hi,
How can I run a vbscript file from a VC program?
EXamples would be fine.
THanks in advance
regards
Hari Krishnan
|
|
|
|
|
Have a look around here for articles on the Windows Script Host (WSH). It's not something that can be answered in a message post.
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"
|
|
|
|
|
Hey all.
I noticed the VS_VERSION_INFO resource that is inside my program that I am building.
I am building code that displays the current version in various places. I would like to be able to pull the values from this VS_VERSION_INFO resource, instead of having to declare a version-info variable in my class -- which just makes more places for me to update it.
I checked MSDN about this and all that I can come up with is GetFileVersionInfo() method. I do not want to have to use a method if I don't have to that acutally looks at its own .EXE to determine the current version.
I am wondering if there is another method or some other way to grab those values from the resource at compile time?
Thanks!
|
|
|
|
|
Hi,
Search google for a class 'CModuleVersion' which can be used as
TCHAR szPath[MAX_PATH];
GetModuleFileName(NULL,szPath,MAX_PATH);
CModuleVersion ver;
if(ver.GetFileVersionInfo( szPath , TRUE)){
CString s;
s.Format(IDS_STRING61504,HIWORD(ver.dwFileVersionMS), LOWORD(ver.dwFileVersionMS), HIWORD(ver.dwFileVersionLS));
SetDlgItemText(IDC_VERSION , s );//UnicodeConversion
}
Hari Krishnan
|
|
|
|
|
Does anyone know off hand why I cannot add an additional
control to my control heavy dialog using the Dialog editor in VC++?
If I remove an existing control, I can then
add. I'm hitting a limit somewhere perhaps?
(Its a busy dialog... )
Thanks for your help.
|
|
|
|
|
It took a while but here you go!
0x00050000 - 0x0005FFFF
from the MSDN article "TN028: Context-Sensitive Help Support".
That,s 65,535 possible IDs.
You should not be hitting a limit. Unless you are running out of memory or the resource editor has an unrealistic limit. I have placed large numbers of controls on dialog boxes before without any problems.
As an experiment, may be you could try creating and placing controls on a dialog programaticaly and see when it fails.
Good luck!
INTP
|
|
|
|
|
Sounds to me like your main problem is design skills.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
As harsh as the statement might sound, I would have to agree.
It really sounds like the time for a UI redesign.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Christian Graus wrote:
Sounds to me like your main problem is design skills.
Get a life. There are words for geeks like you, but I will spare
this fine forum. You have no idea what the requirements/design problems are. Nor do you know whether or not I'm the designer!
So you are completely out of line to suggest that I lack design skills.
The fact is, the software does need UI rework, but I've seen many a fine
application with more than 256 controls on a single dialog.
|
|
|
|