the tablet
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0359_01CD29C8.8C4F7CF0"
This is a multi-part message in MIME format.
------=_NextPart_000_0359_01CD29C8.8C4F7CF0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
The two operations aren't the same. In your working version you are
referencing the TextBox "handle" first before you get the data. This is
different to retrieving the pointer to the TextBox, which is why your
second version doesn't work.
From: Charles Petzold
Sent: 04/05/2012 12:36
To:
wpf-di...@googlegroups.com
Subject: Re: [WPF Disciples] are you guys doing windows 8 dev straight
on the tablet
I'm using the tablet I got at Build. It's basically a Samsung 700T,
but I don't think it's exactly the same as something they sell
commercially.
I use it in the docking port mostly, with an external 1920 x 1080 HDMI
display, and also with a little USB hub I got at Staples so I can
connect an external keyboard and mouse.
Sometimes it gets a little mixed up, and I get the Metro start screen
on the big monitor, but mostly Visual Studio runs on the big screen
and the Metro apps run on the tablet. It's a great setup, and the
tablet runs VS just fine.
The first 7 chapters of "Programming Windows," 6th edition are coming
out in a couple weeks, but I've been spending the past week converting
all the C# code from these chapters into C++/CX. This is not
something I'd recommend to someone who's been doing C# programming for
a decade! Although you're accessing the same WinRT Windows.*
namespaces as in C#, you don't have access to the System.* namespaces.
In compensation you're using Platform.* namespaces and C runtime
libraries. You're using a different String class, for example, which
is basically a light wrapper on a const wchar_t*.
This morning I had to write a low-level C++ routine to mimic the
Byte.TryParse method, which is bad enough, but I was getting the text
out of a TextBox and in the process, I discovered that
String^ text = txtbox->Text;
const wchar_t* str = text->Data();
works fine -- Data is the method defined on the C++/CX String class
that exposes the C++ character pointer -- but this code returned a
pointer to junk:
const wchar_t* str = txtbox->Text->Data();
I'm sure some C++ maven can explain why this happens, but I'm
befuddled (and I hate C++ more than ever).
Charles
From: Marlon Grech
Sent: Friday, May 04, 2012 5:46 AM
To: wpf-disciples
Subject: [WPF Disciples] are you guys doing windows 8 dev straight on the tablet
Hey guys,
This weekend I am planning on a Windows 8 geekiness weekend... do you
guys use the tablet directly to write windows 8 code or is there some
trick I should know of ?
Regards
Marlon
WPF Blog -
http://marlongrech.wordpress.com/
MEFedMVVM -
http://mefedmvvm.codeplex.com
------=_NextPart_000_0359_01CD29C8.8C4F7CF0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
<html><head><meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Cont=
ent-Type"></head><body><div><div style=3D"font-family: Calibri,sans-serif; =
font-size: 11pt;">The two operations aren't the same. In your working versi=
on you are referencing the TextBox "handle" first before you get the data. =
This is different to retrieving the pointer to the TextBox, which is why yo=
ur second version doesn't work.<br><br><br><br></div></div><hr><span style=
=3D"font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: bold;">Fr=
om: </span><span style=3D"font-family: Tahoma,sans-serif; font-size: 10pt;"=
>Charles Petzold</span><br><span style=3D"font-family: Tahoma,sans-serif; f=
ont-size: 10pt; font-weight: bold;">Sent: </span><span style=3D"font-family=
: Tahoma,sans-serif; font-size: 10pt;">04/05/2012 12:36</span><br><span sty=
le=3D"font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: bold;">=
To: </span><span style=3D"font-family: Tahoma,sans-serif; font-size: 10pt;"=
>
wpf-di...@googlegroups.com</span><br><span style=3D"font-family: Tahom=
a,sans-serif; font-size: 10pt; font-weight: bold;">Subject: </span><span st=
yle=3D"font-family: Tahoma,sans-serif; font-size: 10pt;">Re: [WPF Disciples=
] are you guys doing windows 8 dev straight on the tablet</span><br><br></b=
ody></html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 9.00.8112.16443"></HEAD>
<BODY style=3D"PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"=
=20
id=3DMailContainerBody leftMargin=3D0 topMargin=3D0 CanvasTabStop=3D"true"=
=20
name=3D"Compose message area">
<DIV><FONT face=3DCalibri>I'm using the tablet I got at Build. I=
t's=20
basically a Samsung 700T, but I don't think it's exactly the same=
as=20
something they sell commercially.</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri>I use it in the docking port mostly, with an exte=
rnal=20
1920 x 1080 HDMI display, and also with </FONT><FONT face=3DCalibri>a =
little=20
USB hub I got at Staples so I can connect an external keyboard and=20
mouse.</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri>Sometimes it gets a little mixed up, and I g=
et the=20
Metro start screen on the big monitor, but mostly Visual Studio runs on the=
big=20
screen and the Metro apps run on the tablet. </FONT><FONT=20
face=3DCalibri>It's a great setup, and the tablet runs VS just fine.</FONT>=
</DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri>The first 7 chapters of "Programming Windows," 6t=
h=20
edition are coming out in a couple weeks, but I've been spending the past w=
eek=20
converting all the C# code from these chapters into C++/CX. This=20
is not something I'd recommend to someone who's been doing C# programm=
ing=20
for a decade! Although you're accessing the same WinRT Windows.*=20
namespaces as in C#, you don't have access to the System.* namespaces. =
; In=20
compensation you're using Platform.* namespaces and C runtime=20
libraries. You're using a different String class, for example, w=
hich=20
is basically a light wrapper on a const wchar_t*. </FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri>This morning I had to write a low-level C++ routi=
ne to=20
mimic the Byte.TryParse method, which is bad enough, but I was getting the =
text=20
out of a TextBox and in </FONT><FONT face=3DCalibri>the process, I dis=
covered=20
that</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri> String^ text =3D=20
txtbox->Text;</FONT></DIV>
<DIV> <FONT face=3DCalibri>const wchar_t* str =3D=20
text->Data();</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri>works fine -- Data is the method defined on the C=
++/CX=20
String class that exposes the C++ character pointer -- but this code=
=20
returned a pointer to junk:</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV> <FONT face=3DCalibri>const wchar_t* str =3D=20
txtbox->Text->Data();</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri>I'm sure some C++ maven can explain why this happ=
ens,=20
but I'm befuddled (and I hate C++ more than ever).</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri>Charles</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV style=3D"FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style=3D"BACKGROUND: #f5f5f5">
<DIV style=3D"font-color: black"><B>From:</B> <A title=3Dmarlongrech@gmail.=
com=20
href=3D"mailto:
marlo...@gmail.com">Marlon Grech</A> </DIV>
<DIV><B>Sent:</B> Friday, May 04, 2012 5:46 AM</DIV>
<DIV><B>To:</B> <A title=
3Dwpf-d...@googlegroups.com=20
href=3D"mailto:
wpf-di...@googlegroups.com">wpf-disciples</A> </DIV>
<DIV><B>Subject:</B> [WPF Disciples] are you guys doing windows 8 dev strai=
ght=20
on the tablet</DIV></DIV></DIV>
<DIV><BR></DIV>Hey guys,=20
<DIV><BR></DIV>
<DIV>This weekend I am planning on a Windows 8 geekiness weekend... do you =
guys=20
use the tablet directly to write windows 8 code or is there some trick I sh=
ould=20
know of ?</DIV>
<DIV><BR clear=3Dall>Regards<BR>Marlon<BR>WPF Blog - <A=20
title=3D"
http://marlongrech.wordpress.com/ CTRL + Click to follow link"=
=20
href=3D"
http://marlongrech.wordpress.com/"=20
target=3D_blank>
http://marlongrech.wordpress.com/</A><BR>MEFedMVVM - <=
A=20
title=3D"
http://mefedmvvm.codeplex.com CTRL + Click to follow link"=20
href=3D"
http://mefedmvvm.codeplex.com"=20
target=3D_blank>
http://mefedmvvm.codeplex.com</A><BR></DIV></BODY></HTML>
------=_NextPart_000_0359_01CD29C8.8C4F7CF0--