|
zhenek91 wrote: but GetWindowRect() and ScreenToClient() return the rectangle of that window which was to maximization
do you want ScreenToClient Information in maximize mode or before maximize
"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
|
|
|
|
|
Hi all,
I have many compilation errors in my solutions and the type of errors are very different.
I am developing an MFC dialog application with visual studio 2005 and the follwoing is one of my work and with eash file I am adding the errors generated with each file.
// ( RulesMatching.h )
#ifndef RULESMATCHING_HEADER_ID
#define RULESMATCHING_HEADER_ID
#include "PatternMatching.h"
class CRulesMatching
{
public:
CRulesMatching();
int MatchRule(CString,int);
CPatternMatching OPM2; // create object OPM2 from the class
}
#endif
// ( RulesMatching.cpp )
#include "stdafx.h"
#include "RulesMatching.h"
#include "afxdb.h"
#include "odbcinst.h"
CRulesMatching::CRulesMatching()
{
}
int CRulesMatching::MatchRule(CString Str, int Cnum)
{
CDatabase database4;
CString SqlRulePattern;
CString sDriver("MICROSOFT ACCESS DRIVER (*.mdb)");
CString sDsn;
CString ssDSN("ODBC;DRIVER={%s};DSN='';DBQ=%s");
CString sFile("d:\\works\\ReadDB\\ASU.mdb");
sDsn.Format(ssDSN, sDriver, sFile);
database4.Open(NULL,false,false,sDsn);
CRecordset recset2( &database4 );
SqlRulePattern= "SELECT * from Patterns where CNum="+Cnum ;
recset2.Open(CRecordset::forwardOnly,SqlRulePattern,CRecordset::readOnly);
int Result2;
CString RContextNum,RRuleNum,RPatternNum,RPatternValue,RPatternContent;
CString BestRContextNum,BestRRuleNum,BestRPatternNum;
while(!recset2.IsEOF())
{
recset2.GetFieldValue(_T("CNum"),RContextNum);
recset2.GetFieldValue(_T("RNum"),RRuleNum);
recset2.GetFieldValue(_T("PNum"),RPatternNum);
recset2.GetFieldValue(_T("PValue"),RPatternValue);
recset2.GetFieldValue(_T("PContent"),RPatternContent);
Result2 = OPM2.MatchPattern(Str,RPatternContent);
if (Result2==1)
{
BestRContextNum = RContextNum;
BestRRuleNum = RRuleNum;
BestRPatternNum = RPatternNum;
recset2.MoveNext();
}
else
{
recset2.MoveNext();
}
}// while() closing
int i = _ttoi(BestRRuleNum);
return i ;
}
WHEN I COMPILE THE PREVIOUS ( .cpp file ) I HAD THESE ERRORS:
sqltypes.h(21) : error C2143: syntax error : missing ';' before 'string'
sqltypes.h(21) : error C2059: syntax error : 'string'
sqltypes.h(21) : error C2143: syntax error : missing ';' before '{'
sqltypes.h(21) : error C2447: '{' : missing function header (old-style formal list?)
afxdb_.h(70) : error C2146: syntax error : missing ';' before identifier 'm_dwDataLength'
afxdb_.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
afxdb_.h(70) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(578) : error C2143: syntax error : missing ';' before '__stdcall'
sql.h(578) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(578) : error C2065: 'SQLHENV' : undeclared identifier
sql.h(578) : error C2146: syntax error : missing ')' before identifier 'EnvironmentHandle'
sql.h(578) : warning C4229: anachronism used : modifiers on data are ignored
sql.h(578) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(579) : error C2059: syntax error : ')'
sql.h(581) : error C2143: syntax error : missing ';' before '__stdcall'
sql.h(581) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(581) : error C2086: 'int SQLRETURN' : redefinition
sql.h(578) : see declaration of 'SQLRETURN'
sql.h(581) : error C2065: 'EnvironmentHandle' : undeclared identifier
warning C4229: anachronism used : modifiers on data are ignored
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
sql.h(581) : fatal error C1903: unable to recover from previous error(s); stopping compilation
ACA - 19 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
AND WHEN I COMPILE THE WHOLE SOLUTION I HAVE THESE ERRORS:
error C2236: unexpected 'class' 'CUtteranceCleaning'. Did you forget a ';'?
c:\documents and settings\mohammad\desktop\aca\aca\utterancecleaning.h(5) : error C2143: syntax error : missing ';' before '{'
c:\documents and settings\mohammad\desktop\aca\aca\utterancecleaning.h(5) : error C2447: '{' : missing function header (old-style formal list?)
c:\documents and settings\mohammad\desktop\aca\aca\acadlg.h(31) : error C2146: syntax error : missing ';' before identifier 'OUC'
acadlg.h(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\acadlg.h(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
acadlg.cpp(169) : error C2065: 'OUC' : undeclared identifier
acadlg.cpp(169) : error C2228: left of '.CleanUtterance' must have class/struct/union
type is ''unknown-type''
Build log was saved at "file://c:\Documents and Settings\mohammad\Desktop\ACA\ACA\Debug\BuildLog.htm"
ACA - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I am sorry for this long thread but I worked for two days to make the solution working and I can't and I checked every missing semicolon or bracket and there is no somthing missing..
Please anyone can help me let me know and I appreciate any type of helping.
|
|
|
|
|
You forgot the ; after the declaration of CRulesMatching in your RulesMatching.h .
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
yeah ur alright.
thank you so much
|
|
|
|
|
always concentrate on the first error message first, solving it may reduce the list dramatically.
|
|
|
|
|
|
hello all, i have a problem need your help...
I show amount data in virtual listctrl fast,but i click a item ,the item text will be recovered ,,i want to fix the text in each item when them showed like in real mode.
I search much,,but i didn't get the solution,,i need your help,thanks.
|
|
|
|
|
yiyinkuang wrote: I show amount data in virtual listctrl fast...
I'm with you so far.
yiyinkuang wrote: ...but i click a item ,the item text will be recovered...
Are you talking about using GetItemText() or GetItem() in response to a LVN_ITEMCHANGED message?
yiyinkuang wrote: ...i want to fix the text in each item when them showed like in real mode.
This is unclear in so many ways.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
yes,,i try to use GetItemText store item text ,,but GetItemText will trigger the item text change
|
|
|
|
|
yiyinkuang wrote: try to use GetItemText store item text...
Store it where, in the list control or some data structure?
yiyinkuang wrote: but GetItemText will trigger the item text change
Nonsense (assuming you are referring to the LVN_ITEMCHANGED message). That would only happen if you used SetItemText() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
thank you,,use GetItemText will send LVN_GETDISPINFO,,and function OnGetdispinfoList will change the item text
|
|
|
|
|
yiyinkuang wrote: ...function OnGetdispinfoList will change the item text
In a manner of speaking, yes.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
(assuming I understand what you want)
If you have a "virtual" list ctrl (CListBox or CListCtrl?), then you should have an underlying data structure somewhere that holds the data that is displayed by the list.
In you derived list ctrl control, there should be a method to display each item individually something like DrawItem ); usually, it's in that method that you fetch the data from your data structure and "format" it correctly to be displayed in the list ctrl.
This signature was proudly tested on animals.
|
|
|
|
|
thank you ,i have a struct for displaying ,,but the struct data updata dynamic,,i can not alloc memory as the image for dispalyed data,,because the data is too huge.
|
|
|
|
|
How to change background color of button on dialog box in mfc
Project Engineer
|
|
|
|
|
Start by searching for WM_CTLCOLORBTN .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Color Button[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi,
How can i read the meta-data information of files using VC++. I mean the information we see when we change the folder view to details. eg:- Author of MS-Word document etc.
thanks,
J.
|
|
|
|
|
Voila[^]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello all
I have a big problem after upgrading to IE8 . In our filetransfer module we are using wininet_connect(..) to establish connections via gSoap client . It has been working fine till we upgraded to IE8 with wininet.dll version 8.0 . The problem is that the wininet_callback is getting INTERNET_STATUS_CONNECTION_CLOSED message due to which gSoap client is disconnecting . This does not happen in IE6 and its wininet.dll version ...
Has anyone faced this problem ?
redindian
|
|
|
|
|
Why don't execution function
MessageBox(L"DIVIDE BY ZERO"); ?
The code is skipping.
#include "Excpt.h"
#include "Winnt.h"
#include "cmath"
float fResult; // Bennet, pg.136
//int x,y;
float x,y;
// x = 5;
// y = 0;
x = 5.0;
y = 0.0;
_try // __try
{
fResult = x/y;
}
//__except (GetExceptionCode() == EXCEPTION_FLT_DIVIDE_BY_ZERO)
_except (GetExceptionCode() == EXCEPTION_FLT_DIVIDE_BY_ZERO)
{
MessageBox(L"DIVIDE BY ZERO");
}
|
|
|
|
|
You need to turn on floating-point exceptions first...
Try #includeing <float.h> and add this bit of code before you do the divide...
_controlfp(0, MCW_EM);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
modified on Thursday, August 27, 2009 10:48 AM
|
|
|
|
|
Hi all,
Can any body tell me how to disable restore on title bar click.
Thanks
|
|
|
|
|
I presume you mean restoring a window from a minimized state?
If so, then your main window needs to handle WM_SYSCOMMAND[^] and call the inherited WndProc EXCEPT when the wParam == SC_RESTORE.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I need help in creating a waterfall display of my image data stored in a buffer. The image needs to be displayed scrolling down the screen as its being acquired from the camera.
I am using visual studio c++ windows forms.
Can someone please help me to figure out how to achieve this display?
Thanks in advance
|
|
|
|