|
I thought of trying my hand at implementing Unicode,
but I noticed that file classes(CFile, fstream) don't accept unicode strings for filenames.
How do I get this problem solved?
|
|
|
|
|
In most cases we have functions that support UNICODE. For example, CreateFile for file operations, CStdioFile class for text files. If function/class we need doesn't support UNICODE, we convert it's parameters by the following way (suppose that SomeFunction(char*) hasn't UNICODE version):
#include "atlbase.h"
// ...
USES_CONVERSION; // ATL string conversion macro
TCHAR s[100];
// fill s ...
#ifdef _UNICODE
SomeFunction(W2A(s)); // convert WCHAR* to char*
#else
SomeFunction(s); // direct call - TCHAR is char without UNICODE
#endif
|
|
|
|
|
Thanks! W2A saved the day
|
|
|
|
|
Hi!
How do i make a screensaver like the 3D-pipes in Windows with GDI+?
Thanks!
|
|
|
|
|
i guess you need to see articles in OpenGL and graphics part of the VC. There you can get some help for drawing. after which you just have to write some routines to handle.
cheers.
Himanshu
|
|
|
|
|
Thanks for your help, but i didn´t want to know how to write it using opengl.
I want to write it using GDI+ and i couldn´t find any info so far.
Greetings from Austria!
|
|
|
|
|
hi,
I have source code of a MFC application .it run well,but not support Unicode,i want it to support.
i add "UNICODE,_UNICODE" to Project/Settings/C++/Preprocessor,and add "wWinMainCRTStartup" to"Project/Setting/link/Category output/Entry "
it successful compile and link,but can't run:the "plaese specify the executable file" dialog-box shown(like compile a dll).how i can do it well?
|
|
|
|
|
Hi all code project members...
i new in VC++ programming...i have a problem to convert a string of hex value such as "E302" to the hex number such as oxE302...
i used the wcstol(...) but i seen not work....
Thankz in advance
Rgds
:_Rocket_:
|
|
|
|
|
DId I understand you correctly, you want to convert hex E302 to a long-integer value? (coz that's what wcstol does)
wcstol input syntax is [whitespace] [{+ | ?}] [0 [{ x | X }]] [digits]
You need to give the "E302" string to the function as "0xE302".
------------------------------------------
Experience is the name every one gives to their istakes. -Oscar Wilde
Experience is one thing you can't get for nothing. - Oscar Wilde
|
|
|
|
|
Hello!
I have 2 problems.
1) I have a context menu that are created within a program. The problem is that I can't access it through the contextmenu button on a keyboard. Is it possible to do that with a dynamic menu that is created in MainFrm?
2) How do I find the local administrator acounts from a program? We have an option in wich you can add UID and PW to the program to restrict its use. I would like it to always be accesible from the administrator account on the löocal computor. In other words I would like the program to automatically add the Admin acount.
/Martin
|
|
|
|
|
1) react on the WM_CONTEXTMENU message, or use the WM_RBUTTONUP message.
2) get the token and ::CheckTokenMembership(). Or use the lately documented IsUserAdmin() [or so], look up on MSDN.
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
The WM_CONTEXTMENU and WM_RBUTTONUP messages only respond to the mouse and I need it to respond to the context menu button on your keayboard. Anyways I found WM_KEYDOWN adn WM_CHAR to do that for me.
CheckTokenMembership() only lets me check if the current user is an administrator. IsUserAdmin is a method on MSDN that does just that. I need to get the Administrator acount. Maby that is not possible...
/Martin
|
|
|
|
|
Hi,
When I clicked on CDateTimeCtrl drop down arrow it shows
me Month calendar, when I do select date or cancels on
calendar control, focus gets dissappear. Now if I press
tab the focus goes to next subsequent control and when
come back to the same CDateTimeCtrl control th'r tab, it
doesn't get selected.
Anybody of you even encounter this, or do anybody of know how to resolve this?
I tried to the code like
void CMyFormView::OnCloseupDate(NMHDR* pNMHDR, LRESULT* pResult)
{
TRACE(_T("StartDate DateTimePicker\n"));
CDateTimeCtrl *dt = (CDateTimeCtrl *)GetDlgItem(IDC_START_DATE);
if(dt->m_hWnd != NULL)
{
::PostMessage(dt->m_hWnd, WM_KEYDOWN, VK_RIGHT, 0);
}
/*if(pNMHDR->hwndFrom != NULL)
{
::PostMessage(pNMHDR->hwndFrom, WM_KEYDOWN, VK_RIGHT, 0);
}*/
*pRes = 0;
}
But this doesn't solve my problem. This logic fails sometimes. So
anybody of you can explain how to resolve this problem?
I had submitted the bug to Microsoft.
But I want the workaround. With the following logic
(sending message in message queue by PostMessage() shown
in below posted message) I'm able to select the date
inside the CDateTimeCtrl. But sometimes this logic fails.
The reason for that is my application messge queue is big,
and if the focus goes to Tree Control and there I'm
handling PreTranslateMessage() where it crashes the
application. Or sometimes the date in other CDateTimeCtrl
gets selected (even though I'm using pNMHDR->hwndFrom
handle of the CDateTimeCtrl)
So does anybody of you know any workaround for selecting
the date inside the CDateTimeCtrol after embeded Month
contol has colsed?
Thanks & Regards,
- Vijay
God is Great
|
|
|
|
|
dear all,
can i execute batch files and shortcuts using CreateProcess (...) api function?
Also if batch files can be executed, will the commands in the batch files (.exe) get access permission if the batch file is having access permission if i use CreateProcessAsUser with administrator credentials.
and is the same valid for shortcuts!
can anyone show some light!
<marquee>rishabhs
|
|
|
|
|
|
ShellExecute(...) ?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
:-OShellExecute () is obviously a good option but i am not sure about your problem. whether it can be solved thru this or not because i haven't worked on batch files. but you can give it a shot..all the best..
cheers
himanshu
|
|
|
|
|
xxhimanshu wrote:
but i am not sure about your problem
Me?
I don't have a problem.
rishabhs had one.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Yes it is possible, but you may need use the following syntax
cmd.exe /c D:\Utils\GetIP\PostIP.bat
Where cmd.exe if found by, in a "DOS", box typing:-
echo %comspec%
|
|
|
|
|
Hi
I've made a service which listens at a particular port for any requests coming from IE, and when i get the request
I want to send some specific message to be displayed in html format by IE in order to do that I made following
HTTP response header
aString = "POST / HTTP/1.0\r\n\r\n";
aString += "Accept: image/gif, *.*\r\n";
aString += "Accept-Language: en\r\n";
aString += "\r\n";
aString += "User-Agent: MyAgent \r\n";
aString += "\r\n\r\n";
aString += " Hello, World. \r\n\r\n";
but something is going wrong and IE is unable to understand the response.
Can anyone help me correct the problem ?
Ciao
- Nilesh
|
|
|
|
|
The header that you are using is HTTP request header, that must be sent from client(WebBrowser) to server(WebServer).
The HTTP response header, that is sent back from server to client, should have format like this.
----------------------------------------------------
HTTP 1.0 200 Document follows
MIME-version: 1.0
Server: CERN 3.6
Date: Thursday, 13 June 96 12:30 GMT
Content-Type: text/html
Content-Length: 2103
Last-Modified: Wednesday, 12 June 96 23:53 GMT
...
----------------------------------------------------
* copy from [http://www.cs.sfu.ca/cs/undergrad/CourseMaterials/CMPT365/material/slides/A10.html]
You can study HTTP protocol from http://www.w3.org/
|
|
|
|
|
You should give it a tag name, such as : Accept: image/gif
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
I want to monitor the packets passing through my Network Card using winsock2.
Please if you can help me in doing so?
boby12
|
|
|
|
|
winsock can not snatch the packet, you should try IP protocol
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Hi,
I have recently learned VC++ and am looking to contribute towards VC++ projects for free. This would help me get some experience in real life projects, please do not hesitate to contact me at tiglic_acid@yahoo.ca .
Appreciate it. Thanks
/TA
|
|
|
|