|
Can anyone tell me why i receive right data in case of traditional chinese but not in Simplified Chinese... I'm searching and experimenting "How to display right data in GUI" in case of "Simplified Chinese Character", But nothing seems to work..
So i just need to know why my applications(Non Unicode) is able to display right data in GUI in case of traditional chinese, but not in simplified chinese?
P.S
I'm reading data from text files, which are encoded in UNICODE.
Thanks.
|
|
|
|
|
i want the answer plzzzz
how to display the signal image in VC++
|
|
|
|
|
But... is it URGENTZZZ ?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Please read this[^], especially point 2 and 3, and try to obey them, otherwise, don't expect any usefull answers...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hello, I have got an project to develop Virtual Printer Drivers, I am searching for all the information for the same. We have no previous development experience so I need some points to be clarified whether I am right or wrong
1. Virtual Drivers can be created only using MFC/C++. No need to code for any hardware access.
2. No ready made libraries are available online other than WDM.H
3. Device drivers are totally different than Virtual Drivers, no use of reading about Device drivers.
4. Kernal level programming is needed or not?
Kindly answer if any one knows about the same. I am not able to get any help by Googling.
|
|
|
|
|
My Google skills lead me to that[^].
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Hi all,
I m working on SDI type Application, Here i m Using Mutex to prevent multiple instances of my exe.
i m using this code for mutex.
HANDLE hMutex = ::CreateMutex(NULL, TRUE, _T("_315FrYu76A_GlobalMainMutex__315FrYu76A"));
switch(::GetLastError())
{
case ERROR_SUCCESS:
break;
case ERROR_ALREADY_EXISTS:
return FALSE;
default:
return FALSE;
}
for system tray icon i m taking help of this article.
Adding Icons to the System Tray[^]
My problem is that if application is already running and its in hide mode and icon present in system tray,now when i click on my exe than its not open becoz of mutex.
i want when application is already running or its hide than if i click on exe than the hide application show.
please tell me how can i do this.
if possible please explain me with any example .
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
First store the main window handle somewhere like in the registry so that every other instance can access it. When the CreateMutex returns ERROR_ALREADY_EXISTS , you could check if the main window is visible using IsWindowVisible[^] and show it.
Or
You can have one thread wait on an event handle. When the CreateMutex returns ERROR_ALREADY_EXISTS , just set this event and the thread waiting on the handle can show the window.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Please can u explain me with any example.
please tell me how can i store handle in registry because its in terms of CWnd*.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote:
i want when application is already running or its hide than if i click on exe than the hide application show.
please tell me how can i do this.
if possible please explain me with any example .
One option is to use the FindWindow Function[^] to retrieve a handle to the top-level window of your target application instance. Something like this:
HANDLE hMutex = ::CreateMutex(NULL, TRUE, _T("YOUR_GUID"));
if(ERROR_ALREADY_EXISTS == GetLastError())
{
TCHAR szCaption[MAX_PATH];
LoadString(m_hInstance,AFX_IDS_APP_TITLE,szCaption,MAX_PATH);
CWnd* pwndFirst = CWnd::FindWindow(NULL,szCaption);
if (pwndFirst)
{
CWnd* pwndPopup = pwndFirst->GetLastActivePopup();
pwndFirst->SetForegroundWindow();
if (pwndFirst->IsIconic())
{
pwndFirst->ShowWindow(SW_SHOWNORMAL);
pwndFirst->PostMessage(WM_SYSCOMMAND, SC_MAXIMIZE);
}
if (pwndFirst != pwndPopup)
{
pwndPopup->SetForegroundWindow();
pwndPopup->PostMessage(WM_SYSCOMMAND, SC_MAXIMIZE);
}
}
}
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks its help me ,now its done.
tnaks alot
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Randor wrote: One option is to use the FindWindow Function[^]
That is a bad option because the window caption of the app's window can change (File name added, etc.) or you can run into race conditions when two instances of the app are started almost simultaneously. See Avoiding Multiple Instances of an Application[^] for a complete discription and a proper soloution to this problem.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Hi PJ,
The original poster is not asking how to avoid multiple instances of his application. He has apparently solved this issue with a mutex. The question was how to bring the previous instance of his application to the top.
I respect Dr. Newcomer but many of his articles are written for the Win98 era and some of them are simply outdated and do not apply to recent Microsoft operating systems. See for example:
http://www.codeproject.com/Messages/2455189/Re-How-do-I-prevent-multiple-instances-of-my-program.aspx[^]
Best Wishes,
-David Delaune
|
|
|
|
|
But he does point out the reason why FindWindow() is not an appropriate method to find the first instance of the app. He also illustrates a method using EnumWindows() and SendMessageTimeout() to better accomplish the desired task. That is the reason I linked to his article.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote: But he does point out the reason why FindWindow() is not an appropriate method to find the first instance of the app.
Hi PJ,
You are correct. In retrospect I think Supermans idea of using CreateEvent/SetEvent would be the best option. I just spent the last 15 minutes using WinDbg to step through calls to FindWindow in the user32.dll that shipped with Windows7. It appears that FindWindow has the same behavior as previous versions of Windows in that it results in the call to SendMessageW which could potentially result in a deadlock.
PJ Arends wrote: He also illustrates a method using EnumWindows() and SendMessageTimeout() to better accomplish the desired task
I have reviewed his code and determined that it does not handle modality. His code should call GetLastActivePopup or ShowOwnedPopups. Even this technique has some disadvantages...
Superman's idea is superior in every respect. It would allow the previous instance to respond to the event and activate its own windows.
Thanks for your comments PJ!
Best Wishes,
-David Delaune
|
|
|
|
|
Recently,I'm learning how to make custom UI,by using BitBlt() put some bitmap to DC.When comes to 'Compatible DC' and 'Compatible Bitmap',i'm confused about codes as follows:
codes in function OnPaint():(VC++)
CDC memDC,tempDC;
CClientDC dc(this);
CBitmap memBmp;
CRect rcClient;
GetClientRect( &rcClient );
memDC.CreateCompatibleDC( &dc );
tempDC.CreateCompatibleDC( &memDC );
memBmp.CreateCompatibleBitmap( &dc, rcClient.Width(), rcClient.Height() );
tempDC.SelectObject( &m_bmp ); //(assume the m_bmp is a initial CBitmap ojbect)
memDC.SelectOjbect( &memBmp ); //First
memDC.BitBlt( p1,p2,..., &tempDc,...., SRCCOPY ); //Second
dc.BitBlt( p1,p2,......, &memDC,....., SRCCOPY ); //Third
//code end
I know how to use these codes but i don't why it does.
1.From codes i marked "First" and "Senond",I wonder if SelectObject( &memBmp ) only gives memDC's data member a value and BitBlt gives memDC something to display? if this why to use SelectObject()?
2.Codes marked "second" and "third". From "second" codes it use &tempDC as its parameter, but tempDC just only used SelectObject( &m_bmp ),i means it doesn't use BitBlt to disply somethig ,why it can be "BitBlt"
to memDC?
From "third" codes,dc's BitBlt use memDC as its parameter,and it executed BitBlt before.So I think this code is correct( but i know all these is correct haha...).
So i wonder,does the process "BitBlt" copys the SrcDC's disply things to DestDC,or copys the SrcDC's Bitmap object(been valued in SelectObject() )to DestDc to display?
My mother language is not English,and my english level is very lower(Sorry).I don't know if someone can understand my means.
I hope all of you gives me some advice,thank you!
this is the first time i asked question in this haha...
|
|
|
|
|
DC is a reference to the screen. CreateCompatibleDC() creates an area in memory that is the same as your screen (by 'same' i mean: if you use 16M colors each pixel on screen is 24 bits = 3 bytes, CreateCompatibleDC() will make the area in memory the same pixelsize) Notice CreateCompatibleDC() has no width and height parameter, so your compatible DC is initially 1 by 1 pixel big (!). CreateCompatibleBitmap() creates an area in memory that has the same pixelsize as the original bitmap. SelectObject() is needed to make the compatible DC the same size as the bitmap. Bitblt() copies one area of memory to another, where the screen itself is also an area of memory.
In your code you have:
1 DC
2 compatible DC's (tempDC and MemDC)
1 bitmap (m_bmp)
1 compatible bitmap (membmp)
Hope with this you can figure out our code
Rozis
|
|
|
|
|
thank you!I think i understand the compatible bitmap and compatible Dc more than before.
|
|
|
|
|
My Setup Module creates a New Proprietary Database Folder, populated with New or Default Entries. The location is by default: "C:Program Files\ MyCompany\Data" I do not place the folder in "...MyDocuments", because the individual files do not make sense on their own, and should only be accessed and modified by the bespoke software I wrote. Has anyone any code snippet which will force this new folder to be shared by all network users, and full Security Access by All Users. (i.e. Remove ALL this unwanted Protection)
Regards,
Bram van Kampen
|
|
|
|
|
|
transoft wrote: I want the class B' funct() to be called. But it did not get called.
Aside from syntax errors (see #5 here), your code does exactly what you want. Why are you saying that B::funt() is not being called?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
It appears that "standard" CTreeView message TVN_SELCHANGED is send twice - on mouse button down and mouse button up. In my initial case on key down I can retrieve the root node text and then on key up I get the selected node text.
Do I have to keep track of previous and current node myself or is there another way to get just the current selected node (text) ?
I tried to use TVN_SELCHANGING but despite the MSDN description of this message the LPTSTR pszText item in NMTREEVIEW structure contains garbage and not the text info about the node.
Thanks for reading. Any constructive help as always is appreciated.
|
|
|
|
|
Try this,
NMTREEVIEW* pnmtv = (NMTREEVIEW*) pNMHDR;
CTreeCtrl& tc = GetTreeCtrl();
HTREEITEM item = pnmtv->itemNew.hItem;
CString Tree_str=tc.GetItemText(item);
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
What you have suggested is just another way to get the node string.
The message is still posted twice and I get the old (or root if it is a first change) and then the new selected one. I guess I will set flag or static counter to ignore the first one (I don't need it)
Kind of gross!
Thanks for you help.
Cheers Vaclav
This explains why the new selection gets highlited on mouse button down and the old selection gets a funky rectangle around it! I just did not see that while stepping thru the code!
modified on Saturday, August 8, 2009 6:26 PM
|
|
|
|