|
Using the Intel Jpeg Library (IJL), you can convert to jpeg directly in-memory, allowing you to convert from DIB to jpeg and write the jpeg out to whatever medium you wish (file, socket, pipe, etc.).
onwards and upwards...
|
|
|
|
|
Thank you
a little problem,it seems that IJL only deals with the 24bit Jpeg files
|
|
|
|
|
Yes, that is correct. You will need to convert to a 24 bit jpeg. There is a really nice class called CDibImage (on CP, I think or available at http://www.naughter.com/[^]) by P.J. Naughter that makes these types of things really easy.
onwards and upwards...
|
|
|
|
|
|
i have a web application which has to go to WEB to update some files peridically
How should i go about it ?
should i use task schduler ?
what if the user stop using task scheduler ?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
How about ur own background application that will do the stuff after certain time. ??? you can make an MFC app a background application or go for ATL Service.
Hope i helped you in same way.
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
|
|
|
|
|
will ATL service work on 9x ?
background process not sure what you mean ?
suppose updation time is 8 hrs
what will the backgound process do if the user reboots 5 times in 8 hrs how to keep tab of that ?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
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"
|
|
|
|