|
ashish8patil wrote: i this code it is writting & reading stuct data ,BUt not changing that data...
Of course it's not changing the data. You've shown no code to do that.
ashish8patil wrote: ...i want change that data
So change it and call the write() method again. What's the problem?
"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
|
|
|
|
|
Plese use the code block button for posting code snippets.
ashish8patil wrote: i this code it is writting & reading stuct data ,BUt not changing that data i want change that data
What do you mean with this? Your program sets the fields of the struct, then write it to disk, and finally read it again from disk. How these operations are supposed to change the content? What is your expected output?
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
[My articles]
|
|
|
|
|
I am using the below code snippet for retreving the Product version . This works fine when I write this in a sample application. I am retreiving the correct product version Eg. "10.9.8". But when I integrated this code snippet with my project code. then str string in below code gives me return value as "?#@!" Can I know what could have been the problem.
CString GetInstalledIntouchCEVersion()
{
UINT returnCode;
char pProductCode[39]={0};
//char lpVersion[50] = {0};
LPSTR str;
DWORD cchVersionName;
str = new TCHAR[50];
// Here Guid is MSI product upgrade code for InTouchCE
returnCode = MsiEnumRelatedProducts("Our Product Code",0,0,pProductCode);
if ( ERROR_SUCCESS == returnCode )
{
UINT ret = MsiGetProductInfo(pProductCode,INSTALLPROPERTY_VERSIONSTRING,str,&cchVersionName);
}
return str;
}
|
|
|
|
|
Venkat KR wrote: if ( ERROR_SUCCESS == returnCode )
{
UINT ret = MsiGetProductInfo(pProductCode,INSTALLPROPERTY_VERSIONSTRING,str,&cchVersionName);
}
return str;
I see you are 'returning' str with no regards to what MsiGetProductInfo() returned.
Can you check the return value?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
#include <stdio.h>
#include <stdlib.>
#include <string>
main()
{
char s[80];
int i=0;
FILE *fp;
fp=fopen("POEM.TXT","w+");
if(fp==NULL)
{
puts("Cannot open file");
exit(1);
}
puts("Enter any string");
while ( strlen(gets(s)) >; 0 );
{
fputs(s,fp);
fputs("\n",fp);
}
fclose(fp);
}
This prog should write the given output to the text file. But inspite of not giving any errors the text file remains empty!!!
|
|
|
|
|
Take a look at the code you've posted! It is not properly formatted and worse yet some parts are not visible. Please "edit" your post, select all the code and click the "code block" formatting option.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Razanust wrote: while ( strlen(gets(s)) >; 0 );
This line should be
while ( strlen(gets(s)) > 0 )
i.e. without the semicolon at the end.
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
[My articles]
|
|
|
|
|
|
You are welcome.
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
[My articles]
|
|
|
|
|
Hello All,
I have structure
student{ char name[10];
int id ;
};
int main()
{
student s ;
///filling data to s
//writting s to file temp.dat
//reading s from temp.dat
}
Now i want to change s.name .
what should i do
thanks all.
|
|
|
|
|
_tcscpy(s.name, _T("Hello")); ?
Are you looking for something else?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Sorry sir, it doesn't fit on UNICODE builds.
You may use _T("hi"), however...
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
[My articles]
|
|
|
|
|
Well, that's an essay for another time. Use TCHAR instead of char while writing code on Windows.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
thanks for reply please see my new post
|
|
|
|
|
hi,
I wrote a dialog based application, in that i am taken one button for opening a rtf file whcih located in my desktop. Please tell me how to open that rtf file directly when i am clicking the button, I tried WinExec()method for opening, but i am not getting
thanx in advance.....
sampath-padamatinti
|
|
|
|
|
|
Hello,
By which function of MDIFrameWnd can I get the list of all open windows.
Pritha
|
|
|
|
|
All open windows owned by your application or all windows on the running on current desktop?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks for your reply
I did not understand your reply.
I wanted to know the function by which I can get the pointers of all the open windows created by CreateNewChild().
Pritha
|
|
|
|
|
|
Hi All
I am useing Microsoft Excel Driver for creating a database (i.e. Excel sheet).it's working only for .xls formate.But it's not create for .xlsx formate.Code is here
GetDlgItemText(IDC_EDIT1,m_getfilename);
CDatabase database;
CString sDriver="Microsoft Excel Driver(*.xls, *.xlsx, *.xlsm,*.xlsb)";
CString sExcelFile = m_getfilename;
CString sSql;
TRY
{
sSql.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s",
sDriver, sExcelFile, sExcelFile);
if( database.OpenEx(sSql,CDatabase::noOdbcDialog) )
{
sSql = "CREATE TABLE demo (Name TEXT,Age NUMBER)";
database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Bruno Brutalinsky',45)";
database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Fritz Pappenheimer',30)";
database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Hella Wahnsinn',28)";
database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Bruno Brutalinsky',45)";
database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Fritz Pappenheimer',30)";
database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Hella Wahnsinn',28)";
database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Bruno Brutalinsky',45)";
database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Fritz Pappenheimer',30)";
database.ExecuteSQL(sSql);
}
database.Close();
}
CATCH_ALL(e)
{
TRACE1("Driver not installed: %s",sDriver);
}
END_CATCH_ALL;
plz help me
|
|
|
|
|
So where's the problem?
"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
|
|
|
|
|
problen is .xlsx file formate not work.
|
|
|
|
|
|
Take a look at point# 2 and 4 in this post[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|