|
Hi,
I'm getting following errors while creating 3 classes as mentioned below ...
//---------------------------
class CConfig
{
//declarations
};
//---------------------------
#include "Config.h"
class CDlg
{
CConfig m_config; //no errors
};
//---------------------------
#include "Config.h"
class CDump
{
void MyFun(CConfig config); //errors
};
//---------------------------
in class CDump i'm getting some errors as ...
error C2146: syntax error : missing ';' before identifier 'config'
error C2501: 'CConfig' : missing storage-class or type specifiers
error C2501: 'config' : missing storage-class or type specifiers
as far as class CDlg is concerned i'm able to declare and use the object of CConfig but why doesn't it work in the other case?
Thanks,
Kranti
-- modified at 23:59 Monday 6th March, 2006
|
|
|
|
|
Kranti1251984 wrote: #include "CConfig.h"
Is it #include "CConfig.h" or #include "Config.h"
Nibu thomas
Software Developer
|
|
|
|
|
I'm sorry, it is
#include "Config.h"
|
|
|
|
|
Kranti1251984 wrote: I'm sorry, it is
#include "Config.h"
Now it should work!
Nibu thomas
Software Developer
|
|
|
|
|
No, that's the problem. Even though, correct header file is included, it works fine with CDlg but not with CDump.
What should I do?
|
|
|
|
|
I don't think that the line you are showing is having the problem in CDump because the errors are talking about some other variable called m_config but here(in CDump ) you have declared a variable called config .
Nibu thomas
Software Developer
|
|
|
|
|
The same line with prototype of the function, is creating problems for the variable config of type CConfig.
-- modified at 0:02 Tuesday 7th March, 2006
|
|
|
|
|
I have this problem when I have 2 or more file Included eachothere (file 1 include file 2 & file 2 include file 1)
Iman Ghasrfakhri
|
|
|
|
|
I had tried this. But logically, it should not work and it doesn't work.
But the problem i've mentioned is not the same one.
|
|
|
|
|
Hello,
I am using the bit of code below in a function to send instructions thru the serial port to some equipment and also to read off some feedback from
the equipment:
WriteFile(hCOM1, txbuff, 8, &bytesRead, NULL);
ReadFile(hCOM1, rxbuff, 8, &bytesRead, NULL);
Power= (((int)rxbuff[6])%4)*256 + (int)rxbuff[5];
When i am testing this function alone, it seem to work perfectly and obtain nice readings. However, when i integrate it with the rest of the program i find that the function gives wierd readings.I later found that this was due to the ReadFile portion reading the recieved portion at an offset, meaning there was some meaningless data before my actual portion of the feedback.
eg
I expect 255 255 43 .....
instead i get 05 04 255 255 43...
I managed to solve this problem by making use of the PURGE command.
However, i would like to know, why does the offset of data occurr ?
Is there any better way to solve this problem instead of PURGE ?
Thanks
|
|
|
|
|
The serial port has an input buffer of usually around 16 characters. Anything that is received by the serial port but not read by an application will be just sitting there waiting to be read. A good practice is to clear the input buffer (just read until you can't read any more) when you open the serial port, and then make sure you keep up with all the reads after that.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
*
***
******
********
I have some problems to make this triangle for my hobby.
John,K
|
|
|
|
|
<font color=blue>const int</font> nMaxLines = 4;
<font color=blue>for</font>(<font color=blue>int</font> lnCount=0;lnCount<nMaxLines;lnCount++)
{
<font color=green>
<font color=blue>for</font>(<font color=blue>int</font> nStars=0;nStars<=(lnCount*2);nStars++)
{
cout<<"*";
}
cout<<endl;
}
Nibu thomas
Software Developer
|
|
|
|
|
1.how can i find the location of whitespace character in the file like tab, space etc??
|
|
|
|
|
I guess you are using MFC ...
Use CStdioFile ..
Using ReadString method of CStdioFile read a line of text and search for occurrence of the specified characters in that line.
Keep searching in this manner till EOF .
Nibu thomas
Software Developer
|
|
|
|
|
why is CView and CDocumnet created in the function?? any relation among them?
|
|
|
|
|
derek7 wrote: why is CView and CDocument created in the function?? any relation among them?
I don't see any CView and CDocument in the function.
Nibu thomas
Software Developer
|
|
|
|
|
Hello, everyone,
I want to implement such requirement as making a windows service on vista,
the service can display ui to user. How can I do? Where I can find the example?
Best Regards.
|
|
|
|
|
The proper name is an 'Interactive Session', check out this[^] MSDN article which explains about them.
Under Windows Vista interactive sessions are being fazed out though, check out this[^] blog entry by Larry Osterman (from Microsoft) which explains the reasons behind not using them.
Gavin Taylor
w: http://www.gavspace.com
-- modified at 0:13 Tuesday 7th March, 2006
|
|
|
|
|
These articles are very helpful to me, thanks!
|
|
|
|
|
Is there any method to dismiss the system modal dialog box programmatically?
|
|
|
|
|
|
to delete modelless dialog window
void CRVDlg:: OnExit()
{
OnCancel();
}
void CRVDlg::OnCancel()
{
DestroyWindow();
}
void CRVDlg::PostNcDestroy()
{
CDialog::PostNcDestroy();
if(m_pParent)
{
(CVCDlg*)m_pParent)->Obj=NULL;
}
delete this;
}
JAYARAJ
|
|
|
|
|
mfc42.dll 2.1k
mfc42d.dll 1.466k
why? debug version should large than release version.
|
|
|
|
|
The debug version has a list of all the named symbols in the file and their addresses, as well as line number information so the debugger can relate machine-code instructions to their line number in the source file.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|