|
Hi,
I tried with that , but could not found the desired result.
In fact the stepa which I followed are as:
1. First I got the characters in the rtf string for a character(say chinese) I typed.
ex:\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fmodern\\fprq6\\fcharset134 SimSun;}}{\\colortbl ;\\red0\\green0\\blue0;}\\viewkind4\\uc1\\pard\\cf1\\lang5124\\f0\\fs20\\'cc\\'d8\\par}"
This is for the character 特
2.Now I convert the character values in to equavalant unicode number, which I got for this is 29305.
3.Now I want to convert this unicode number in to equavalant UTF-8 character.
Can u suggest something with this scenerio .
Regs
Vineet Kumar Singhal
Sr.Software Engineer
Mumbai
Tough Time Never last, but Tough People do.
|
|
|
|
|
LPCWSTR wszUTF16 = L"\x7279";
char szUTF8[16] = {0};
WideCharToMultiByte(CP_UTF8, 0, wszUTF16, -1, szUTF8, 16, NULL, NULL);
|
|
|
|
|
I would like to know how to modify or add a registry setting?
Please help!
|
|
|
|
|
LaHaHa wrote: I would like to know how to modify or add a registry setting?
I would like to know how to use the search[^] feature. Can it find articles related to the words I type in?
Please help!
|
|
|
|
|
U can access the registry settings by
C:\WINNT\system32\regedt32 file where u can view and edit system registry.
|
|
|
|
|
Suresh H wrote: U can access the registry settings by
C:\WINNT\system32\regedt32 file where u can view and edit system registry.
He intends to do it with his program, I believe and not by opening the registry editor!
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
But the person did not tell.. its through the programs right
|
|
|
|
|
Suresh H wrote: But the person did not tell.. its through the programs right
means if the person ask you notepad ( real one) you will provide him virtual one!.. it is obvious that person on programming forum will ask only programming not regedit.exe
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Suresh H wrote: But the person did not tell.
What do I call you? He need not tell it. You need to know it by yourself! This is a programming forum.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Sorry! I mean write a program to do the registry editing!
Please help!
|
|
|
|
|
LaHaHa wrote: Sorry! I mean write a program to do the registry editing!
try CRegKey... it's very simple!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
The following functions would be helpful to deal with the registry.
<br />
RegOpenKeyEx()<br />
RegQueryValueEx()<br />
RegSetValueEx()<br />
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Thank you very much!
I will try it!
|
|
|
|
|
Hi
I want my appication should display menu in japanese. so how to use loadResString for this.
atul
|
|
|
|
|
M. Atul wrote: loadResString
I doubt if there is such a function. May be it exists in VB or something else. You can use the CString::LoadString if you are using MFC.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Dear All,
I want to write an XML file into shared memory.
I have an XML file or variable of MSXML2::IXMLDOMDocument2Ptr has the whole content.
I need to write this content into shared memory variable that is returned by MapViewOfFile API.
How can i do this ?
Kindly Help me.
Thanks.
-- modified at 1:03 Thursday 23rd November, 2006
|
|
|
|
|
Since MapViewOfFile returns a pointer to shared memory:
<code>LPVOID ptr = MapViewOfFile(. . .)</code>,
I think you should use it as the destination in a string-copy operation:
<code>lstrcpyW((LPWSTR)ptr, xml)</code>,
where xml is the XML string to by copied. Probably it can be obtained from your IXMLDOMDocument2 object like this:
<code>_bstr_t xml = myDocument->xml</code>.
I hope this helps.
|
|
|
|
|
I am saving one bitmap in one .bmp file,
but it is in inverted format something wrong i did.
I used two structure in my code BITMAPINFO and BITMAPFILEHEADER and then i write it into .bmp file.
1
PLEASE suggest me..
1>which property shall i change to get non-inverted bitmapformat.
OR
2>How to invert the inverted format which i got.
ABHIJIT
|
|
|
|
|
You say inverted, but do you mean upside down? You could try using positive or negative figures for the bitmap height paramater of BITMAPINFO.
|
|
|
|
|
Thank you,
i will try and reply you!!!
see u.
|
|
|
|
|
Thanks for reply!!!!!!!!!!!
I used this code please tell me any correction....
//This is for getting data from clipboard in CBitmap's object.
OpenClipboard();
Glb=EnumClipboardFormats(0);
HANDLE hBitMap = GetClipboardData(Glb); //getting from clipboard
if(hBitMap == NULL)
{
AfxMessageBox("Error in Capturing Image");
return;
}
//CBitmap * bmp = CBitmap::FromHandle(hBitMap);
CBitmap bmp;
if(!bmp.Attach((HBITMAP)hBitMap))
{
AfxMessageBox( "Error in Loading Image" );
}
BITMAP bitmap ;
bmp.GetBitmap(&bitmap);
int size = ((bitmap.bmWidth)*(bitmap.bmHeight)*(bitmap.bmBitsPixel))/8;
BYTE *lpBits = new BYTE[size];
::GetBitmapBits((HBITMAP)hBitMap,size,lpBits);
WriteBmp("C\\Patient.bmp",&bitmap,(int*)lpBits);
CloseClipboard();
}
For writing ang saving .bmp file.......
void WriteBmp(char* name,BITMAP *bmp,int* data)
{
BITMAPINFO Bmi;
memset(&Bmi,0,sizeof(BITMAPINFO));
Bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
Bmi.bmiHeader.biWidth = (bmp->bmWidth);
Bmi.bmiHeader.biHeight = (bmp->bmHeight);
Bmi.bmiHeader.biPlanes = 1;
Bmi.bmiHeader.biBitCount = bmp->bmBitsPixel;
Bmi.bmiHeader.biCompression = BI_RGB;
Bmi.bmiHeader.biSizeImage = bmp->bmHeight*bmp->bmWidth*bmp->bmBitsPixel/8;
FILE* image = fopen (name,"wb");
if(image==0)
return;
int h = abs(Bmi.bmiHeader.biHeight);
int w = abs(Bmi.bmiHeader.biWidth);
Bmi.bmiHeader.biHeight=h;
Bmi.bmiHeader.biWidth=w;
int sz = Bmi.bmiHeader.biSizeImage;
BITMAPFILEHEADER bfh;
bfh.bfType=('M'<<8)+('B');
bfh.bfOffBits=sizeof(BITMAPFILEHEADER)+ sizeof(BITMAPINFOHEADER);
bfh.bfSize=sz+bfh.bfOffBits;
bfh.bfReserved1=0;
bfh.bfReserved2=0;
fwrite(&bfh,sizeof(bfh),1,image);
fwrite(&Bmi.bmiHeader,sizeof(BITMAPINFOHEADER),1,image);
fwrite(data,sz,1,image);
fclose(image);
}
|
|
|
|
|
We are creating a Document Management System. In that a user can open the document with associated application.
We need to show a lock icon if the file is already open. We open the file in thread using shell execute and then user WaitfForsSingleObject of detect if the file is closed. But if the multiple files are opened (like two files are opened in Acrobat) we are not able to detect if the file is closed.
Can some open suggest some API or oter method for detected when the file is closed.
|
|
|
|
|
Hi,
Some time ago I wrote similiar DMS for some company, but my idea is slightly different than yours.
Instead of passing document directly to the application which is associated as default, you could create another file as temporary with additional parameters (temporary, remove on file close, share read/write), copy content of original file to it, open the file with associated app (don't close its handle).
Pros:
- original file doesn't need to be locked,
- you can track changes,
- you can let user decide wheter the original file should be updated or not,
- you don't have to care about temporary file, unless user closes it,
- you can monitor changes made to that file, by using handle to it.
Cons:
- a bit more code to write, than in simple handle checking
As for your way, there's a nice tool you can use: Sysinternals - Handle (by dumping its output to your redirected standard output).
Regards
|
|
|
|
|
In windows exporer if I open a file say "text.doc" present in "C:\office docs" folder. Now when performing operation lre renaming,moving or deleing that folder in windows will return error.
Can If a folder in windows file systemis locked befor performing these operation programmatically.
Can some one suggest some shell API or SDK function to do the job
|
|
|
|
|
Have a look at the CFile::Open() method. If it returns zero, then the pError parameter in it will have a description of the error.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|