|
Hi I am facing some problem in the following code .Actually I am not able to print the full data present in my LPCWSTR .Here is the code
....
SYSTEMTIME current_time;.
GetLocalTime(¤t_time);
char *str =new char[2000];
sprintf(str, "%4d/%2d/%2d %2d:%2d:%2d:%2d\n", current_time.wYear,current_time.wMonth,current_time.wDay,current_time.wHour,current_time.wMinute,current_time.wSecond,current_time.wMilliseconds);
int i;
wchar_t *pwc = (wchar_t *)malloc( sizeof( wchar_t ));
i = mbstowcs( pwc, str, sizeof(str) );
WriteToLogFile(pwc);
delete [] str;
In the log file I just want to print the year date and time but only the year gets printed. Here is the log file
void WriteToLogFile(LPCWSTR strData)
{
try
{
ofstream myfile;
myfile.open("\\MyData\\Log.txt",ios::app);
int iSize = WideCharToMultiByte(CP_ACP,0,strData, -1, NULL, 0, NULL, NULL );
char* lpNarrow = new char[iSize];
lpNarrow[0] = 0;
iSize= WideCharToMultiByte(CP_ACP, 0,strData, -1, lpNarrow, iSize, NULL, NULL );
myfile<<lpNarrow<<endl;
delete [] lpNarrow;
myfile.close();
}
catch(...)
{
}
}
Any help on this..
Thanks in advance
|
|
|
|
|
anuhoho wrote: wchar_t *pwc = (wchar_t *)malloc( sizeof( wchar_t ));
Maybe you should allocate more than 2 bytes for your string. Greetings
Covean
|
|
|
|
|
SO what you suggest seeing the above code,.what should i give
|
|
|
|
|
In addition to my first post this
anuhoho wrote: i = mbstowcs( pwc, str, sizeof(str) );
copies only 4(32bit)/8(64bit) chars to your 2 wchar_t long string, because the call sizeof(str) returns the length of an char* and not the length of the string.Greetings
Covean
|
|
|
|
|
|
Something like this:
int nStrLen = strlen(str);
wchar_t *pwc = (wchar_t *)malloc( sizeof( wchar_t) * (nStrLen + 1));
i = mbstowcs( pwc, str, nStrLen );
Hope this work, couldn't test it.Greetings
Covean
|
|
|
|
|
|
i am studying abaddress.
that is search code which is not good becuase i can't get all information.
ABAddressBookRef ab = ABAddressBookCreate();
CFArrayRef people = ABAddressBookCopyPeopleWithName(ab, @"jhon");
what i want to get all information about phone number
for example, each cell's information so that i know first name, last name and phone number.
is there anyone who know?hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
I have 2 questions for pocket pc application which I am building in vb.net 2005.
1. I am using dataadapter to fill and then bind to datagrid which takes time. I there is any other fast way to bind the data?? Can we bind datareader with datagrid through loop???
2. I want to allow user to edit value of data grid at rum time for only one column not for all the columns. Where can I find an editable datagrid on the web???
Thanks in advance
|
|
|
|
|
Hi,
I need to implement a file system filter in Windows Mobile 6 using .Net Compact Framework with C#. Basically I need to get calls between APIs when the file is accessed and do some operation?
What I know is that this has to be done in C. However, I have no clue how to create this filter at all (Zero knowledge). I've read article from http://blogs.msdn.com/ce_base/archive/2005/12/01/499052.aspx[^] but im still very confused. Things like how how to get the sample file from %_WINCEROOT%\public\common\oak\drivers\fsd\fsdspy\ and all? Bottomline, im really noob regarding this file system filter.
Can someone guide me how to go about doing this to get things started?
1. What kind of project/ file should I create in visual studio 2008? (For example, Win32 console Application??).
2. Working samples for me to try it out for a noob like me
3. Steps in integrating the file system filters in C to my current c# compact framework project.
|
|
|
|
|
Hi there!
I am creating an finance application for the pocket pc(windows mobile sdk6).
Anyway,I want to download stock prices from yahoo finance and save them directly to a database.The files are downloaded in CSV format,eg:
http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yr
Theres loads of examples online of how to import a .CSV file to a database,but how can I import the information directly,without having to reference a physical file saved on the c drive?
Any help is greatly appreciated!!!
Thanks!
|
|
|
|
|
Should have mentioned I am developing this with C#
|
|
|
|
|
I am working in pocket pc application in vb.net by using microsoft visual basic 2005.
What I am trying to do is to have a confirmation when user close the application.
if user click on close button of the form then application should promot to confirm and if your click on yes button application should exit otherwise it should remain on that form.
Is there any form unload event in pocket pc form?
Thanks in advance
|
|
|
|
|
There is colsed event, Private Sub Form1_Closed event. You can go with this event...
|
|
|
|
|
VisionMobile invites you to join in the biggest Mobile Platform Survey to date, sponsored by O2 Litmus. Have your say on the future of mobile app development and see what everyone else in the community is saying.
Plus, enter a draw to win prizes, including:
• 1 Nexus One smartphone
• 1 HTC Touch 2
• 2 massive Amazon vouchers (500 and 250 Euros)
Register now on www.visionmobile.com/developers. Survey closes end of March and results become publicly available in Q2. Participants will receive summarised copy of the results.
|
|
|
|
|
Hi all,
I'm creating a .NET 2 program to work under WinCE 5, and am having difficulty installing it. If I deploy it from VS2005, it copies over the full .NET install as well, and runs fine. If I create a CAB file with all the dependencies and install that, it fails to run saying it can't find the file or one of its dependencies.
Any suggestions as to why the CAB approach is falling over?
TIA.
|
|
|
|
|
I think you have experienced a wrong directory issue that is why it doesn't find the file. I suggest you to recheck the directory structure.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Hi
Can a dll have a message loop so as to capture key press event. Suppose I have a dll running in the background of any device and as a user i have pressed a key .Now I want my dll to capture that event.How can i do that. Someone suggested to use a windows message hook but i am not very aware of this .Can any one suggest some sample code or some ways . I have made the dll in native C++.
Thanks in advance
|
|
|
|
|
The following links will help you out.
http://social.msdn.microsoft.com/Forums/en-US/netfxcompact/thread/676a597a-7257-4fcc-ad31-1ec1bce8ba6a
http://social.msdn.microsoft.com/Forums/en-US/windowsmobiledev/thread/11b65614-678a-45ea-b1d4-f44e9a2c7915
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:44am.
|
|
|
|
|
Dear All,
I am working on .net & Windows CE 6.0 application, my concern is, i want to send values to function which is Windows CE, How can i achive this using .net
Please help me on this or suggest ideas on this front..
Thanks & Regards
Yrishi
|
|
|
|
|
yrishi wrote: i want to send values to function which is Windows CE
Not quite sure what it means.
|
|
|
|
|
Hi, sorry for let reply....
I've an function which is in windows CE like Ftemp(ByVal left As Integer) As Integer
I want send the values to this function from my .net application as my form load event is execute.. like Ftemp(37)
Hope you understand this time...
Please help...
|
|
|
|
|
Yes you can pass some values to core functions of an dll file. There is a PINVOKE methods that shows how to do it. Please check this link Here
I hope it helps.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
I write: ::ShowWindow(m_hWnd, SW_MINIMIZE) but repaint just caption. if writing:
::ShowWindow(m_hWnd, SW_MINIMIZE);
UpdateWindow();
repainting the caption and the menu, but the client rect does not repaint. it still with my programm
|
|
|
|
|
Hi,
Is there a way to detect file opening / close.
When a file is clicked to open, before the mobile phone launch the
respective application (e.g. word doc, window media player, etc etc), my system will need to do an operation.
Same thing for file close. When the file is completely close, do something to the file.
I did a bit of research.
Firstly, IMessageFilter won't work because it only detect mouse event on the
form. Opening a file in \My Documents or anywhere else outside the form would
not trigger the PreFilterMessage
Secondly, Event Hook in CF does not support mouse event. It only work with
Keyboard.
I am sure there is a alternative solution out there.
Hope to hear from someone soon. its pretty urgent
|
|
|
|