Click here to Skip to main content
15,914,111 members
Home / Discussions / Mobile
   

Mobile

 
AnswerRe: Is it possible to run java programs on Windows CE ? Pin
Joel Ivory Johnson19-May-09 6:17
professionalJoel Ivory Johnson19-May-09 6:17 
AnswerRe: Is it possible to run java programs on Windows CE ? Pin
mysparkle22-May-09 9:17
mysparkle22-May-09 9:17 
QuestionHow to Exit from Windows Mobile Application .Application.Exit() is not fruitful Pin
HemaLathaIvvala19-May-09 0:09
HemaLathaIvvala19-May-09 0:09 
AnswerRe: How to Exit from Windows Mobile Application .Application.Exit() is not fruitful Pin
Joel Ivory Johnson19-May-09 6:18
professionalJoel Ivory Johnson19-May-09 6:18 
QuestionA problem about create virtual shared folder in pocket pc vs 2005 Pin
nvphap18-May-09 22:40
nvphap18-May-09 22:40 
QuestionJava code executing on mobile, sent as SMS Pin
de.w18-May-09 19:07
de.w18-May-09 19:07 
Questionconvertion of xls file into csv file. Pin
ujjawal kumar18-May-09 18:35
ujjawal kumar18-May-09 18:35 
QuestionDisplaying bitmap and SetDIBitsToDevice..... Pin
Episodio118-May-09 14:22
Episodio118-May-09 14:22 
Hi! I'm new into drawing with Visual C++ MFC.

I've got an empty DIALOG where I load a floor layout (BMP resource) and I want to draw on it a dot indicating my position (using "SetDIBitsToDevice")

I call "Invalidate()" in another function when I get new coordinates to print on screen. Problem is that my PocketPC freezes every 3rd-4th time I run this function.

As I cannot borrow another PDA from anyone for now I would like to know if code is all right, or if there is any tricky command I'm using.



void CDisplayDlg::OnPaint()
{
	CColoredDlg::OnPaint();  // My dialog is based on a superior class (ColoredDlg), so I run first its Paint.

	//Code to display layout
	HBITMAP	hBmpL1=::LoadBitmap(AfxGetResourceHandle(),
              MAKEINTRESOURCE(IDB_DISPLAY_BITMAP));                       
	CRect rc;
	this->GetClientRect(&rc);
	HDC hdc1 = ::GetDC(this->m_hWnd);
	HDC hdcmem = ::CreateCompatibleDC(hdc1);
	::SelectObject(hdcmem,hBmpL1);

	::BitBlt(hdc1, rc.left, rc.top, rc.right, rc.bottom,
                    hdcmem,0,0,SRCCOPY);
	
	BITMAPINFO BitmapInfo;
	BitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);

// GetDIBits for WinCE
	CWinCEUnsupportedFunctions::GetDIBits(hdcmem, hBmpL1, 0, 0,
                    NULL, &BitmapInfo, DIB_PAL_COLORS);   


//Code for displaying the current location of the user 

	BYTE* pBitData = new BYTE[36];
	for(int i=0;i<36;i++)
	{
		pBitData[i]=8;
	}
	scale=3.3;

	if(numPositions==1)
	{
              ::SetDIBitsToDevice(hdc1, (int)(xcoord1*scale), (int)(ycoord1*scale),
                       6, 6, 0, 0, 0, 6, pBitData, &BitmapInfo, DIB_PAL_COLORS);
         }

	delete pBitData;
	
}


Thanks!
AnswerRe: Displaying bitmap and SetDIBitsToDevice..... Pin
slumberparty19-May-09 2:15
slumberparty19-May-09 2:15 
GeneralNope... same happens... Pin
Episodio119-May-09 7:39
Episodio119-May-09 7:39 
GeneralFIXED.SetDIBitstoDevice was causing problems. Pin
Episodio120-May-09 6:59
Episodio120-May-09 6:59 
QuestionKsoap2 - how to send byte[] present in custom class Pin
gittu12318-May-09 0:59
gittu12318-May-09 0:59 
QuestionA problem when I show help file in pocketpc Pin
nvphap17-May-09 22:03
nvphap17-May-09 22:03 
QuestionHow to get thread's handle in mobile 6.1 , Not the current thread's handle. Pin
torinoyuan17-May-09 21:53
torinoyuan17-May-09 21:53 
QuestionA problem about show help file in pocket pc Pin
nvphap17-May-09 6:45
nvphap17-May-09 6:45 
AnswerRe: A problem about show help file in pocket pc Pin
Joel Ivory Johnson17-May-09 10:28
professionalJoel Ivory Johnson17-May-09 10:28 
GeneralRe: A problem about show help file in pocket pc Pin
nvphap17-May-09 19:21
nvphap17-May-09 19:21 
GeneralRe: A problem about show help file in pocket pc Pin
Joel Ivory Johnson18-May-09 12:28
professionalJoel Ivory Johnson18-May-09 12:28 
QuestionHow to use Datagrid in Right-to-left (Like Hebrew or Arabic language) Pin
E_Gold16-May-09 0:23
E_Gold16-May-09 0:23 
QuestionHow to send SMS to multiple recipients? Pin
Zeng_Zeng15-May-09 1:55
Zeng_Zeng15-May-09 1:55 
AnswerRe: How to send SMS to multiple recipients? Pin
Joel Ivory Johnson17-May-09 10:25
professionalJoel Ivory Johnson17-May-09 10:25 
GeneralRe: How to send SMS to multiple recipients? Pin
Zeng_Zeng17-May-09 16:23
Zeng_Zeng17-May-09 16:23 
AnswerRe: How to send SMS to multiple recipients? Pin
Jabbar_espania18-May-09 23:10
Jabbar_espania18-May-09 23:10 
QuestionSound emission with duration and frequency control Pin
slugger66613-May-09 6:59
slugger66613-May-09 6:59 
AnswerRe: Sound emission with duration and frequency control Pin
Joel Ivory Johnson14-May-09 6:41
professionalJoel Ivory Johnson14-May-09 6:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.