|
Dear All,
I am working in VB.NET compact framework for windows CE environment. I have to add a new connection in connection manager programatically. If some one have the solution of this problem, please post some sample code (C# or VB.Net) or useful URL.
Regards,
Muhammad Arif
|
|
|
|
|
I'm afraid there's no simple API for creating connections. Not even for C++ users. There are some third-party libraries which offer the ability to create RAS phone book entries (Connection Manager is based on RAS).
However, I have had luck with saving and restoring registry entries. RAS entries are stored under HKEY_CURRENT_USER\Comm\RasBook. The connection manager settings (which are also required) are under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ConnMgr\Providers\{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections.
It is possible to use the RasSetEntryProperties API to create a RAS phone book entry; unfortunately, the device configuration structure (the fifth parameter) is not documented in the Windows CE SDK. For the UNIMODEM telephony provider (used by modem connections) this is a DEVMINICFG structure, which is declared in the Windows CE 3.0 Shared Source[^].
I can't post sample code because I developed this as part of my employment.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
i have 12000 lines of code and lots more to add is this normal and is it normal for it to be slow when i switch between design and code view need reassurance please, new developer
|
|
|
|
|
12,000 lines of code for a tab control? I suggest you look at other implementations here on CodeProject for other ideas. Also, if the designer and editor are running a little slow, this really has nothing to do with C#. I suggest you get a faster computer.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
the tab control has a max of 10 pages each page has textboxes,comboboxes,labels, dtagrids etc with about 50 controls per page so mt 12000 lines includes all the designer generated code as well, as for speed the company has provided me with a laptop 2.4 processor 500mb ram. what do you think my good friend
|
|
|
|
|
Don't know what to tell you. I'm the director of technology and lead architect for a product with almost 400,000 lines of code and about 55 project loaded in my solution at a time with no problems in speed with only a 1.6 Ghz P4 and 512 MB of RAM.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
awsom must be fun hope they pay you well, i cant put my finger on why it is slow i must have screwed up somewhere, do you live near worcester UK?
|
|
|
|
|
I have removed some old web references i was thinking of using and it seems to flying again you got me thinking as usual all the best are u in the uk??
|
|
|
|
|
No, I don't.
A better OO design - and might help cut down on the lag you're experience - is to extend the TabPage class and create classes for each of your tabs that have all the controls configured. For your TabControl , simply instantiate each one of them and add them in the appropriate order (reverse order if using TabControl.TabPages.AddRange ). This will remove almost all the code from the offending source file and would provide a more abstract design as well, and is conceptually the same as property pages used through the Windows shell and many applications.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a form with 3 controls. Number 1 and 3 should have a tab order, and TabStop is set to "true". The second control should not have a TabStop, so I have set it to "false". But when I compile my solution, it is automaticly set back to "true" - why?
A second problem is that I have a label on a form, with a text: "nu&mber:" and with tabIndex 9. I have a textBox with tabIndex 10. Then I want the textBox to get in focus, when I press "ALT + m". But nothing happens.
I have no other controls with a lower tabIndex then 20, so it should not conflict with other controls. Furthermore I have no eventHandler that override "ALT + m".
|
|
|
|
|
Hi gurus,
Can someone tell me what is the equivalent of the WM_TIMER/OnTimer handler in C#? How to initialize and write the equivalent of the OnTimer handler in C#?
I guess I have to use the System.Timers.Timer class, right?
Thanks for the help.
Best regards.
There is no spoon.
|
|
|
|
|
Actually, the System.Windows.Forms.Timer component is what uses the WM_TIMER message. Any of the three timers in the FCL are good, though, the System.Timers.Timer has higher resolution. My suggestion to really learn the differences is to use the IL disassembler that comes with the SDK (ildasm.exe) or something like .NET Reflector[^] (both a disassembler and decompiler) to examine the internal workings of each timer.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath,
Thanks. I use the System.Timers.Timer class. it does what I want and is similar the use of the WM_TIMER. Now the shapes are falling automatically :P
I could also solve the random problem: instead of creating a random object for each blocks of the game board and the polymino, I instanciate only one Random class in my Tetrion class, then the Block and Polymino classes use this unique Random class, and all blocks and polyminoes have a unique brush/color/hatchstyle/lineargradientmode.
The solo engine of my tetris clone is almost done.
Best regards.
There is no spoon.
|
|
|
|
|
Hi,
I'm developing a setup project. Can you help me with these queries
- How do I get the installation path the user enters at runtime
- How can I copy some files to specified location eg:C:\temp
- How can I check for existence of a particular folder? Is it possible with Launch Condition. If not how can I do it?
-'User Interface -Add Dialog '- How can I get the values entered in the textboxes at runtime and pass it to my application?
- Custom Action properties , properties- Installer Class - true / false signify ?
- How do I start an application when Installation completes ?
Thankx in advance
Priya
|
|
|
|
|
I guess InstallShield for Visual Studio .NET is the tool you need for what you want to do. I usually use that tool to do this kind of tasks
Best regards.
There is no spoon.
|
|
|
|
|
That's actually not necessary. All but the last request can he do with the very limited VS.NET MSI project, and for the cost InstallShield isn't worth it.
I started beta-testing the Windows Installer runtime and Wise for Windows Installer before Windows Installer 1.0 was released. Wise was always much cheaper and up until v4.0 of InstallShield, Wise was the only one that provide access to ALL the MSI tables, as well as giving you the ability to create your own tables (for use with binary custom actions and what-not). The first InstallShield for Windows Installer didn't provide access to tables at all and slowly added support for select tables. For a Windows Installer hack like me, I was rather purturbed and have always stuck to Wise for commercial deployment projects because I continually find myself changing a few things in the tables directly even through WFWI provides ample functionality for doing it automatically (there's just a few things I like to do to personalize the designer, more than not).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Dpriya wrote:
How do I get the installation path the user enters at runtime
Query the [INSTALLDIR] property.
Dpriya wrote:
How can I copy some files to specified location eg:C:\temp
If you mean the temp directory as assigned by the system (it hasn't been C:\TEMP since Windows NT 4.0 and Windows 98, IIRC), then parent your files to the TempFolder directory, which is assigned the correct path based on the user level at runtime.
Dpriya wrote:
How can I check for existence of a particular folder? Is it possible with Launch Condition. If not how can I do it?
In Visual Studio .NET, click on the Launch Conditions Editor, right-click on "Search Target Machine", and add a new search for a File. You can specify a folder. See the DrLocator table in the Windows Installer SDK on http://msdn.microsoft.com[^] for more information.
Dpriya wrote:
'User Interface -Add Dialog '- How can I get the values entered in the textboxes at runtime and pass it to my application?
Use the VS.NET form designer for your installer project and enter property names in the property grid. At any time after those properties are set (and if they're not, their value is NULL) you can query them - as with all properties - using [PropertyName]. Make them all upper-case in order to set them from the command line for msiexec.exe.
Dpriya wrote:
Custom Action properties , properties- Installer Class - true / false signify ?
After you add a custom action for an Installer class, you can change the command line to accept swithces. In your Installer class, use the Context.Properties dictionary to get the string values and parse them into whatever values you need. For booleans, use Boolean.Parse or Convert.ToBoolean(string) .
Dpriya wrote:
How do I start an application when Installation completes ?
This isn't easy to do with the VS.NET installer project. After the build, you must use a tool like Orca to manually modify the MSI package. You add a custom action to the CustomAction table with a unique string key, custom action type 18, the File table key for the executable you just installed and want to launch, and then any command-line parameters you want to pass to that executable. See the CustomAction table in the Windows Installer SDK for more information.
In order to execute that, go to the InstallUISequence table (if you only want to launch it when a full or partial UI is specified, which is recommended), or the InstallExecuteSequence table. Add the name of your custom action there along with a sequence number that is after the InstallFinalize action (recommended), but set the condition to INSTALLED to only execute that if the MSI package was just installed (as opposed to uninstalled). During installation, NOT INSTALLED evaluates to true until the InstallFinalize action is executed.
For more information about Windows Installer, see the Windows Installer SDK.
If you want a good development environment - much better than VS.NET's installer projects - then get something like Wise for Windows Installer[^] (cheaper, just as capable, and was ahead of InstallShield for many years in terms of functionality) or InstallShield Developer[^] (very expensive, especially for entry-level installer developers).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I agree with Heath, you may use a ready-to-use tool like wise or InstallShield to do deployments. Both tools are good. Personnally, I'm used with InstallShield since version 5 (currently v9 SP1). But don't try to program yourself the Windows Installer Service... Even with the SDK, it's a crazy architecture. The relational database of the Windows Installer service is not easy to understand and it's complexe to fill the tables. You will almost have to write your own programs to fill these tables. It should be easier with an appropriate tool either Wise or InstallShield.
Best regards.
There is no spoon.
|
|
|
|
|
I never really had a hard time understanding it at all. In fact, just the other week I finished doing a large amount of hacking to the generated MSI package for the AutoCAD OEM we've licensed to add a lot of extra files and actions that it didn't know about when building the MSI package from it's own template. I did all this using Orca. I do plan at some point to write a simple script or application to automate this (to avoid stupid mistakes including typos or just forgetting something), but it wasn't hard to do if you understand it.
Windows Installer is a great runtime and I'll never go back to a proprietary installer technology like InstallShield (which I used a little before Windows Installer). The transaction functionality is excellent, and correctly authored MSI packages are great for advertised and administrative installations, something I haven't seen in proprietary installer technologies from the likes of Wise or InstallShield.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
For information, know that InstallShield uses MSI packages if you ask for it. if you select an MSI project under InstallShield, it will show you a series of interfaces to help you to fill easily the tables needed to build the MSI/updates package with all actions or dialog boxes you need.
Both: Wise and InstallShield are good tools, they are just different... like Maya or 3DS...
Best regards.
There is no spoon.
|
|
|
|
|
I know. They used to have a separate IDE for Windows Installer but recently (last time I checked) bundled it with InstallShield Developer, which is much more expensive and - if all you want is a Windows Installer IDE - isn't worth it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I writing an N-tier application, where I will used strongly typed DataSets as data transport objects between some tiers.
The application consumes a web service. By default VS has created a proxy and a number of classes that are used to hold the data the web service returns, ie classes that mirrors the result xml structure. I want to move to DataSets instead.
Is there a clever way to make a web service proxy automatically fill a typed DataSet instead of the auto-created classes when I call the web service? Observe that this web service does not return a DataSet per se (this would be simple then), but a structure that would easily be held within a DataSet.
Manually I can look inside the wsdl, extract the schemas, let VS create typed DataSets from those schemas, write code that consumes the web service through the proxy, move over all retrieved data to my DataSets, done. Since this seems like a common scenario, I'm just hoping that VS has an automated way of doing this. What would be the easiest way?
Kind regards,
/Björn Morén
Sweden
|
|
|
|
|
Does the Web Services return a typed DataSet ? IIRC, if it does the generated proxy should create a typed DataSet as well. I could be wrong - it's been a while since I consumed a Web Services (I have - a lot - it's just that now the clients already have the proxies and I haven't had a need/desire to consume another WS lately).
If not, you can always write your own proxy - it's really not that hard - so that it uses a typed DataSet . Just look at the source for the generated proxy and you'll see how easy it is to create your own, pretty much as you suggested you might do. I'm not aware of any automated method that VS.NET provides, since it's only automated method of generating a proxy us what you've already used (similar to wsdl.exe, if it doesn't actually use it already).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the reply Heath.
If the web service returns typed DataSets, then the proxy will return untyped (regular) DataSets, but the content can easily be moved to a typed DataSet by use of the DataSet.Merge method. But my problem is that the web service does not return a DataSet, even though the actual xml structure is very similar. I'm curious why I havn't found anything fruitful Googling around for this. What would be a really good setting for the proxy generation would be a checkbox: "return as [] DataSet or [] object hierarchy classes".
I have some ideas I will try shortly:
- Getting hold of the web service reply in original xml format, and deserializing it into the typed DataSet. Weakness: Probably requires some tweaking of the xml.
- Manipulating the wsdl so that VS thinks that DataSets are returned, and creates the proxy to return DataSets. I have my doubts that this will work automatically.
- Writing a generic method that by use of reflection can move an object hierarchy into a typed DataSet. Ugly.
Writing my own proxy might be a good alternative, thanks for the tip. It probably can be very generic too (or based on a very generic base class), so it can be used for all "web service reply -> typed DataSet" scenarios.
|
|
|
|
|
If the XML returned for the DataSet is in the correct format (which is should be, since DataSet are marshaled as XML even for the BinaryFormatter provided in the FCL), you can always use DataSet.ReadXml to read it into a DataSet .
I'd have to agree with you as well that modifying the WSDL would probably not yield the result you're looking for.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|