|
Ok now I got what you are saying. Yes the application will be closed once done entering in info. This is done on a daily basis and having the PDA on all day doesn't make sense.
Thanks Heath,
JJ
|
|
|
|
|
Note, just because a PDA appears off doesn't mean the memory state isn't saved. This is how they work - unless you physically turn off the device, it is always on - it is just sleeping or hibernating. When you turn it on, every program is still running as it was before. How do you think they can notify you of events when they appear off?
Also, even when you close an application using the X button at the top, the application is still running (unless you're using a single process build of Windows CE - but PocketPC is a multi-process build). It isn't terminated unless you use the Memory control panel app to terminate it or your program terminates itself (or has a critical error and dies).
A few things to keep in mind.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello all,
My requirement:: There's protocol Interface class with some persistant data which has to be invoked from seveal other classes with out disturbing the Member data. In Visual C++ windows application we create new instance of Protocol Class in the Application main class.... & gets reference of this where ever we are using it.... like
CProtocolAPI *pProtocol = (TestApp*)AfxGetApp()->m_pProtocol
and we can call methods of CProtocolAPI using pProtocol reference
now my doubt is how can i do this in C#.... can any body give me some idea..... little urgent plzzzzzzzzz
Thanku in advance
Adi
|
|
|
|
|
Store a static instance of ProtocolInterface inside your main class and create a static property to access it.
<br />
public class Main<br />
{<br />
private static ProtocolInterface protocol;<br />
public static ProtocolInterface Protocol<br />
{<br />
get<br />
{<br />
return Main.protocol;<br />
}<br />
}<br />
}<br />
Access the instance by Main.Protocol
Does this help?
|
|
|
|
|
I have three forms a parent form, child form 1, child form2. Child form1 is a user interface used to save data to the random access file .The user inputs the following in to the textboxes Name, Account Number, & Address. Child form2 reads the file. That works fine but I would like to use a combobox to display the name and account number, so when the user selects the name & account nuber the textboxes are filled with the appropriate data. Is this possible? Any help would be greatly appreciated.
|
|
|
|
|
my way:
public dataset owned by parentform, with all the data you need in both childs. So even if user changes data from 1st child, data in the 2nd one are immediately available. That's a little faster: no need to save/read/synchronize two datasources. And no need to write your own save to file/load/parse etc. stuff.
h.
|
|
|
|
|
I am importing data from a excel sheet to a listview box. I need to set the range of the listview column to the no of columns available in the excel sheet.
I am able to count the available no of columns in the excel sheet using worksheet.columns.count.
The worksheet.get_range(object cell1, object cell2) asks for the the starting column ie A to the end column which could be anything from B to ZZ and so on.
The solution I could see is add the worksheet.column.count value to 65(ascii code of A). But how do i convert back the value say 77 to its equivalent Ascii char M. I dont find any toascii() function.
Regards
Tarakeshwar
CCIE Q(Routing and Switching), MCSE Security
|
|
|
|
|
You can cast from an int to a char and back again. You don't need any such toascii function.
IIRC, you can just use the string references for the Range object. You could then just enumerate through the collection returned and put the cell values in the ListView according to their index in the collection.
Finally, I'm not sure about your implementation, but have you consider just embedded the Excel ActiveX control in your application?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have created a tree and need to add nodes to it, around 28,000 of it. I get the data from the sql database and using dr check for the four different types. According to the type I display the first type first with a color, then the next type with a diff color and so on for the four types of data. The time it takes to load the tree is around 12 secs, but I cant afford more than 5 secs for the task. I have used Treeview.BeginUpdate and Treeview.Endupdate in the code.
Is there any other method to make sure that the tree listing takes place even faster.
Regards
Tarakeshwar
CCIE Q(Routing and Switching), MCSE Security
|
|
|
|
|
Calling BeginUpdate and EndUpdate is about the only thing you can do if you want to load all nodes at the same time. Even using threading, you'll have to use TreeView.Invoke (inheritted from Control ) to add the TreeNode in the thread on which the TreeView was created (necessary, or you'll get strange problems if it even works at all). This still means that adding the tree nodes is synchronous, although initializing the tree nodes can happen in a separate thread (though this probably won't give you the 7 seconds you need).
If you don't need to load the entire tree, I recommend handling the TreeView.BeforeExpand event to implement an on-demand tree.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I agree that TreeView.BeforeExpand is the best solution. Loading 28,000 nodes will take a long time.
Have you tried timing your method to see if it takes 12 seconds for the tree to populate or to reterieve the data from database?
If it's tree loading, you can just load all the data, keep it in some data structure and populate tree with BeforeExpand.
|
|
|
|
|
hai,
i have two custom controls in my application. I need one more custom control with some controls. The fact is what ever control i need is already in that two custom control. Is it possible to inherit the control class which avilable in above two custom controls into the third control. If yes. How i can do that ?
hai, feel free to contact
Sreejith SS Nair
|
|
|
|
|
You can extend your custom control just like your custom controls extend whatever control (presumably the UserControl class). As far as including controls instantiate in the other custom controls, no. Those are just instances. You'll have to include instances of the same control classes in yours.
What you are asking is hard to understand, though. Could you elaborate a little more?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi there, fellas!
The question I am asking has perhaps been asked here, anyway, why are you C# programmers so often snobbish to us VB.NET programmers? I've encountered that so many times and it really seems a patterned behavior.
IMHO, that comes from the opinion that VB.NET is the descendant from VB6, which many of you don't regard as a "serious" programming language. I completed a bunch of business projects in VB6 which make use of COM, DCOM, TCP/IP, serial comms in the past, and I am sure that I made it way much faster than if somebody using C++.
Now I am programming for .NET in VB.NET, mainly business applications, both ASP.NET and Forms. In my projects I use n-tier paradigm, Remoting, Reflection, multi-threaded programming, dynamic code generation, etc. It takes much less time to use VB.NET than C#. Why the heck do I need to recompile my project every time I add a new method or property for it to show up in Intellisense?
Having both linguistic and technical education, I can say that it is really more clear to use AddHandler than to use "+=".
As a conclusion I want to say that VB.NET is at least as powerful as C# when it comes to business applications. Can you prove I am wrong?
Regards,
Serge (Logic Software)
|
|
|
|
|
Because logical syntax rules () and {} and "END LOOP" is whack.
Just kidding but I love my C influenced syntax, and find other forms of syntax lacking or silly. And VB will never live down it's pre .Net bad image, like it or not.
Anybody that claims one language is better than another within .Net does not understand how .Net works or what it really is. All languages are equal, it's just syntaxical sugar on what language you choose.
|
|
|
|
|
Rhelic wrote:
Anybody that claims one language is better than another within .Net does not understand how .Net works or what it really is
Well, different languages use different features of the CLR (for instance VB.NET does not support the concept of unsafe code) So your statement is wrong. One language is not equal to another language in .NET. Each language plays to its strengths and takes only those elements from the CLR.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
I am not claiming that VB.NET is better than C# What I really point out is that it is in no way worse when you're about business apps.
And I never understand why somebody would claim that somebody else does or doesn't understand how something works. Personally, I do understand how .NET works. And it IS really a matter of syntax, imho.
Regards,
Serge (Logic Software)
|
|
|
|
|
Serge Lobko-Lobanovsky wrote:
I completed a bunch of business projects in VB6 which make use of COM, DCOM, TCP/IP, serial comms in the past, and I am sure that I made it way much faster than if somebody using C++.
Yes: a monothreaded, non-scalable solution, with poor exception support. Not because you are a bad programmer, but because VB sucks.
Serge Lobko-Lobanovsky wrote:
Why the heck do I need to recompile my project every time I add a new method or property for it to show up in Intellisense?
I really don't know, you probably messed up your development environment.
Serge Lobko-Lobanovsky wrote:
multi-threaded programming
I'm yet to see a pure VB programmer who clearly knows where to use and can differ a mutex, a semaphore or an event. Or who can spot a race condition or a deadlock.
A challenge: just as a test about the average VB multi-thread programming knowledge, I see you are an above average VB programmer.
The System.Threading.Thread class has two methods for waiting: Sleep and SpinWait. Why would one call SpinWait instead of Sleep for a pause on a thread?
I never saw a SpinWait call on a VB.NET program, can you say why?
The biggest troubles about VB are not about syntax, is about the ugly, poor, simplistic, type system.
Read my opinion on this article: GBVB - Converting VB.NET Code to C#[^]
Due to technical difficulties my previous signature, "I see dumb people" will be off until further notice. Too many people were thinking I was talking about them...
|
|
|
|
|
Daniel Turini wrote:
I'm yet to see a pure VB programmer who clearly knows where to use and can differ a mutex, a semaphore or an event. Or who can spot a race condition or a deadlock.
I dare ask why? Why do you assume that a VB.NET programmer doesn't have C++, Asm and Win32 API history?
The System.Threading.Thread class has two methods for waiting: Sleep and SpinWait. Why would one call SpinWait instead of Sleep for a pause on a thread?
I never saw a SpinWait call on a VB.NET program, can you say why?
Nah, I don't know why If you can provide me an example, then please do it. I am eager to become the first one, hehe.
Regards,
Serge (Logic Software)
|
|
|
|
|
Daniel Turini wrote:
I'm yet to see a pure VB programmer who clearly knows where to use and can differ a mutex, a semaphore or an event. Or who can spot a race condition or a deadlock.
Pure C# programmers aren't much better. In fact, the majority of code I see that uses the more advanced multithreaded techniques is flawed, sometimes in significant ways.
|
|
|
|
|
I've found an overwhelming need for new C# and VB developers to rush headlong to the System.Threading namespace just so they can feel cool by typing new Thread.
I've learned a great appreciation for the delegate.beginInvoke method since it covers 90% of the cases when I need to run on a different thread. And it is much easier to use since you can just pass parameters to a function.
If you don't kill me you will only make me stronger
That and a cup of coffee will get you 2 cups of coffee
|
|
|
|
|
Serge Lobko-Lobanovsky wrote:
are you C# programmers so often snobbish to us VB.NET programmers?
I think probably because the majority of C# developers come from a C++ background where an extra element of thought has to go into developing software with it.
Serge Lobko-Lobanovsky wrote:
It takes much less time to use VB.NET than C#.
I don't believe that statement to be correct. I would suggest it takes YOU less time. I could say the exact opposite because of my experience because it would take ME less time to do the same project in C# than in VB.NET. In other words our past experiences have guided our judgement.
Serge Lobko-Lobanovsky wrote:
Why the heck do I need to recompile my project every time I add a new method or property for it to show up in Intellisense?
Do you? I've never noticed.
Serge Lobko-Lobanovsky wrote:
I can say that it is really more clear to use AddHandler than to use "+="
Again, personal opinion. I would say opposite.
Serge Lobko-Lobanovsky wrote:
Can you prove I am wrong?
I'm waiting for you to prove that you are right. All you've provided so far is opinion and anecdotal evidence. However, if you accept the proverb that the "Proof of the pudding is in the eating" then we are both right.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
I like your reply, because you're not being affected by the provocative nature of my question
Colin Angus Mackay wrote:
All you've provided so far is opinion and anecdotal evidence.
Actually, I feel offended when somebody says "what is written in VB.NET sucks". Using this language or another is really a matter of personal taste. My opinion is that whichever language you're using doesn't matter as long as you keep learning and acquiring new experience.
When MS introduced .NET, they made us almost equal when it comes to the matter of which language to use.
Regards,
Serge (Logic Software)
|
|
|
|
|
He never made such a comment, but was stating that which language you use a matter of preference. True, VB.NET and C# generate almost the same MSIL (C# does support more features of the CLI, however, and does optimize slightly better in some cases), but a developer as he said will most likely use whichever language he has more experience (with similar) languages.
Yes, I do believe that VB sucks (because I know how it works based on my decade of experience with OLE automation and COM) but I have not such opinion of VB.NET other than that I personally don't like the syntax. Coming from a long background with C/C++, Perl, and Java I like curly braces and semi-colons, but it's only my personal opinion, which is what the poster said is all you're offering and it's true. What you stated is your opinion and nothing more. And that's okay, just don't think it's a matter of fact.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
He never made such a comment, but was stating that which language you use a matter of preference.
Actually, I was not referring Colin when put this.
. What you stated is your opinion and nothing more.
Well, my opinion is based on personal experience in working with C# programmers. As you can see in my first post, I state that there is snobbery in C# programmers. I just simply don't understand why you (C# programmers) underestimate our (VB.NET) ability to create reliable and scalable software.
It proved to be a stereotype that VB.NET sucks because VB sucks. I want to break this vicious circle.
Regards,
Serge (Logic Software)
|
|
|
|