|
> Also, do you need to do this?
> card.CreateCompatibleBitmap(&tempdc,29,41);
> I would think that it destroys the bitmap you loaded into it earlier.
Yes, what I'm trying to do here is overwrite whatever bitmap I drew previously with a new one from outside the OnPaint handler. This seems like the right thing to me.
Changing my call to tempdc.CreateCompatibleDC() doesn't appear to help - But it doesn't appear to break anything either.
-nand
|
|
|
|
|
Ok, let me rephrase myself
void CChildView::ShowKing(int facing) {
CPaintDC dc(this); // device context for painting
CDC tempdc;
CBitmap card;
if ( facing == 1 )
card.LoadBitmap(IDB_KINGRIGHT);
else
card.LoadBitmap(IDB_KINGLEFT);
card.CreateCompatibleBitmap(&tempdc,29,41);
// here you create a bitmap that is comaptible to an unintialized dc (ie a monocrome dc), and my guess is that you also overwrite whatever bitmapbits you loaded into the CBitmap object.
tempdc.CreateCompatibleDC(&tempdc);
// this should be done before you create a compatible bitmap.
tempdc.SelectObject(&card);
dc.BitBlt(113,3,14,16, &tempdc,0,0,SRCCOPY);
}
This should work better. If not, check your return value from LoadBitmap.
void CChildView::ShowKing(int facing)
{
CPaintDC dc(this); // device context for painting
CDC tempdc;
CBitmap card;
if ( facing == 1 )
card.LoadBitmap(IDB_KINGRIGHT);
else
card.LoadBitmap(IDB_KINGLEFT);
tempdc.CreateCompatibleDC(&dc);
tempdc.SelectObject(&card);
dc.BitBlt(113,3,14,16, &tempdc,0,0,SRCCOPY);
tempdc.RelaseDC()
dc.ReleaseDC()
}
Note: untested code, I dont have a dev.env. on this computer.
---
"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
|
|
|
|
|
It doesn't help.
I tried a few more things and found that if I hide and then activate the application, the bitmap is redrawn as expected. Also if I display a messagebox, move it paritally over the bitmap, and dismiss it, the covered part will be updated - but not the uncovered part. It sounds almost like it's refusing to update the window, even though I'm painting in it. Does this help?
-nand
|
|
|
|
|
Okay, I managed to figure out a workaround.
The solution was to create a Document-View application (even though I don't want any Document baggage), put all this stuff in the View, and then have a function in the Document that calls CDocument::UpdateAllViews(NULL).
See this MSDN article
Thanks for the help though!
|
|
|
|
|
Hi all
The context menu is hooked to a few controls (buttons etc). When I have pop-up event, I want to know which control calls this event? The SourceControl property doesn't work in CF. I need to act differently depending on control.
How can I do it?
|
|
|
|
|
Perhaps someone can help me... How do I get a drive mapping to work between a Windows 2000 professional machine and a WindowsCE.NET 4.2 machine? This is really bugging the hell out of me. I have build an OS image with, as far as I know, everything in it to support this but I cannot get it to work. I have added the appropiate registry keys in SMBServer and it just wont work. Pinging between the two machines works so there is communication between the machines but I cannot map a drive or folder no matter what I try. Am I missing something?
We are the all singing, all dancing crap of the world. - Tyler Durden
|
|
|
|
|
Hi, guys!
I am using IR port on pocket pc to communicate with other device.
When I used emulator on desktop, it can work correctly.
But I use it on real pocket pc, what the routine gets from IR port is error code, such as 255 instead of ACII code. But via Hperterminal monitoring, the monitor display correct ACII code.
Why it happened? You know the sourcecode running on emulator and real Pocket PC is same. So do you think I should do some configurations on the IR port via code? If so, and how?
Thanks a lot
vigorous
|
|
|
|
|
if i use eVc++ 4.0 with sp4 - it means that i can develop for WinCe.net 4/4.1/4.2/5.0 or it is just for WinCe 4/4.1/4.2/5.0?
Thanx,
Eli
|
|
|
|
|
Okay, i'm having a big problem here, i use the CreateWindowEx() function to create a child window. It then uses a SetWindowPos() function to resize it, and then it creates a button on it. When the button is pressed on the child window, i want it to completely be destroyed, so it sends a message to its parent to destroy it. The thing is....i have to put 3 DestroyWindow() functions or else i will have to click the button three times. I don't know why. I don't know if i'm creating the child 3 times, or what i'm doing wrong....
my small snippets of the problematic code is here:
http://rafb.net/paste/results/8n1br319.html
my FULL program is here incase you need to see other code.
SecurityCamera.c (line 362):
http://rafb.net/paste/results/gcInkQ62.html
WelcomeWindow.h:
http://rafb.net/paste/results/jI5cLF32.html
|
|
|
|
|
Can i use 'Visual C++ Express 2005', or 'Visual C++ .Net 2003' to make windows mobile applications on a Pocket PC?
Thanks in Advnaced
|
|
|
|
|
I don't know about 'Visual C++ Express 2005',but with 'Visual C++ .Net 2003'
you can.
Just choose: c# projects->smartphone project.
Eegards,
Eli
|
|
|
|
|
we have created a small pocket pc app with c# with vs.net2003
when installed on our previous compaq ipaqs it all worked fine.
when now installing the same app on our newer HP ipaq rz1710 i get the warning :
the program you have installed may not display properly because it was designed for a previous version of windows mobile software
can i fix this in vs.net?? can i compile for some other processor or anyone know whats wrong?
//Roger
|
|
|
|
|
Hi,
i want to set up Bluetooth connection between my PDA and another Bluetooth device.
I'm trying to use these function:
WSALookupServiceBegin(),WSALookupServiceNext(),WSALookupServiceEnd()
but i always gets LNK2019 error(unresolved externak simbol).
Before ur going to ask - yes,i've imported "WS2.Lib" and included "winsock2.h".
I'm using "Embedded visual c++ 4",with SP3(for WCE.net 4.0/4.1/4.2).
I forgot to say that the same code working just fine with visual c++,
but i need to write an application for PocketPC.
If there is some bug,or something else iwm doing wrong,
please let me know.
Best regards,
Eli
|
|
|
|
|
Unfortunatly these funcs are not supported on embedded environment..
From MSDN:
Client: Requires Windows XP, Windows 2000 Professional, Windows NT Workstation 3.51 and later, Windows Me, Windows 98, or Windows 95.<br />
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 3.51 and later.<br />
as you see no embedded...
Greetings,
Davy
|
|
|
|
|
Hi Davy,
Are you sure?
I think MSDN does not include help for evc++,because in the help of evc++,
i read that these functions required WS2.lib and winsock2.h files.
I have 1 more question:
if i can't use these functions - is there another way doing it?
Best regards,
Eli.
|
|
|
|
|
Ok I am sorry...
I was mistaken before. I am still working on some older platforms most of the time so I did not know this. Apparantly Bluetooth functions are supported from
WINDOWS CE.Net 4.0 and later
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcebluet/html/ceconbluetoothfunctions.asp[^]
for the WSALookupServiceBegin the requirements are
OS Versions: Windows CE .NET 4.0 and later.<br />
Header: Bt_api.h.<br />
Link Library: Btdrt.lib.<br />
<br />
Hope this will help you,
sorry for my wrong info earlier.
Greetings,
Davy
|
|
|
|
|
Hi again,
First,thanx for the quick answer.
Are you sure that the Link Librarry is Btdrt.lib?
Because in my "eVc++ help" it seems to be Ws2.lib.
Also,its required "winsock2.h"(and not "Bt_api.h").
Anyway,i've included both "winsock2.h" and "Bt_api.h" and imported
Ws2.lib(i don't have Btdrt.lib on my computer).
What i'm doing wrong?
Do you have code example (on Bluetooth) that worked?
Thanx,
Eli.
|
|
|
|
|
Hi,
I am just starting a project in EVC4. I have designed a dialog but when I download it to the target (iPAQ1945) the buttons and static text areas have lost their 3D effects, the background is white instead of grey and the font is to large and will not fit in the areas?
Any ideas what I'm doing wrong anyone?
Many Thanks,
Ali
|
|
|
|
|
Alison Pentland wrote:
Any ideas what I'm doing wrong anyone?
You are doing nothing wrong.
The Pocket PC dropped the 3D look and adopted a flat look. The dialog background is also white by default. You are being misled by the development environment, that's all.
For dialogs, as well as for the rest of the application, you should use the Tahoma 8 font, with occasional bolds.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Hi
I am using an window CE device to connect to an internet server of Port 1001 and 1005 uisng those wininet API provided. The 2 ports is needed as one is from normal TCP/IP communication and the other one is for keep alive packets.
just wonder if this can be done. i try it out on PC and it seems ok.
Any help will be apprecaited
|
|
|
|
|
Hi, I use DoModal() to open a Dialog in a Dialog-Based project. In the main OnInitDialog I hide the SIP button, and when I use DoModal() to open a second Dialog, the SIP continues hide, but when I close the second Dialog, the SIP button and the bar appears in the Main Dialog. Is it possible to execute OnInitDialog again to hide the bar? Or exists another way for doing it?
Thanks in advance.
Regards,
Javier
|
|
|
|
|
Your dialog window receives a WM_ACTIVATE message when it is shown.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Ok, initially for a dialog this message doesn't appear in the ClassWizard. I put a message handler in the *.cpp.
Is this the way?:
void CFullScreen2Dlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) <br />
{<br />
CDialog::OnActivate(nState, pWndOther, bMinimized);<br />
<br />
<br />
}
I test in this way and it's not right. Can you help me?
Thanks.
Regards,
Javier
|
|
|
|
|
Did you write an entry on the message map?
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
I repass it and it's works, thanks!. Is there a easy way to hide the below bar (where the SIP button is) in all the application? I suppose at the beginning...I try it in many ways and wrong...
It's better than I hide this bar in each "Activate Message"...
Regards,
Javier
|
|
|
|