|
Iain Clarke wrote: EvilProgram(tm).exe
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]
|
|
|
|
|
Well, it would be dishonest of them to call it ImAGoodProgramHonestIAm.exe.
That would shock my trust in humanity!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Capture WM_KEYDOWN msg in PreTranslateMessage use Virtual Key Code to determine the required combination.
Check this.
BOOL CDlg::PreTranslateMessage(MSG* pMsg)
{
switch(pMsg->message)
{
case WM_KEYDOWN:
{
if( (GetKeyState(VK_LWIN)||GetKeyState(VK_RWIN)) &&
(pMsg->wParam == 0x44)
)
{
}
}
}
}
|
|
|
|
|
Its not working.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
What exactly is failing?
It should work coz I too have used this technique in my code so many times.
|
|
|
|
|
PreTranslateMessage(MSG* pMsg) function calls when Wnd key pressed its not handel both keys together thats why its not working.
please tell me solution for this.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi all,
I have a project, need to use MFC VC++ program called other application. How can i get the return value from the application?
My CreateProcess code was shown below:
void CProcessDlg::OnBnClickedButton1()
{
STARTUPINFO si;
memset(&si, 0, sizeof(STARTUPINFO));
si.cb = sizeof( STARTUPINFO );
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
PROCESS_INFORMATION pi;
CreateProcess(NULL, "c://a//0.exe", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);
}
eg.
ABC.exe will return "2" after it finished, how can my MFC VC++ program read the number "2"?
thanks.
|
|
|
|
|
|
Can you more explain what do you need exactly?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
thanks a lot. i am able to read the return value by add-in the below script.
[CODE]
WaitForSingleObject(pi.hThread,INFINITE);
GetExitCodeProcess(pi.hProcess,&ExitCode);
[/CODE]
|
|
|
|
|
hi. i think this might help someone further in my problem i debug the code and it was nt able to make another view. it crashes here
CWnd* pView = (CWnd*)pContext->m_pNewViewClass->CreateObject();
i dnt why its nt able to make a new CFormView as the dialog it needed give is correct.
same files for new SDI application(doc view frame) i have tested in my new sample application.
they works fine
|
|
|
|
|
Do you know about a fantastic tool named debugger?
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]
|
|
|
|
|
|
|
Hi
I run this code and the result is different from expecting. This is the smoothing image convolution with Gauss mask, the result is 3 images overlapping each other in spite of smoothing image.
I do not know where I'm wrong. May be the size of image is not correct. The image is a binary image,resolution 190*243 and there are 5 byte header. You may want to try the image
http://edventure.ntu.edu.sg/bbcswebd...50016/leaf.raw [^]
Thank you very much.
<br />
#include <br />
#include <br />
#include <br />
using namespace std;<br />
int main (void) {<br />
FILE * in_file;FILE * out_file;<br />
<br />
int image[190][245];<br />
<br />
<br />
int read_size, write_size;<br />
int image_size=46175;<br />
<br />
in_file = fopen("leaf.raw", "rb");<br />
if(in_file == NULL) {<br />
fprintf(stderr,"Could not open file \n");<br />
exit(1);<br />
}<br />
<br />
read_size = fread(image, 1, image_size, in_file);<br />
if (read_size != image_size) {<br />
fprintf(stderr, "Reading error");<br />
exit(2);<br />
}<br />
<br />
out_file = fopen("newleaf.raw", "wb");<br />
if(out_file == NULL) {<br />
fprintf(stderr,"Could not open file \n");<br />
exit(3);<br />
}<br />
<br />
write_size = fwrite(image, 1, image_size, out_file);<br />
if (write_size != image_size) {<br />
fprintf(stderr, "Reading error");<br />
exit(4);<br />
}<br />
<br />
<br />
<br />
<br />
int mask [3][3];<br />
int IconvG [190][245];<br />
<br />
mask[0][0]=1;mask[0][1]=2;mask[0][2]=1;<br />
mask[1][0]=2;mask[1][1]=3;mask[1][2]=2;<br />
mask[2][0]=1;mask[2][1]=2;mask[2][2]=1;<br />
<br />
int m,n,u,v,sum,i,j;<br />
int kCols =3, kRows =3, rows = 190, cols = 245 ,mm,nn,ii,jj;<br />
int kCenterX = kCols / 2;<br />
int kCenterY = kRows / 2;<br />
<br />
for(i=0; i < rows; ++i)
{<br />
for(j=0; j < cols; ++j)
{<br />
sum = 0;
<br />
for(m=0; m < kRows; ++m)
{<br />
mm = kRows - 1 - m;
<br />
for(n=0; n < kCols; ++n)
{<br />
nn = kCols - 1 - n;
<br />
ii = i + (m - kCenterY);<br />
jj = j + (n - kCenterX);<br />
<br />
if( ii >= 0 && ii < rows && jj >= 0 && jj < cols )<br />
IconvG[i][j] += image[ii][jj] * mask[mm][nn];<br />
}<br />
}<br />
}<br />
}<br />
<br />
out_file = fopen("newleaf.raw", "wb");<br />
if(out_file == NULL) {<br />
fprintf(stderr,"Could not open file \n");<br />
exit(3);<br />
}<br />
<br />
write_size = fwrite(IconvG, 1, image_size, out_file);<br />
if (write_size != image_size) {<br />
fprintf(stderr, "Reading error");<br />
exit(4);<br />
}<br />
<br />
<br />
cout<<"done\n";<br />
fclose(in_file);<br />
fclose(out_file);<br />
return 0;<br />
}<br />
|
|
|
|
|
is there any event for system date change?
|
|
|
|
|
Do you need to SetSystemTime ?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
No. If system date changes i need to insert data into database
|
|
|
|
|
Check out WM_TIMECHANGE message.
«_Superman_»
|
|
|
|
|
WM_TIMECHANGE will it be posted for evry mili sec or sec???
Actually I am looking for date change but not time change
|
|
|
|
|
Imagine a cold and lonely computer somewhere.
It is a daaaaark and stormy night, about 11pm.
The evil operator comes along, and changes time back by 22 hours, to 1am.
This is not on the face of it, a date change. In reality, it is.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
WM_TIMECHANGE is posted when a user changes the data or time or time zone.
It is not posted for every clock tick.
«_Superman_»
|
|
|
|
|
use function "afx_msg void OnTimeChange( )"
|
|
|
|
|
Hi,
I am making a Unit Test Script using CPPUnit framwork. I am having some errors in my script and unable to know how to go through ..as i am doing this for first time.
Do you know any link for sample application so that i can first try that and then i try to do my actual code. I have tried the Money....Step by Step example but it is very simple . I have to test my component writen in ATL.
|
|
|
|
|
Is this[^] help?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|