|
hi all
does any one know how i would implement an svg file to display it on an emulator
cheers
|
|
|
|
|
Hi again,
I am trying to get data from a datepicker and it gives me a CDateTimeCtrl.I think I have converted to a CTime but How do I convert that to a cString to write it to a file.
Here is what I have for code.
<br />
CString szChoice;<br />
CTime date;<br />
m_date.GetTime(date);<br />
szChoice = date.Format(L"%x");<br />
fileRead(L"Date: " + szChoice+ " \r" )
Thanks guys,
Rod
|
|
|
|
|
|
hi all,
My webservice is hosted on IIS of Windows Server 2003. My pocket PC app can call all methods of webservice except method that returns dataset!!! Anyone know how to work around? There is no problem if I host webservice to WinXP, Win2K professional, etc..!!!
FYI:
PocketPC app: VB CF .NET
WebService: VB .NET
Thanh you so much
K
|
|
|
|
|
I am using the PPC 2003 emulator...
i can't seem to get it to connect to the internet for programming web services connections... help?
the program is being developed in visual studio .net 2003
|
|
|
|
|
can anyone tell me how to convert or mask a CString to a char []
i.e. (char new[]). In need to do this for my combo box.
Thanks guys,
Rod
|
|
|
|
|
Take a look at Strings on Pocket PC, Unicode and ANSI.
char* GetAnsiString(const CString &s, UINT nCodePage)
{
int nSize = s.GetLength();
char *pAnsiString = new char[nSize+1];
WideCharToMultiByte(nCodePage, 0, s, nSize+1, pAnsiString, nSize+1, NULL, NULL);
return pAnsiString;
}
CString strUnicode = _T("Some test string");
char *pAnsiString = GetAnsiString(strUnicode, CP_ACP);
Regards,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
Thanks Daniel ,
Worked great, do you know how to convert ctime to cstring?
I am trying to get data from a datepicker and it gives me a CDateTimeCtrl.I think I have converted to a CTime but How do I convert that to a cString to write it to a file.
Here is what I have for code.
CString szChoice;
CTime date;
m_date.GetTime(date);
szChoice = date.Format(L"%x");
fileRead(L"Date: " + szChoice+ " \r" )
Thanks,
Rod
|
|
|
|
|
CTime to CString:
CString szChoice;
CTime date;
m_date.GetTime(date);
szChoice.Format(L"%02d.%02d.%02d", date.GetDay(), date.GetMonth(), dat.GetYear());
fileRead(L"Date: " + szChoice+ L"\r"); and of course: A Date and Time formatter
Regards,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
I have created an MFC app and I am using the code that you have on the web to read and write. the first problem is
1. I think from a combo box you can only read the info as a CString (is that right?)and then I pass it to the readFile method and when I do all the casting to try to get it to write the string it only prints the first letter. Can you si what I am doing wrong?
do you have suggestions?
//Get current selections from edit and list-box controls
CString szChoice;
CString szResult;
int nChoice;
m_name.GetWindowText( szChoice);
nChoice = m_name.GetCurSel();
//if(nChoice!=CB_ERR)
{
//if a valid choice was made from the list box, fetch
//the item's text string.
m_name.GetLBText(nChoice,szChoice);
szResult="Closing after selecting "+ szChoice;
fileRead(L"\\My Documents\\my_file.txt",szChoice);
}
void fileRead(TCHAR *szFileName, CString szChoice)
{
hFile = CreateFile(szFileName, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
//if (hFile != INVALID_HANDLE_VALUE)
{
// Note that we are writing a string, not a unicode string
LPTSTR p = szChoice.GetBuffer( 10 );//not sure if this is nessecary
wcscpy( p, L"Name: "+(szChoice)); //copying szChoice into p so I can cast(what else should I do)?
szChoice.ReleaseBuffer( );//not sure about this it was in a EVC example(What is it?)
const char *val = reinterpret_cast<const char="" *="">(p);//Casting p into a 'char' so I can print to file
//so I could try to use strcpy
AfxMessageBox (p); //gives the whole string (name:Rod) it i typed rod in combo box
strcpy(buffer2, val);//copying val into buffer 2
strcpy(buffer1, "Hello dude" );//copying string "hello dude" into buffer
WriteFile(hFile, buffer1, strlen(buffer), &dwBytesWritten, 0);//writing to file"hello dude
WriteFile(hFile, buffer2, (szChoice.GetLength()), &dwBytesWritten, 0);//*********Only writes first letter'N' I want it
//to write 'Name: Rod', what do I have to do?
CloseHandle(hFile);
}
hFile = CreateFile(L"\\My Documents\\my_file.txt", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
}
I don't get it!!!!! When I switch the order that the buffers write, say write buffer 2 first then it only writes "N" and never gets to writing buffer1, if I write the buffer1 first it writes "hello dudeN". It is like when it gets to buffer2 it stops running and will only write one charactor.
|
|
|
|
|
rodneyk1 wrote:
LPTSTR p = szChoice.GetBuffer( 10 );//not sure if this is nessecary
wcscpy( p, L"Name: "+(szChoice)); //copying szChoice into p so I can cast(what else should I do)?
First, this is bad. GetBuffer(10) guarantees you space for atleast 10 characters (20 bytes if UNICODE is defined, 10 otherwise), but you have no idea about the upper limit. Your second line can produce a buffer overrun. A safer way to do this is:
szChoice = L"Name: " + szChoice;
LPTSTR p = szChoice.GetBuffer( 10 );
Although I wouldnt recommend it either.
rodneyk1 wrote:
const char *val = reinterpret_cast(p);//Casting p into a 'char' so I can print to file
The template argument to reinterpret_cast was lost, but Im guessing that you had char* or const char* there.
The deal is that just because you can cast a LPTSTR variable (which stands for long pointer to T string, ie wchar_t* on wince) to a const char* variable does not convert the data pointed to by said variable to char's.
rodneyk1 wrote:
strcpy(buffer2, val);//copying val into buffer 2
(I dont see where you declare buffer2, but I will assume it's declared as char buffer2[255]; )
So, here we have val (const char*), which is pointing to the same memory area as p (wchar_t*), which points to whatever memory szChoice.GetBuffer() provides (also wchar_t*).
So, if we examine the memory that val points to, it should look something like:
'N', 0, 'a', 0, 'm', ...
which means that strcpy will grab the first character and then reach the 0-terminator => strcpy appends a \0 to buffer2 and then return.
rodneyk1 wrote:
WriteFile(hFile, buffer2, (szChoice.GetLength()), &dwBytesWritten, 0);
Here, WriteFile will write 'N', 0 and then whatever garbage that buffer2 contains after the 0, until it has written szChoice.GetLength() characters. You can examine your file in a hex-editor to see what it has written, possibly all 0's after the 'N', depending on how buffer2 was declared.
In short, you should read up on WideCharToMultiByte, and also look into fixing your memory managent issues.
HTH
Jonas
---
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
I have an unusual question. I am very unfamiliar with different computer codes, programming, or content type. I have received some e-mails with text that I dont quite understand. The words seems to be scrambled and don't make much sense. Is there some sort of code that I need to use to descramble it? The content type is - multipart/alternative; boundary="--69799397083396648
if that helps at all. A sample of what the text reads is "hierarchy statute proscute cacm arthur tift knit minim teakettle buttonweed" Does this make sense to anyone?
Thanks
T.M.
|
|
|
|
|
What you are getting is spam.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
I'm attempting to run the ctlpnl.exe application on a pocket pc device. I want to use it to load up some of the control panel settings applets so I can have my users change the device's time ect. I have been struggling with calling the application through createprocess. Is it possible to call the shellexecute method on a pocketpc device? Any particular reason for using one over the other?
Thanks,
Ryan
|
|
|
|
|
I am using the ShellExecuteEx method in some of my Pocket PC applications, so it should be no problem!
For more information take a look at: QA: How can I open the default mail or browser program when the user clicks on an URL?
PS: The only nice thing about using CreateProcess is that you can wait until the running application is terminated, or for a specified timeout!
Regards,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
Hi
I must write application which can remove files on PocketPC. this application mustn't work on PPC - I must run it on PC
so - how can I do this??
--------------------------
gouranga
JID badzio(at)badzio(dot)no-ip(dot)com
--------------------------
|
|
|
|
|
|
I tryed to build ADO sample for Pocket PC 2002 Emulator and
get an error
fatal error C1083: Cannot open type library file: 'D:\Windows CE
Tools\wce300\Pocket PC 2002\include\adoce31.tlb': No such file or directory.
this file I can't find on my Harddisk. Where can I find it?
thanks
|
|
|
|
|
Use the adoce31.dll file instead.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Hi All,
I have a problem as follows:
I need to have a serial connection between my PDA and a WaveCan generator for my program to function.now every time I reset the PDA I have to manually get the connection again.Is there a way such that once the connection is established, the user need not e-establish it on reset?
Thanking you for your time,
Regards,
Deeepa.
|
|
|
|
|
Dear all,
I am writting a database application for Pocket PC 2002 using the eVC++ 3.0
Now, I have a problem that need to add a lot of items on the CListCtrl.
I had tried following the article found on PocketPCDN about Virtual List
View http://www.pocketpcdn.com/articles/list_view.html
but my program always displays an error message:
"Assertion Failed
Test: File
winctrl2.cpp, Line 504"
Here is my code to create the CListCtrl
if(m_wndList.Create (WS_CHILD | WS_VISIBLE | LVS_OWNERDATA | LVS_SINGLESEL |
LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER,
CRect(0,0,243,224), this, MAIN_LIST)) {
// Set List Control style to Full Row Select
DWORD dwStyle = m_wndList.GetExtendedStyle();
dwStyle |= LVS_EX_FULLROWSELECT;
m_wndList.SetExtendedStyle(dwStyle);
}
Any help is very appriciated.
Regards,
-BHKien
|
|
|
|
|
It look like you have tried to call the SetItemText function of the CListCtrl class with the LVS_OWNERDATA style flag and if you take a look in the source code of winctrl2.cpp, Line 504 you will see an assert:
BOOL CListCtrl::SetItemText(int nItem, int nSubItem, LPCTSTR lpszText)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT((GetStyle() & LVS_OWNERDATA)==0);
LVITEM lvi;
lvi.iSubItem = nSubItem;
lvi.pszText = (LPTSTR) lpszText;
return (BOOL) ::SendMessage(m_hWnd, LVM_SETITEMTEXT, nItem, (LPARAM)&lvi);
}
So, this function call is not allowed with the LVS_OWNERDATA style flag!
Regards,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
Daniel is right. Furthermore, to use the LVS_OWNERDATA style, you have to handle a number of notification messages, most notably:
LVN_GETDISPINFO : Sent by the list control when it needs to render item data.
LVN_ODCACHEHINT : If you have a cache with data, use this callback to prepare it. This message is received before LVN_GETDISPINFO , so you can prepare the cache with the requested data.
LVN_ODFINDITEM : Used to find an item on the cache.
LVN_ODSTATECHANGED : Cached items have changed their state.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Thank you all,
I have one more thing to ask:
I am writting a derived class from CListCtrl. Is there any way to access the item data of the base class if my class use the LVS_OWNERDATA mode?
Thanks for your help!
-BHKien
|
|
|
|
|
Remember: if you are deriving (public inheritance) from a CListCtrl it means that your class is a CListCtrl . So, everything is accessible.
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|