|
if you have hugh data you have every time problems. Than it is best to split the data into different files. For instance in binary files (as images) which are stored with a path (or an identifier) in the object data.
Splitting data is always good idea, because you wont work and change all data at one time.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
my code is:
FILE* f = _wfopen(m_sFilespecW.c_str(),L"w");
size_t no = fwrite(tmp,sizeof(wchar_t),size,f);
fclose(f);
but it shows garbage.
when i change the code to:
FILE* f = _wfopen(m_sFilespecW.c_str(),L"w");
while(*tmp)
{
fputwc(*tmp,f);
tmp++;
}
fclose(f);
it saves the file but in ANSI format. it then fails to load in other function as that function only loads unicode files.
help me i want to save it in UNICODE.
|
|
|
|
|
Hi Qoi,
I believe, before you flush your caracters, you must first write the BOM signature.
I encountered this problem before, but instead of using the windows API like write and open, instead I was
using the STD ofstream data structure, but I think the rule is the same :
first the file is opened in BINARY mode :
ofstream fout;
fout.open(fileTo.c_str(), ios_base::out | ios_base::trunc | ios_base::binary);
Then the BOM is written :
fout.write("\xEF\xBB\xBF", 3); // write UTF-8 Byte Order Mark (BOM)
Followed by your data here before calling close.
Hope this helps.
Easy Profiler : a compile-time profiler for C++
www.potatosoftware.com
|
|
|
|
|
Your first code snippet is probably correct.
You may not have installed the correct language pack to view the unicode characters and so it is showing it as garbage.
In the second case, you need to add a header to indicate that the file is unicode.
In windows the following headers are added -
For UTF-8 encoding the first 3 bytes of the file must be EF BB BF .
For UNICODE encoding the first 2 bytes of the file must be FF FE .
The characters I have shown are hexadecimal.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
hello;
i want to remove page orientation from print setup and make its default to landscape;
how can i do it?;
thanx;
|
|
|
|
|
The PSD_DISABLEORIENTATION value of the Flags member (of PAGESETUPDLG struct) looks promising, see http://msdn.microsoft.com/en-us/library/ms646842(VS.85).aspx[^].
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]
|
|
|
|
|
Is there any way to show/hide the new progress bar? There isn't any function like ShowWindow.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
CMFCRibbonBaseElement::GetParentWnd() will give you a window...
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
That hides the parent window, which in this case is the status bar of the program. What I need is to hide only the progress bar itself. Maybe I should remove it from the status bar...
Here's how I create it:
m_pMFCRibbonProgressBar = new CMFCRibbonProgressBar(ID_RIBBON_BTN_PROGRESS, 200 );
m_pMFCRibbonProgressBar->SetRange(0, 100);
m_wndStatusBar.AddElement(m_pMFCRibbonProgressBar, "Progress", TRUE);
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
All the time I was looking for a Show method, there was CMFCRibbonProgressBar::SetVisible sitting right there before my eyes. Sometimes I'm dumb.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
What is the diffrence between LPRECT and RECT . How can we identify the use of these .
|
|
|
|
|
pandit84 wrote: What is the diffrence between LPRECT and RECT . How can we identify the use of these .
Right click on the datatype and select "Go to definition". That should help.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
LPRECT is a pointer to RECT
LP here stands for LONG POINTER, i.e. 32-bit
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
You may also use Visual Basic and have a (politely) happier life.
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]
|
|
|
|
|
Hi,
i am enhancing my application to support unicode characters...
Following is my code snippet:
---------------------------------------------------
typedef struct tagTIMEDATE {
DWORD Innards[2];
} TIMEDATE;
(structure being defined by Microsoft.(oledb.h))
typedef struct tagDBID
{
union
{
GUID guid;
GUID *pguid;
/* Empty union arm */
} uGuid;
DBKIND eKind;
union
{
LPOLESTR pwszName;
ULONG ulPropid;
/* Empty union arm */
} uName;
} DBID;
I used the following typedef now:
typedef TIMEDATE DBID;
------------------------------------------
Unfortunately, Compiler throws me an error (c2371) stating DBID is redefined;different basic types..
Previously, it was working fine. its not working after making my solution unicode supporting one in the project settings..
can anyone guide me how to solve this issue?
Thanks,
Rakesh
|
|
|
|
|
TIMEDATE and DBID are reserved datetype so you cant use DBID.
Make typedef TIMEDATE MY_DBID;
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi, Karsten
But previously, it was working fine... in the sense, before converting my project settings to unicode...
If so, why is it not working now?
|
|
|
|
|
|
Hi all,
I have made a application in vc-2008 Release mode, but i have made all the debug option true in my code i.e i am able to debug my application in release mode also.
My problem is i want to detect memory leak in my application. I got this code in msdn
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
_CrtDumpMemoryLeaks();
but it is mentioned that this code will work only in debug mode....
I am not getting that this code will work for me or not...
Can anybody please tell me? OR, is there any other way of doing so....
Thanks in advance
|
|
|
|
|
Why do you want to detect your memory leaks in release mode ? I don't release understand that
|
|
|
|
|
Ideally, you check memory leaks in debug mode and then finally change to release mode.
Are you writing configuration specific code?
If not you should be fine with checking leaks in debug mode.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Debug-Mode is suitable for detect memory leaks.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi
i Have a ClistCtrl and i want ot display the gridlines only for the rows and not for the colums. i have extended my style using the LVS_EX_GRIDLINES property. how to achive this?
Thanks in Advance
Gokul
|
|
|
|
|
Here is an article called Drawing horizontal and vertical gridlines[^], which is a very old one used to draw grid lines in a list control before it supported the LVS_EX_GRIDLINES style.
Change it to draw only lines for the rows.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
how to convert
IPictureDisp *pIPictureDisp to Byte array.
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|