|
ThatsMe. wrote: its urgent
That is considered rude on this site.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi all,
I want to convert CString to WCHAR;
i have done this:-
WCHAR wsz[MAX_PATH];
CString szLinkName = _T("Test Mail");
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)(LPCTSTR)szLinkName, -1,
wsz, MAX_PATH);
but i only get "T" in wsz i.e first element....
I am working in VC2005
Can anybody help me in this...
Thanks in advance
|
|
|
|
|
This is the Gabababazillionth time this question is asked. Please learn to use Google[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
neha.agarwal27 wrote: MultiByteToWideChar(CP_ACP, 0, (LPCSTR)(LPCTSTR)szLinkName, -1, wsz, MAX_PATH);
how and why do you decided to use MultiByteToWideChar here?
|
|
|
|
|
Why do it the hard way when there are macros in ATL to do it for you.
#include <atlconv.h>
void MyFunc(WCHAR* s)
{
USES_CONVERSION;
CString str = W2T(s);
}
Just make sure you don't use W2T() in a loop since it allocate memory from the stack.
then use W2T_EX instead and USES_CONVERSION_EX;
|
|
|
|
|
neha.agarwal27 wrote: but i only get "T" in wsz i.e first element....
How are you verifying this?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Google for ipaudit.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
i see ipaudit in google but havn't get ans..?Do you give function or method name?
|
|
|
|
|
What do you mean you did not get an answer? Ipaudit is an opensource software which does what you were looking for.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Do you give me exame link?Becouse i didn't get from google Ipaudit .
|
|
|
|
|
mirtu wrote: me exame link
What is an exame link? Anyways, IpAudit[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
This is puzzling indeed...
Considering that nobody can be that stupid (not being able to google for a simple word), maybe googling from India returns similar nonsense as some of the questions on this board?
|
|
|
|
|
Cranky wrote: maybe googling from India returns similar nonsense as some of the questions on this board?
Not really. I am Googling from India too and I get excellent results.
PS: I did not down-vote you. I've balanced it with a 5 vote.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Well, I wasn't serious.
Thinking about it, it seems that he is simply to lazy to read through the documentation and just needs a quick "fix" for his problem.
|
|
|
|
|
If I have Excel open with multiple documents inside (as an MDI) like this[^], is there a way to get the title of the active child window (or document window) inside? For example, in that screenshot, I'd want "Book3". I can get the names of all child windows using EnumChildWindows, but I don't know how to find out which one is currently active.
A few things I've tried...
- childWindow.isWindowEnabled() returns true for all child windows.
- GetForegroundWindow(..) just gives me "Microsoft Excel".
- fgwin.GetTopLevelFrame(..) gives me nothing.
- CFrameWnd::GetActiveDocument() access to the CFrameWnd object.
Your help will be most appreciated. If it's not obvious, I'm fairly new to Win32 programming.
|
|
|
|
|
Use Excel Automation.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you for reply. That is a tempting solution, as it seems that MS Office is the only app that I personally use as an MDI in this way. However, for the sake of other users and unforseen uses of my software, it really should work correctly with any application (MDI or otherwise) that happens to be running. The project I'm building will monitor the time the user (currently me) spends on different projects. It will be similar to TimeTracker, but with a different UI and different set of features. The problem is frustrating because I can get the title of all child windows, but I know of no way to tell which one is the active one. This should be easy, right? Let me rephrase my question.
If I have a handle to all of the child windows in an arbitrary MDI application, how can I tell which one is active?
At the very least, this should work for Excel, Word, Acrobat, and preferably other MDIs like OpenOffice and Opera.
Sorry I didn't make this clear enough. I was trying to keep it brief, but I'm never sure what information to include and what to leave out.
Thanks!
|
|
|
|
|
Have you tried GetTopWindow() or GetForegroundWindow() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
For all good reasons, you must go with automation, as David already stated.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi,
I have a CListCtrl set to LVS_EX_FULLROWSELECT style.
Using the mouse to create a multiple selection in a list control only seems to work when you select from the empty space in the first column.
Is there an easy way to allow multiple selection from anywhere inside the list control?
|
|
|
|
|
AORD wrote: Using the mouse to create a multiple selection in a list control only seems to work when you select from the empty space in the first column.
It seems you are using Report view, but normally multiple(or single) selection is possible on any item except the empty space. Please explain?
|
|
|
|
|
|
I just run the demoproject with not even building it, it runs fine in my system, I can multiselect clicking on any item in any column, only the empty space next to time column is not possible.
AORD wrote: There must be an easy way allow a mouse drag selection from anywhere in the other populated columns?
Drag and Drop between and within a CListCtrl[^]
|
|
|
|
|
Running the DragTest.exe (not building) I can only multi select with the mouse on the blank areas, this includes the blank area in the word column, BUT not the blank area in the index column.
If you can and I can't multi select with the mouse on all of the populated columns it must be the windows file that contains the ClistCtrl?
What version of windows are you running? I'm using XP.
___________________________
Here come the machines!
|
|
|
|