|
ya irain its a chaild window i checked in resource editor style is pop up and border is dialog frame
if i keep style as child its not working its creating differently
i.e back side of the main app
|
|
|
|
|
Hi,
Also try using AfxGetApp()->m_pMainWnd instead of AfxGetMainWnd().
thanks ,
Nitheesh
|
|
|
|
|
No Niteesh not working with that same result
its unsolved problem for me since long time
|
|
|
|
|
girishchi@gmail.com wrote: ...it is creating in a new seperate window...
Instead of what?
The owner of a window is not necessarily the same as its parent. See here for more.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
ya i got it we have to add setparent function in OnInit function
|
|
|
|
|
i have some problm to insert data into excel sheet. i hv configure the DSN name and the Workbook and also clear the read only option. i can read dat from that workbook as usual. But when i write the data then data is inserted only when , that worksheet is opened in task bar. data is not inserted when that worksheet is not opened in task bar. i am not able to find reason for that event.
i am sending the sample code for executing a query for excel sheet.
BOOL ExcuteStmtUpdate(char* Query)
{
SQLRETURN status;
int rc=-1;
SQLHSTMT StatementHandle;
long Roll;
SDWORD sdwALen;
int i;
//allocate statment handle
status = SQLAllocHandle (SQL_HANDLE_STMT,UpdateDBC.m_Connection,&StatementHandle);
if(status != SQL_SUCCESS && status != SQL_SUCCESS_WITH_INFO)
{
SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle);
return false;
}
status = SQLPrepare(StatementHandle,(unsigned char*)Query,strlen(Query));
if(status == SQL_SUCCESS || status == SQL_SUCCESS_WITH_INFO)
{
status=SQLBindCol(StatementHandle, 1, SQL_C_SLONG,(PTR)&Roll, sizeof(Roll), &sdwALen);
//SQLExecute call
status = SQLExecute(StatementHandle);
if(!(status == SQL_SUCCESS || status == SQL_SUCCESS_WITH_INFO))
{
SQLFreeHandle (SQL_HANDLE_STMT,StatementHandle);
return false;
}
for (i = 1; (rc = SQLFetch(StatementHandle)) == SQL_SUCCESS; i++)
{
printf("%d ",Roll);
}
status=SQLEndTran(SQL_HANDLE_ENV,UpdateDBC.m_EnvironmentHandle, SQL_COMMIT);
}
else
{
SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle);
return false;
}
SQLFreeHandle (SQL_HANDLE_STMT, StatementHandle);
return true;
}
|
|
|
|
|
here is a technique but iam not sure weather it is useful for your requirement.
simply do the file operations.
FILE *fp;
fp=fopen("C:\\test.xls","w");
fprintf(fp,"data1\n");
fprintf(fp,"data2\n");
fclose(fp);
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
modified on Thursday, April 10, 2008 6:40 AM
|
|
|
|
|
Are you kidding ? Do you know that excel files are binary files ?
|
|
|
|
|
all this i have done in my program. data is inserted when excel sheet is opened
is it possible or not, to insert data into excelsheet without MFC and Com component?
|
|
|
|
|
There are multiple layers of ignorance in this post. Perhaps the easiest to address is that C file handling is ugly as sin, I would never use it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Perhaps the easiest to address is that C file handling is ugly as sin, I would never use it.
So do you use D or E file handling?
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
Did you make a test of such a technique?
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
|
|
|
|
|
yes all this thing written in question are done thru my program
|
|
|
|
|
And you program really inserts values into Excel cells?
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
|
|
|
|
|
values are inserted when excel sheet is opened in task bar otherwise not.
|
|
|
|
|
You're simply writing a text file (that Excel can import, of course). But what if you access that way an existing Excel document?
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
|
|
|
|
|
i am trying to solve this problm from 5 days. But i can't find the solution or hint for this problm. if we can read data when excel sheet is not opened in task bart then why not write. if u have solution then please help me.
|
|
|
|
|
Sorry, there was a misunderstanding, my replies were for chandu004 and his fprintf approach.
Anyway, I dont know why ODBC behave that way. But why don't you use COM ?
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
|
|
|
|
|
i know chadu,s approch was not correct. actually i am not much more comfertable with COM
so i had tried to do it throgh odbc.
thank u
|
|
|
|
|
Well I think CP article search engine may help you [^].
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
|
|
|
|
|
yes master,
i agree to all of your points and iam aware of them.
for some applications, where the requirement is only to see the data in excel, i use this lite weight technique. and iam aware that, it has its own side effects. thats why i quoted in my post that, "here is a technique but iam not sure weather it is useful for your requirement".
and your explanation
CPallini wrote: You're simply writing a text file (that Excel can import, of course).
was impressive.
thank you.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Hi chandu004
How are you?
|
|
|
|
|
Hi, I have a class derrived from CEdit. I need to resize it when it reaches its max text limit in order to accomodate the new character. But if I incremant it by a fixed size there is a problem. As each character is taking different space. like 'l' , '.' and '2' wiil require different space. So a constant number doesen't fit the bill. Also when I press backspace the Edit control should decreament by exact size required by the chartacter (I fill this is somewhat more difficult as you need to know the size of a character) back space is going to delete.Please help if anybody has the solution.
|
|
|
|
|
Hi,
use MoveWindow to Change the size.
thanks,
Nitheesh
|
|
|
|
|
Hi,
We have created a dialog based application in vc 8 for excel automation (Excel 2003). When we are using the wrapper class, we are getting the following errors.
------ Build started: Project: AutoProject2, Configuration: Debug Win32 ------
Compiling...
AutoProject2.cpp
AutoProject2Dlg.cpp
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1219) : error C2371: 'FontPtr' : redefinition; different basic types
e:\program files\microsoft visual studio 8\vc\include\comdef.h(312) : see declaration of 'FontPtr'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1297) : error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int)' : invalid operand for __uuidof
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1297) : error C2923: '_com_IIID' : 'Rectangle' is not a valid template type argument for parameter '_Interface'
e:\program files\microsoft visual studio 8\vc\platformsdk\include\wingdi.h(3514) : see declaration of 'Rectangle'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1297) : error C3203: '_com_IIID' : unspecialized class template can't be used as a template argument for template parameter '_IIID', expected a real type
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1301) : error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int,int,int,int,int)' : invalid operand for __uuidof
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1301) : error C2923: '_com_IIID' : 'Arc' is not a valid template type argument for parameter '_Interface'
e:\program files\microsoft visual studio 8\vc\platformsdk\include\wingdi.h(2765) : see declaration of 'Arc'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1301) : error C3203: '_com_IIID' : unspecialized class template can't be used as a template argument for template parameter '_IIID', expected a real type
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1308) : error C2371: 'PicturePtr' : redefinition; different basic types
e:\program files\microsoft visual studio 8\vc\include\comdef.h(326) : see declaration of 'PicturePtr'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1689) : error C2504: '_IMsoDispObj' : base class undefined
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1731) : error C2504: '_IMsoDispObj' : base class undefined
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1833) : error C2504: '_IMsoDispObj' : base class undefined
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1852) : error C2146: syntax error : missing ';' before identifier 'GetRGB'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1852) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1852) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1852) : warning C4183: 'GetRGB': missing return type; assumed to be a member function returning 'int'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(1854) : error C2061: syntax error : identifier 'MsoRGBType'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(2189) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(2189) : warning C4183: 'GetTransparencyColor': missing return type; assumed to be a member function returning 'int'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(2191) : error C2061: syntax error : identifier 'MsoRGBType'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(2235) : error C2061: syntax error : identifier 'MsoRGBType'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(2237) : error C2061: syntax error : identifier 'MsoRGBType'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(2246) : error C2504: '_IMsoDispObj' : base class undefined
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(2335) : error C2504: '_IMsoDispObj' : base class undefined
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(2453) : error C2504: '_IMsoDispObj' : base class undefined
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(2579) : error C2504: '_IMsoDispObj' : base class undefined
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(5491) : error C2011: 'Font' : 'struct' type redefinition
e:\program files\microsoft visual studio 8\vc\include\comdef.h(310) : see declaration of 'Font'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(7783) : warning C4003: not enough actual parameters for macro 'DialogBoxW'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(7783) : error C2059: syntax error : ','
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(17141) : error C2011: 'Picture' : 'struct' type redefinition
e:\program files\microsoft visual studio 8\vc\include\comdef.h(324) : see declaration of 'Picture'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(18104) : error C2146: syntax error : missing ';' before identifier 'Scripts'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(18104) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(26976) : error C2059: syntax error : '('
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(26976) : error C2059: syntax error : ')'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(26976) : error C2143: syntax error : missing ')' before '|'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(26976) : error C2143: syntax error : missing ')' before '|'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(26976) : error C2143: syntax error : missing ';' before '|'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(26976) : error C2059: syntax error : ')'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(26976) : error C2059: syntax error : ')'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(26976) : error C2238: unexpected token(s) preceding ';'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30578) : error C2146: syntax error : missing ';' before identifier 'MailEnvelope'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30578) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30578) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30598) : error C2146: syntax error : missing ';' before identifier 'Scripts'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30598) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30598) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30980) : error C2146: syntax error : missing ';' before identifier 'GetScripts'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30980) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30980) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(30980) : warning C4183: 'GetScripts': missing return type; assumed to be a member function returning 'int'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(31000) : error C2146: syntax error : missing ';' before identifier 'GetMailEnvelope'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(62897) : warning C4183: 'GetMailEnvelope': missing return type; assumed to be a member function returning 'int'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63522) : error C2146: syntax error : missing ';' before identifier 'HTMLProject'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63522) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63522) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63532) : error C2146: syntax error : missing ';' before identifier 'CommandBars'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63532) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63532) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63576) : error C2146: syntax error : missing ';' before identifier 'VBProject'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63576) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63576) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63578) : error C2146: syntax error : missing ';' before identifier 'Permission'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63578) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63578) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(63580) : error C2146: syntax error : missing ';' before identifier 'SharedWorkspace'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64067) : error C2146: syntax error : missing ';' before identifier 'GetHTMLProject'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64067) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64148) : warning C4183: 'GetSync': missing return type; assumed to be a member function returning 'int'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64160) : error C2146: syntax error : missing ';' before identifier 'GetSmartDocument'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64160) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64160) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64160) : warning C4183: 'GetSmartDocument': missing return type; assumed to be a member function returning 'int'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64161) : error C2146: syntax error : missing ';' before identifier 'GetDocumentLibraryVersions'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64161) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64161) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(64161) : warning C4183: 'GetDocumentLibraryVersions': missing return type; assumed to be a member function returning 'int'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(68608) : error C2146: syntax error : missing ';' before identifier 'GetNewWorkbook'
f:\sangeetha\autoproject2\autoproject2\debug\excel.tlh(68608) : fatal error C1003: error count exceeds 100; stopping compilation
Generating Code...
Build log was saved at "file://f:\Sangeetha\AutoProject2\AutoProject2\Debug\BuildLog.htm"
AutoProject2 - 222 error(s), 34 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========<base href="http://mail.tessolve.com/cgi-bin/webmail/">
How to correct these errors?
Thanks in advance,
Sangeetha. J
With Regards,
Sangeetha.
|
|
|
|