|
Actually, I should have realized that myself reading your first response. But I guess I wasn't quite "there" yet.
I found out how the color table is supposed to look like by debugging bmiColors[] after having loaded said bitmap file using the code you posted.
Mac
|
|
|
|
|
Hi!
I have developed a MFC Dialog based application, that consists of buttons, combo-boxes, edit box and a button to browse for a file etc, Now i want a free tool, through which i can repeatedly automate/test my app without the involvement of human. so is there asny such free tool in which initially i will show the cursor flow on my app, then the tool will proceed to do the same for required number of times. i searched thru net, i got few like AutoHotkey and winspy ++, but they require some scripts to be written, is there any software (free) which can be used without writing scripts!!
Thanks!
|
|
|
|
|
See here for ideas.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hello Friends
I am using LoadImage to load bitmap but how can I load Tiff File?
Any Ideas?
Thanks & Regards
Yogesh
|
|
|
|
|
GDI+ won't do it for you. You could look for another library that does; I'm pretty sure GIMP does. Or you could create your own TIFF package. IIRC there might be some licensing issues.
|
|
|
|
|
Luc Pattyn wrote: GDI+ won't do it for you.
GDI+ has built-in encoders and decoders that support the following file types:
BMP
GIF
JPEG
PNG
TIFF
GDI+ reference: "Using Image Encoders and Decoders"[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I stand corrected; I don't see what the OP's problem is then.
|
|
|
|
|
Are you going to update CP Vanity? I can't leave without.
Plz plz...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
There probably will be a CP Vanity 2.0 pretty soon after we get a useful web service; there still is hope, it was discussed yesterday.
And why do people insist on discussing CP Vanity everywhere except where it should be discussed, in the article's forum?
|
|
|
|
|
I stand corrected.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
BTW: you did see the CP Vanity Lite article by Nish yesterday?
|
|
|
|
|
Nope, it is pretty good (Nish rocks): thank you for signaling.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Friday, November 19, 2010 3:10 PM
|
|
|
|
|
|
hello guys..I read somewhere that callback function works better than the WM_TIMER in vc6. So I tried following code but it does't work. whats wrong with it?
BOOL CTimers_CallbackFuncDlg::OnInitDialog()
{
..........
..........
SetTimer(ID_CLOCK_TIMER,1000,(CALLBACK)&Timer1);
..........
}
void CALLBACK CTimers_CallbackFuncDlg::Timer1()
{
CTime curTime = curTime.GetCurrentTime();
m_sTime.Format("%d:%d:%d",curTime.GetHour(),curTime.GetMinute(),curTime.GetSecond());
UpdateData(FALSE);
}
a syntax error is given saying error C2059: syntax error : '__stdcall'
|
|
|
|
|
overloaded Name wrote: SetTimer(ID_CLOCK_TIMER,1000,(CALLBACK)&Timer1);
This could simply be:
SetTimer(ID_CLOCK_TIMER, 1000, Timer1); You could also pass NULL as the last argument and handle the WM_TIMER messages.
overloaded Name wrote: void CALLBACK CTimers_CallbackFuncDlg::Timer1()
This either needs to be a static or a global function.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
What do you mean by "callback works better"?
You need to find out the exact reason why that statement was made and if it applies to you.
Anyway, I think the error is because the callback signature is not what is expected.
Here is an excerpt from MSDN -
The lpfnTimer callback function need not be named TimerProc, but it must be defined as follows:
void CALLBACK EXPORT TimerProc(
HWND hWnd, // handle of CWnd that called SetTimer
UINT nMsg, // WM_TIMER
UINT nIDEvent // timer identification
DWORD dwTime // system time
);
|
|
|
|
|
This is the term that im quoting from a text book. The auther used exactly this term for the procedure.
|
|
|
|
|
That is not good enough.
If the author has not explained why it is so, you could probably send him/her an email asking for clarification.
|
|
|
|
|
overloaded Name wrote: I read somewhere that callback function works better than the WM_TIMER in vc6
That's vague and without foundations, I think can't be the rationale for your choice. Probably the WM_TIMER message would fit your needs as well.
overloaded Name wrote: void CALLBACK CTimers_CallbackFuncDlg::Timer1()
As David already suggested that cannot be a standard (a instance) method of the class, it must be either a static method or, simply, a function.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Since I already told here..I read it somewhere. According to the author;
Timers are placed into the application queue (only if application is idle). If the application is not idle and has been busy (due to which several timer event messages can be missed by the app), windows places only one timer event in the application queue. Hence Windows does not sends all the timer events to the application when it was busy (and no matter how many timer messages have been missed, it still places only one timer event in the queue).
This was the reason (which from the feedback so far, I think is wrong) I was trying to write a function.
|
|
|
|
|
As far as I know, the callback isn't called in the context of another thread, hence, if your main thread is busy, then it wouldn't be called either.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The callback is called on the thread that set the timer. It's called from it's message pump (if it hasn't got one the mechanism doesn't work).
Steve
|
|
|
|
|
WM_TIMER messages are not accumulated.
If you think about it you really don't need this.
If you miss a time interval, you just wait for the next.
|
|
|
|
|
overloaded Name wrote: SetTimer(ID_CLOCK_TIMER,1000,(CALLBACK)&Timer1);
Firstly, drop the (CALLBACK) cast, it won't help. In fact such "optimistic casting" (ignoring what something is and just pretending it's what it should be) often just makes things worse by turning compile-time errors into runtime errors. Only use casts when you know exactly what you're doing.
In your case the problem is that the callback can't be a non-static member function.
overloaded Name wrote: I read somewhere that callback function works better than the WM_TIMER in vc6
I can't see why. In your case the exact opposite is true as not using a callback means MFC does all the non-member-function to member-function thunking for you.
Steve
|
|
|
|