|
Fu Manchu wrote: I am trying to convert a API that's used in a MFC app, i want to convert this to .net
You confused me if you're going.NET or not.
If you do, you have all the time functions you'll need in .NET won't you ?
|
|
|
|
|
eh,
you have int,double and string as well but you still need to make the existing code work, compile and build before you can convert to .Net
just because .net as these function, isn't an answer you've missed the point!
The existing code creates an instance of Ctime which is a MFC function, if i dont use this or an equivalent method, how can leverage .net time functions in C++
|
|
|
|
|
1.create a transparent window.
2.grasp screen software can grasp the transparent window.
3.i want to hook the notepad and let the transparent window on top of notepad.
|
|
|
|
|
1. OK.
2. Good.
3. Luck.
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
|
|
|
|
|
Oh your answer is very compressed! (maybe its mp5 ).
|
|
|
|
|
Hamid. wrote: Oh your answer is very compressed! (maybe its mp5 ).
MP5 .. i am thinking MPEG 8
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ZhiLiangLin wrote: 1.create a transparent window.
See CreateWindow() API
ZhiLiangLin wrote: grasp screen software can grasp the transparent window.
ZhiLiangLin wrote: 3.i want to hook the notepad and let the transparent window on top of notepad.
What would be the use of having a transparent window on top of notepad. Why do you want to do this. Do you intend to capture the user entered text and display it in your window instead of notepad?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
1.CreateWindow()-can create window ,but i don't know how to implement the transparent effect.
2.i have implemented the transparent window,but the Grab software can't grab my transparent window.And,i don't want to use the API 'SetLayeredWindowAttributes' to implement the transparent effect.because the func is used for win2k and winxp.
3.i want to let the transparent window become watermark
|
|
|
|
|
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.
|
|
|
|