|
you could look at this - Im sure he has a save method in his CFontHelper class ...
CFontHelper[^]
'g'
|
|
|
|
|
how to save any file
Trioum
modified on Friday, June 12, 2009 2:26 AM
|
|
|
|
|
Please elaborate.
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]
|
|
|
|
|
hah - you got there before me Carlo ...
come stai ? (e suo famiglio ?) (thats wrong I know, hope you know what I mean ..)
|
|
|
|
|
Garth J Lancaster wrote: come stai ? (e suo famiglio ?) (thats wrong I know, hope you know what I mean ..)
Actually it's pretty good (correct sentence:"Come stai? (E la tua famiglia?)").
BTW: Fine, thanks.
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 want to save the data at every instance.
Trioum
|
|
|
|
|
Your post is confusing, unclear and clueless ALL at the same time. Anyone attempting to answer you will have a tendency to jab a needle into their eye.
However, to answer your post: If the other application has opened the file in exclusive access mode, you will not be able to even read it. Again, if you do have access to the file, it is not clear from your post if you want to save updates to the same file (depends on if the application that created the file is allowing other applications to perform a write operation on it).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
so
I want to auto save the file.
Trioum
modified on Friday, June 12, 2009 2:28 AM
|
|
|
|
|
WHAT SAVE BUTTON? Where is it? In your app or in the third party app?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
in the file
Trioum
modified on Friday, June 12, 2009 2:31 AM
|
|
|
|
|
My question was: Where is the save button?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
not sure what you mean - if its some sort of program you've written, then its quite easy to keep a 'dirty'/'has-been-modified' flag, set that when ever data is changed, inspect it periodically and save the data if it has been set.
If you mean controlling some sort of other program not written by you then you'll have to supply more information
'g'
|
|
|
|
|
But do you know detail of each file for example pdf files or 3gp files and etc?
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 )
|
|
|
|
|
no one is answering everyone is questionning and fighting with each other
Trioum
modified on Tuesday, May 26, 2009 12:54 AM
|
|
|
|
|
because your question is terrible, so vague, either your grasp of english is letting you down or your waiting to be a darwin award poster boy
|
|
|
|
|
What is the question ?
do you need help in writing files of different formats ?
or
do you need help on how to implement an auto-save feature ?
This signature was proudly tested on animals.
|
|
|
|
|
Hi there,
I found a code snippet on the web which converts an ANSI string to UTF-8 format. I implemented it in my own and it works.
<br />
char text[1024]={0};<br />
WCHAR w[1024]={0};<br />
int erg=0;<br />
<br />
strcpy(text, m_pData);<br />
<br />
erg=MultiByteToWideChar(CP_ACP, 0, text, -1, w, sizeof(w) / sizeof(WCHAR));
erg=WideCharToMultiByte(CP_UTF8, 0, w, -1, text, sizeof(text), 0, 0);
After that 'text' is UTF-8 formatted just nicely.
Now I was wondering, why doesn´t the following (slightly altered) code not work? I just created a char* instead of char[];
<br />
char* text = new char[1024];<br />
WCHAR w[1024]={0};<br />
int erg=0;<br />
<br />
strcpy(text, m_pData);<br />
<br />
erg=MultiByteToWideChar(CP_ACP, 0, text, -1, w, sizeof(w) / sizeof(WCHAR));
erg=WideCharToMultiByte(CP_UTF8, 0, w, -1, text, sizeof(text), 0, 0);
Thanks,
Souldrift
|
|
|
|
|
My guess is in the first example the sizeof operator can calculate the size of the array. When it comes to pointers - no such luck. Try passing the size of the allocated memory directly (preferably by using a #define):
#define ARRAY_SIZE 1024
erg=MultiByteToWideChar(CP_ACP, 0, text, -1, w, ARRAY_SIZE);
erg=WideCharToMultiByte(CP_UTF8, 0, w, -1, text, ARRAY_SIZE, 0, 0);
|
|
|
|
|
Souldrift wrote: char* text = new char[1024];
WCHAR w[1024]={0};
int erg=0;
Try to avoid using numbers directly or hard coding instead store in a constant.
const int SIZE = 1024;
char* text = new char[SIZE];
WCHAR w[SIZE]={0};
erg=MultiByteToWideChar(CP_ACP, 0, text, -1, w, SIZE);
erg=WideCharToMultiByte(CP_UTF8, 0, w, -1, text, SIZE, 0, 0);
So when you change SIZE, this code still keeps working.
|
|
|
|
|
Thanks. That to both of you. That works.
Problem is that I wanted to avoid a const size and instead use the variable size of m_pData (the original text). Is that possible?
Souldrift
|
|
|
|
|
Since m_pData is a string you can use string operations like strlen. Try this:
char *text = new char[strlen( m_pData ) + 1 ];
WCHAR *w = new WCHAR[strlen( m_pData ) + 1];
int erg=0;
strcpy(text, m_pData);
erg=MultiByteToWideChar(CP_ACP, 0, text, -1, w, strlen( text ));
erg=WideCharToMultiByte(CP_UTF8, 0, w, -1, text, wcslen( w ), 0, 0);
Just make sure that the strings are all NULL terminated!!
|
|
|
|
|
Hi I am using a ADO in my project. But when i compile my code i am getting the follwoing error.
error LNK2019: unresolved external symbol "long __cdecl _com_dispatch_method(struct IDispatch *,long,unsigned short,unsigned short,void *,wchar_t const *,...)" (?_com_dispatch_method@@YAJPAUIDispatch@@JGGPAXPB_WZZ) referenced in function "public: long __thiscall ConnectionEvents::InfoMessage(struct Error *,enum EventStatusEnum *,struct _Connection *)" (?InfoMessage@ConnectionEvents@@QAEJPAUError@@PAW4EventStatusEnum@@PAU_Connection@@@Z)
I have added this in my stdafx.cpp
#import "..\..\..\..\..\Microsoft\Redistribute\MSADO15.dll" no_namespace \
rename("Parameters","ADOParams") \
rename("Connection","ADOCon") \
rename("Parameter","ADOParam") \
rename("EOF", "adoEOF") \ implementation_only
and below code in my stdafx.h file
#import "..\..\..\..\..\Microsoft\Redistribute\MSADO15.dll" no_namespace \
rename("Parameters","ADOParams") \
rename("Connection","ADOCon") \
rename("Parameter","ADOParam") \
rename("EOF", "adoEOF") \ no_implementation
Please provide any comment i am not able to find out what is to be included to avoid this linking error.
|
|
|
|
|
Make sure you're linking against comsupp.lib (or some variant thereof - there's comsupp, comsuppd, comsuppw and comsuppwd) - that's where that symbol is defined. There is a #pragma in the #import process that specifies to link against that library, but it's possible, I guess, that doing the #import in stdafx negates the effect of the #pragma.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hallo, i have the following piece of code , when i try to delete the lpKeyPoint i get HEAP CORRUPTION DETECTED!
LPPOINT lpKeyPoint;
lpKeyPoint = (LPPOINT)new LPPOINT();
GetCaretPos((LPPOINT)lpKeyPoint);
if(lpKeyPoint)
{
delete lpKeyPoint;
lpKeyPoint = NULL;
}
How can i solve this problem?
Thanks.
|
|
|
|
|
susanne1 wrote: lpKeyPoint = (LPPOINT)new LPPOINT()
That should be:
lpKeyPoint = new POINT();
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]
|
|
|
|
|