|
i did the following code for showing progress and status bar and while running the code the progress bar alone gets displayed first with the status pane empty,and the status bar gets displayed after that finally,i need the statusbar to display "scanning",along with progressbar,what should be done????
m_bar.Create(this);
m_bar.SetIndicators(indicators,2);
CRect rect;
GetClientRect(&rect);
m_bar.SetPaneInfo(0,progressbarn, SBPS_NORMAL,rect.Width()-100);
m_bar.SetPaneInfo(1,progressbarm,SBPS_STRETCH ,0);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,
progressbarn);
CString s;
s="scanning";
m_bar.SetPaneText(0,s);
pPrgCtrl->Create(WS_CHILD | WS_VISIBLE, CRect(10, 10, 288, 35), this,0x16);
pPrgCtrl->SetParent(&m_bar);
CRect crPaneRect;
m_bar.GetStatusBarCtrl().GetRect( 1, &crPaneRect );
crPaneRect.DeflateRect( 0, 2, 2, 2 );
pPrgCtrl->MoveWindow( crPaneRect );
while(condition==success)
{
while(pPrgCtrl->GetPos()<100)
{
pPrgCtrl->StepIt();
}
break;
}
Raja
|
|
|
|
|
Hi...
I am trying to create a log file which should contain..
///////////////////////////////////////
TSE0001
TSW0001
TSI0001
/////////////////////////////////////////
Then i will find the particular string "TSW".
It should increment as
TSW0002
but i am getting as TSW0004..plz help me...
my code is..
/////////////////////////////
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<<"TSW000";
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;
logfile<<"TSE000";
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<<"TSI000";
break;
}
///////////////////////////////////////////
THANK YOU
MANJU
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
What is cType? What is inFile? ...
1. You should provide the code, that is "relevant" to your problem. Nothing more, nothing less.
2. Please enclose your code within "code block". (Select your all your code and then click on the code block option in the formatting pane). This will make your code more readable.
OK - Have you debugged to see why is your program not producing desired results?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: 1. You should provide the code, that is "relevant" to your problem. Nothing more, nothing less.
2. Please enclose your code within "code block". (Select your all your code and then click on the code block option in the formatting pane). This will make your code more readable.
3. Read the posting guidelines
|
|
|
|
|
Hi....
/////////////////////////////////////////////////
void Openlogfile(ofstream &fTempfile)
{
CFile fFile;
CFileException e;
ofstream iflogFile;
if(fFile.Open(strLogFileName,NULL,&e))
{
fFile.Close();
if(fTempfile.is_open())
Closelogfile(fTempfile);
fTempfile.open(strLogFileName,ios::app);
}
else
{
fTempfile.open(strLogFileName,ios::out);
}
}
void PrepareLogStatement(ofstream &logfile,_TCHAR cType, _TCHAR *cMessage)
{
CCriticalSection mcs;
CSingleLock singleLock(&mcs);
singleLock.Lock();
if (singleLock.IsLocked())
{
if(!logfile.is_open())
ofstream fstreamFile;
Openlogfile(fstreamFile);
COleDateTime date;
date = COleDateTime::GetCurrentTime();
CString strDate;
CString strLine;
strDate.Format("%04d%02d%02d%02d:%02d:%02d",date.GetYear(),date.GetMonth(),date.GetDay(), date.GetHour(), date.GetMinute(),date.GetSecond());
int iCount = 0;
ifstream inFile;
inFile.open(strLogFileName);
if(!inFile.is_open())
{
_tprintf("Unable to Create Log File");
}
_TCHAR aLine[1000];
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<<strDate<<"\t<<"TSW000"<<iCount<<"\t"<<"ProcessNo"<<"\t"<<cMessage<<"\n";
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<<strDate<<"\t"<<"TSI000"<<iCount<<"\t"<<"ProcessNo"<<"\t"<<cMessage<<"\n";
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;
logfile<<strDate<<"\t"<<"TSE000"<<iCount<<"\t"<<"ProcessNo"<<"\t"<<cMessage<<"\n";
break;
}
}
inFile.close();
logfile.close();
singleLock.Unlock();
}
} ///////////////////////////////////////////////////
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Please learn to use the debugger. We may help you only if your question is in compliance with the guidelines. It isn't that we won't help you otherwise, but we just can't, without knowing what you want to do. Sorry about that.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hi.
ok thank you sir
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Change
manju#123 wrote: if(iWPos!= 0)
To
if(iWPos != -1)
BTW: your code need a bit refactoring.
BTW(2): your code actually counts occurrences of the string, if you really need to increment the number represented by the string the you should first convert the string into a number and then increment it.
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
|
|
|
|
|
hi..
I tried if(iWPos != -1)
///The ouptut is...
TSE000
TSW000
TSI000
TSW000
TSI000
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
I think you have to use the 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
|
|
|
|
|
hi..
ok thank you...i will try it....
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
hello!!
i am trying to run a ppp client for COM port through my VC code...but could not be successful...though i write
System(Control Panel);
it was successful. but the same command for PPP CLient doesn't work.
can anyone please help me in this regard. ?
|
|
|
|
|
#error Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
|
|
|
|
|
I ignore messages that have "urgent" keyword in them.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
So your compiler is like this:
try
{
....its urgent
}
catch(...)
{
MessageBox(_T(its not a standard question!));
}
finaly
{
MsgBox(I ignore messages that have "urgent" keyword in them. )
}
|
|
|
|
|
(read OMG) you too know it now...
but at times I do start to work on "Urgent" issues straight away if I have time.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Either define _AFXDLL in you project settings (in "preprocessor definitions") or change your runtime library to something else than multi-threaded dll.
Another thing, avoid saying "its urgent". Everybody here helps for free. Why would we help you before helping anybody else. Please next time read the posting guidelines before posting.
|
|
|
|
|
Hi all,
i'm sorry if my request was already discussed in this site but for now i don't find the information that i need.
I'm working on a existing SDI project inside MFC VC 6.0.
I need to make a window that open with variable dimensions and fields, depending on the information that i pass to it. In other terms i need to have a window that change in accordance of different user input (objects clicked with composition defined at runtime).
The possible fields to show in the window are texts (of a variable size and font) and image (.bmp).
My ultimate target is to create a window that have a structure that can be later "simply" printed.
My problem is the choice of the object(s) to use: i have start using the Dialog wizard of MFC but it seems limited. I don't know if it is the better way to make it... I don't know if it is better to make a child frame window. I think that probably there are additional components/class/library on the net that can do that, but i don't find it for now.
Thanks in advantage for all the suggestions.
|
|
|
|
|
|
Thanks for the quick answer but it was not useful. I'm pretty sure that on the net there are answers to my question, but the problem is to find the one that works well and exactly as i need.
Now, i have modify the MFC example DLGTEMP and i have understand how to set dinamically the dimension of a Dialog, and how, where and whom string-based controls (static text, buttons, edit box,etc) to put inside it, at run-time.
My first trick is that i don't know how to set different fonts inside my dialog.
My second problem is to find a simply method to load dinamically bitmap from a file (.bmp) and to show it inside my dialog in a position decided at run-time. I see some projects, inside the CP site, to load and manipulate image file but they seems too much complex for my need.
Does exist controls that i can use inside dialogs as a dynamic container for others controls?
Thanks for every non banal suggestions
|
|
|
|
|
I have a C++ dll built in VS 6, which uses STL. I am working on a C++/CLI wrapper over this old dll because I need to used it in .NET.
In short it does not work due to some Side-by-side assembly error. So I checked the dependencies using dependency walker. The old dll requires the msvcr60* dlls. But when I load the wrapper dll instead, the system will load the latest msvcr80* dlls, which is correct for the wrapper version. However the dependency walker cannot resolve some methods from the old dll.
“Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.”
Is it possible to load 2 different version of MS C Runtime simultaneously for the same dll?
|
|
|
|
|
i want to create transparent window,but no use 'WS_EX_LAYERED' and 'SetLayeredWindowAttributes' Func
thank you
|
|
|
|
|
|
|