|
Ben Aldhouse wrote: I am beginning to think that I should overload the base classes 'OnInitDialog' function. I've just tried to creating this in the dialog...
This is the way to go.
Ben Aldhouse wrote: bool CEditNodeDlg::OnInitDialog()
Replace bool with BOOL .
BTW Why don't you make the Visual Studio make the work for you (select your dialog on class explorer, right click and choose Add Windows Message Handler item)?
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.
[my articles]
|
|
|
|
|
|
I've got it! Thanks for your help! Basically I needed to change 'bool' to 'BOOL'.
<br />
BOOL CEditNodeDlg::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
m_listGTTimeUnits.AddString("days");<br />
<br />
return TRUE;<br />
}<br />
|
|
|
|
|
Hi all, i found this example on MSDN. Im trying to find out how i can accomplish what im trying to do, and thats monitor the events of a application.
So here's the code...
<br />
#include <windows.h><br />
<br />
int main(){<br />
HOOKPROC hkprcSysMsg;<br />
static HINSTANCE hinstDLL;<br />
static HHOOK hhookSysMsg;<br />
<br />
hinstDLL = LoadLibrary((LPCTSTR) "c:\\windows\\notepad.dll");<br />
hkprcSysMsg = (HOOKPROC)GetProcAddress(hinstDLL, "SysMessageProc");<br />
hhookSysMsg = SetWindowsHookEx(WH_SYSMSGFILTER,hkprcSysMsg,hinstDLL,0);<br />
return 0;<br />
}<br />
</windows.h>
I've noticed that i dont have notepad.dll - It may not be new to some but it is to me seeing how i've never had to look for it. So what would i have to do to monitor notepads events? Also, what char would i dump the messages from to a fstream .txt file? Thanx in advance!
|
|
|
|
|
dellthinker wrote: I've noticed that i dont have notepad.dll
You have to build it (of course you don't need to call it notepad.dll): if you need a global hook (and you need a global one to hook another process like notepad) the you have to create a DLL hosting your hook procedure.
I strongly suggest you to read MSDN documentation about hooks [^].
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.
[my articles]
|
|
|
|
|
Hi CPallini,
I developing an application that hooks the Open/Save dialog for getting the selected file path. currently am able to hook the common dialog but it's not working on office Open/Save dialog. On Searching i found that Office is using separate Open/Save dialog. Can anyone help me to identify the Office Open/Save dialog messags equivalent that of common dialog's
CDN_INITDONE
CDN_FILEOK
CDM_GETFILEPATH
CDM_GETFOLDERIDLIST
CDM_GETFOLDERPATH
CDM_GETSPEC
CDM_HIDECONTROL
CDM_SETCONTROLTEXT
CDM_SETDEFEXT
.
I think you can help me to solve this out.
thanks
Nitheesh
|
|
|
|
|
Well I'm not an expert, but I read some time ago that Office rolls its own controls and maybe the controls themselveles don't even use messages as communication mechanism (but I maybe wrong).
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.
[my articles]
|
|
|
|
|
Hi CPallini,
thank you for you reply.
Nitheesh
|
|
|
|
|
dear friends
the following code is right? i would like to assign :
createArray(a);//initialize 10 3x4 arrays
fitFunc(fitness);//one arrays containing 10 values
double minValue = fitness[9];
for (int i =0;i<10;i++)
{
if (fitness[i] < minValue)
{
minValue = fitness[i];
gbest[i][3][4]=a[i][3][4];
cout << " "<< gbest[i][3][4]<<endl;
}
}
thanks a lot..urgent
Li Zhiyuan
5/10/2006
|
|
|
|
|
li zhiyuan wrote: the following code is right?
If it accomplishes your intended purposes, then yes.
I mean:
You're computing the minimum value of fitness array (and storing it into minValue ) and each time you find a currently mininmum value, say fitness[k] , you copy the corrensponding a[k][3][4] element into gbest[k][3][4] (all other
gbest elements remaining untouched) eventually displaying the copied element.
Is the above your target?
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.
[my articles]
modified on Saturday, January 26, 2008 5:42:07 AM
|
|
|
|
|
dear friends
i mean:
fitness[10] has 10 elements..when i get minimum of fitness[10], then i should know which position of fitness, for example:fitness[6] or fitness[8]..and so on....
and then i will assign corresponding a[i][3][4] to gbest[i][3][4]...because i finally use gbest[i][3][4]....if the fitness[6] is the minimum value of fitness[10]..then i assign a[6][3][4] to gbest[6][3][4]...
thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
li zhiyuan wrote: fitness[10] has 10 elements..when i get minimum of fitness[10], then i should know which position of fitness, for example:fitness[6] or fitness[8]..and so on....
Then you have to update also an index when you update the minimum, for instance
int minIndex;
minIndex = 9;
double minValue = fitness[minIndex];
for (int i =0;i<10;i++)
{
if (fitness[i] < minValue)
{
minIndex = i;
minValue = fitness[minIndex];
}
}
at the end, you know, for instance that minimum value (that correnspond to minValue ) is in fitness[minIndex] .
li zhiyuan wrote: and then i will assign corresponding a[i][3][4] to gbest[i][3][4]...because i finally use gbest[i][3][4]....if the fitness[6] is the minimum value of fitness[10]..then i assign a[6][3][4] to gbest[6][3][4]...
Sorry I don't understand the above.
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.
[my articles]
|
|
|
|
|
thanks brother
the problem is that: i can't assign a[i][3][4] to gbest[i][3][4]....
the code is following:
createArray(a);//create 10 3x4 arrays
fitFunc(fitness);//calculate fitness vale of one array containing 10 values
double minValue = fitness[9];
for (int i =0;i<10;i++)
{
if (fitness[i] < minValue)
{
minValue = fitness[i];
cout <<endl<<" " <<"Position of minimum fitness value :"<<" "<<"minimum value is :"endl;
cout<<" " << i<<" "<< minValue<<endl;
gbest[i][3][4]=a[i][3][4];
cout << " "<< gbest[i][3][4]<<endl;
}
}
so brother, the problem is in gbest[i][3][4] = a[i][3][4];...above this point, it is right...
Li Zhiyuan
5/10/2006
|
|
|
|
|
Why can't you? Do you get an error?
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.
[my articles]
|
|
|
|
|
compilation had no errer...but the result is wrong.
just i got one value from equation gbest[i][3][4]=a[i][3][4]...not 3x4 array..so what happened? i dun know? too urgent...i have a little things to finish..but cost too my whole day...thanks..brother
Li Zhiyuan
5/10/2006
|
|
|
|
|
if you need to copy the whole 3x4 array you can use one of the following approaches:
(1) use an iteration over all the array elements, i.e. change from
gbest[i][3][4]=a[i][3][4];
(BTW, the above code is wrong, you're accessing elements out of the array boundaries)
to
for (j=0; j<3; j++)
for (k=0; k<4; k++)
gbest[i][j][k]=a[i][j][k];
(2) do a crude copy of memory, i.e. change
gbest[i][3][4]=a[i][3][4];
to
memcpy(&gbest[i], &a[i], 3*4*sizeof(a[0][0][0]));
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.
[my articles]
|
|
|
|
|
thanks friend, i solved problem, by the way, how to plus elements of two multiarrays?
i mean it will plus corresponding position value of two multiarrays?thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
li zhiyuan wrote: how to plus elements of two multiarrays?
i mean it will plus corresponding position value of two multiarrays?thanks
Please elaborate, I don't understand.
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.
[my articles]
|
|
|
|
|
hi am using vc++ mfc and pocket pc6.0.
i has 2 file in a same name.
1.windows\paul
2.temp\paul
i was used a code shellexecuteex to open files.
but it defaultly open windows\paul file.
to change the folder, what is the procedure?
can anybody help me?
paulraj
|
|
|
|
|
You can use this way.
#include <fstream>
std::fstream fw("C:\\WINDOWS\\paul", std::ios::in);
std::fstream ft("C:\\temp\\paul", std::ios::in | std::ios::out | std::ios::app);
Maxwell Chen
|
|
|
|
|
gnanapaul wrote: to change the folder, what is the procedure?
SetWorkingDirectory() , but changing folders is not necessary just to open a file.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry, the two previous answers are not relevant.
Windows CE knows nothing about a current directory or a path environment variable.
Always provide a Unicode full path beginning at the root like L"\\windows\\paul\\filename.ext" .
cheers,
AR
|
|
|
|
|
Hi,
I want to login a website eg aaa.com
so I do this,
I use SendRequest send my username an password
pFile->AddRequestHeaders("Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*");
pFile->AddRequestHeaders("Referer: http://www.boofdollars.com/index.php?view=login&");
pFile->AddRequestHeaders("Accept-Language: zh-cn");
pFile->AddRequestHeaders("Content-Type: application/x-www-form-urlencoded");
pFile->AddRequestHeaders("Accept-Encoding: gzip, deflate");
pFile->AddRequestHeaders("User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon; .NET CLR 2.0.50727)");
pFile->AddRequestHeaders("Host: www.boofdollars.com");
pFile->AddRequestHeaders("Content-Length: 80");
pFile->AddRequestHeaders("Connection: Keep-Alive");
pFile->AddRequestHeaders("Cache-Control: no-cache");
pFile->AddRequestHeaders("Cookie: "+cookie_);
pFile->AddRequestHeaders("returnTo=&id=&ac=stats&step=&ptype=&form_user=goodhere&form_pwd=goodhere");
pFile->SendRequest(NULL,0,lpOptional,strlen(lpOptional));//80 bytes skipped. Reason: The content type is not captured.
Why?
I must creat a cookie?
Thank you
|
|
|
|
|
What is the problem you are having?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Hi,
Is there any API/”MFC’s class method” to check if a particular database provider (Oracle, SQL etc.) is installed or not?
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|