|
Hi,
What is mean by the following statement
<br />
MYPROC pProc=(MYPROC)GetProcAddress(hIns,"DLLPRoc");<br />
pProc=&Proc;<br />
u got the address of DLLProc in pProc then you are replacing it with address of local function
<br />
int Proc(char *pMsg,int nVal)<br />
{<br />
ret<br />
}<br />
<br />
thanks
Nitheesh
|
|
|
|
|
Its defensive approach, if he didn't get DLLPRoc (it's sure), use the local function.
|
|
|
|
|
you have pass the pProc to another function which calls this CALLBACK
|
|
|
|
|
|
Hi all..
I am TRYING TO write to a log file if any ERROR or information or warning messages in theformat
TSI0001 "iNFORMATION Message".
TSW0001 "WARNING Message".
TSE0001 "WARNING Message"...
so each time if any information or error message comes i should find the last inforamtion or erroe message and increment that no
example
TSI0001 "iNFORMATION Message".
TSW0001 "WARNING Message".
TSE0001 "WARNING Message"...
TSI0002 "iNFORMATION Message".
TSW0002 "WARNING Message".
TSE0002 "WARNING Message"...
please help me....
I am trying this code.
///////////////////////////////////////
switch(cType)
{
case 'W':
{
int iTSWCount = 0;
while(!inFile.eof())
{
inFile.getline(aLine,1000);
int iWPos = strLine.Find("TSW",0); if(iWPos!= 0)
{
iTSWCount++;
}
}
iCount = iTSWCount;
logfile<<"TSWOO"<<Warning;
break;
}
case 'I':
{
int iTSICount = 0;
while(!inFile.eof())
{
inFile.getline(aLine,1000);
int iWPos = strLine.Find("TSI",0);
if(iWPos != 0)
{
iTSICount++;
}
}
iCount = iTSICount;
logfile<<"TSWOO"<<Warning;
break;
}
case 'E':
{
int iTSECount = 0;
while(!inFile.eof())
{
inFile.getline(aLine,1000);
int iWPos = strLine.Find("TSE",0);
if(iWPos!= 0)
{
iTSECount++;
}
iCount = iTSECount;
}
iCount = iTSECount;
logfile<<"TSWOO"<<Warning;
break;
}
//////////////////////////////////////////////////////////////////////
thank you in advance
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Then what is the problem. And your code going to slow down the application as the log getting large size.
|
|
|
|
|
Hi sir..
Its not increment how i need
its increment in this way
TSI0001
TSW0002
TSE0003
TSI0004
BUT I WANT IF ERROR MSG FOUND INCREMENT THAT
TSI0001
TSW0001
TSE0001
TSI0002
TSW0002
TSE0002
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Hi,
And my suggestion is that place the Count of each message type at begining of the file
like
TSW0003TSE0003
TSI0001 "iNFORMATION Message".
TSW0001 "WARNING Message".
TSE0001 "WARNING Message"...
TSI0002 "iNFORMATION Message".
TSW0002 "WARNING Message".
TSE0002 "WARNING Message"...
at the first line of the txt file. Then read this first before. Split or parse it . then increment your Count based on that.
that' s it
Nitheesh
|
|
|
|
|
hi..
what changes i have to meke in my code..
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Apart the api "IsWndow" which the microsoft doesnt recommend to be used other than by the thread which had created the window,is there any method to check for a valid hwnd i.e from an another thread?
dont want,dont want thinking,climbing on head and jumping grass!
(venda venda ennu vicharikumbol thellayill keyaree chadunnoda pulle!)
|
|
|
|
|
From MSDN:
A thread should not use IsWindow for a window that it did not create because the window could be destroyed after this function was called. Further, because window handles are recycled the handle could even point to a different window.
Are you sure this is a concern? If you're going to do anything with the HWND the same applies (it could be destroyed). Just use IsWindow .
Steve
|
|
|
|
|
If the target window is a top level window you can install a hook (see WH_SHELL) to be notified about destroying top level windows.
But frankly, no matter what technique you use, you can be never sure. If everything looks ok and you send a message to that window, the window still can be destroyed in the same moment(almost the same). Or while is processing your message. Simply there is no way to prevent a foreign window from beeing destroyed anytime.
The only thing you can do is to implement thoroughful error processing, verify the effects of each of the messages sent and check regularly if the handle is still for the same window and not reused for another one.
Working with a foreign windows is something similar to working with dialog boxes. You can never be sure what stupidity will a user type in an edit box so you have to check everything.
I think a window beeing destroyed exactly in the very moment when you need it, is a very rare occurence. Just make sure to limit to minimum the damages of such an event. If your software stops abruptly and hours of the user's unsaved work are gone, that's unacceptable. If the only thing that happens is an error message "Internal error, please repeat the last command", that's acceptable, even if it's not desirable. Even the best software fails sometimes. The only question is how it fails: disastruously or gracefully ?
|
|
|
|
|
hi...
I have an application which send data to some "InputData.txt".
Now if i click " FILE->Save " then it needs to be ask for saving that "InputData.txt" in browsed Location!!
can u help in this regard..
Thanks in advanvce!!!!!
|
|
|
|
|
So, was your previous query solved? Why don't you take a little time to thank the ones who solved it before asking the next question?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I adjust for troll's vote for now as I think CPallini will take some more hours.
|
|
|
|
|
I think he is sleep now.
|
|
|
|
|
Thanks for the vote man. I appreciate it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I see that as the advance adjustment for the foreseen troll's vote.
|
|
|
|
|
Hi,
Handle the Save click and in Save Click handler do the Following
CFileDialog dlg;
if(dlg.DoModal() == IDOK)
{
CString fileName = dlg.GetPathName();
}
thanks
Nitheesh
|
|
|
|
|
If you properly used SDI framework in MFC, it will do for you.
|
|
|
|
|
In my application i have some buttons.... if i click them then some data will be stored in a buffer.i need that data to be stored in a File.
How can i do that.....
and
If i click File->Save ,then which handler will be called and how can i override that function to save my data in Text File!!!!!
THANKS in advance....
|
|
|
|
|
Are you using MFC SDI? [Implicit Creation of a CArchive Object via the Framework^] It will call the <cdocument derived="" class="">::Serialize() you may refer msdn for MFC Serialization.
Otherwise, you need to use APIs for showing up Browse for file dialog and use file APIs to write data.
|
|
|
|
|
From CMainFrame to CMainFrame (same source and destination) send a WM_COMMAND message:
SendMessage( WM_COMMAND, ID_FILE_SAVE_AS, 0);
modified on Sunday, May 11, 2008 6:54 AM
|
|
|
|
|
Hi ,,,,
How to disable Menu item in SDI application.
|
|
|
|
|
Add an ON_UPDATE_COMMAND_UI handler and corresponding handler to enable or disable menu items.
Something like...
ON_UPDATE_COMMAND_UI( ID_EDIT_CLEAR, ClearAll ), so ClearAll function should have the following signature...
afx_msg void ClearAll(CCmdUI *pCmdUI);
Call pCmdUI->Enable( FALSE ); to disable menuitem.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|