|
@interface testTable2ViewController : UIViewController
{
NSMutableArray **indexStore;
}
@property(nonatomic , retain) NSMutableArray **indexStore;
@end
@implementation testTable2ViewController
@synthesize indexStore;
- (void)viewDidLoad
{
for (NSInteger i = 0; i <10; i++)
{
indexStore[i] = [[NSMutableArray alloc]init];
}//for
}
@end
//////////////////////////////////////////////////////
but indexStore[i] = [[NSMutableArray alloc]init]; can't work
Error Message is EXC_BAD_ACCESS...
why it is not working?hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
You never allocate space for indexStore . If you know it'll always have 10 elements, declare it as
NSMutableArray *indexStore[10];
and
@property(nonatomic , retain) NSMutableArray *indexStore[10];
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Hi, i want to develop a small game for windows mobile with C#.
What is the fastest 2D drawing API? Im very used to XNA, so is there anything that I can use that's similar? I heard GDI is pretty slow.
ThanksStrive to be humble enough to take advice, and confident enough to do something about it.
|
|
|
|
|
If you are drawing sprites then you should use DirectDraw. Unfortunatly DirectDraw isn't directly exposed to .Net developers. But there's another CodeProject article where some one declared all of the imports necessary to begin using DirectDraw from the .Net Compact Framework.
|
|
|
|
|
Hi
I want a thread to start after 15/20 min For that can I use CeRunAppAtTime() .If yes can anyone provide me ways to do that.
Suppose this is my thread
void main()
{
..
..
g_handle= ::CreateThread( NULL, 0,MyThread, NULL, 0, 0);
....
}
Now I want This MyThread to start after 15/20 min can I do that
Thanks in advance
|
|
|
|
|
Start your thread immediatly. When the thread starts have it to create an unnamed event. After creating the event the thread can call CeRunAppAtTime and pass the event handle. Then call the Wait function using the even't handle as athe parameter. The thread will be blocked from running until the event gets triggered.
For information on using CeRunAppAtTime with an event handle please see my comment at the bottom of This MSDN Documentation page[^]
|
|
|
|
|
I am using datagrid in my vb.net (pocket pc) application.
I am using the following code to set the tablestyle to the datagrid to adjust the column width
<pre>
Dim ts As DataGridTableStyle = New DataGridTableStyle
ts.MappingName = "Products"
Dim Product As DataGridTextBoxColumn = New DataGridTextBoxColumn
Product.MappingName = "Product"
Product.HeaderText = "Product"
Product.Width = 130
ts.GridColumnStyles.Add(Product)
Dim Qty As DataGridTextBoxColumn = New DataGridTextBoxColumn
Qty.MappingName = "Quantity"
Qty.HeaderText = "Quantity"
Qty.Width = 75
ts.GridColumnStyles.Add(Qty)
Me.DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.TableStyles(0).GridColumnStyles(0).Width = 100
</pre>
After binding the datagrid I use this code to set the datagridtablestyle but it only show my one column me nothing even it does not return the values in the datagrid with original tablestyle. It show only row header in the grid but does not show the columns.
Any idea how I can solve this problem????
Thanks In advance
|
|
|
|
|
Can anyone suggest a way as to how i can use a timer in a dll.How we can use windows messages or settimer .
Thanks in advance!!!!
|
|
|
|
|
|
SetTimer requires a message pump but my dll doesnt have any. So i cant use it. I need an alternative of Sleep() so that i can use it
|
|
|
|
|
|
Hi
I have a small query. I have a dll and I want it to start as soon as my device reboots. Is there any way of doing it. How about putting it in the windows start up, so that whenever my device will start my dll will also start. Can anyone provide me with some logic.
Thanks in advance!!!!
|
|
|
|
|
You cannot just start a DLL. DLL requires a process to load it. So, may be you can write an application which loads your DLL and calls it's functions. And configure that application to auto-start after booting.
Take a loot at following article:
Automatically Starting Your Application on Windows Mobile[^]
|
|
|
|
|
Hi I have an application in which i have a thread which is expected to do an activity after half hour. SO i used sleep() but while testing(in one scenario) i saw that when the device go in the sleep mode then the time taking to do the activity for that thread is more then the desired time of 30 mins. That is my sleep() is not working accurately when my device goes in the sleep mode. So how can i programatically make a 30 min delay without using any info from the device OS(like gettickcount etc).
My application works fine if I keep the device awake i.e., if i dont allow it to go to the sleep mode forcefully. But the problem arises when it goes to the sleep mode. The time taking is much more ...
Is there any remedy for that.
Thanks in advance!!!
|
|
|
|
|
I just answered this above, but for the sake of some one else that reads this question you shouldn't use Sleep to schedule a thread to run. Instead you must use CeRunAppAtTime. For information on using this function with an event you can see the MSDN documentation page ( here[^]) or you could see the CodeProject.com article I wrote on scheduling a program to automatically start (which is also applicable to threads ig you use the info at the above link) from here[^].
|
|
|
|
|
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.
|
|
|
|