|
Thanks Mika, GotFocus solved it. Enter occurs before the SelectAll, otherwise I would have used that. Never knew about GotFocus though, so awesome result!
Cheers
Paul
One day I want to be a code monkey. Right now, I'm more like a code amoeba...
|
|
|
|
|
You're welcome
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hello,
I am developing a client and server application for bluetooth devoce. My server is desktop PC which has dongle attached and client will be Windows Mobile. As client server get connected server will send to client list of some files. from the client side i should be able to download file means copying file from server to client. I am using sockes for eastablise connections. Now i have to send a file from server to client. How can i send a file? Please help me.
Thanks and regards,
Yudhisthira attry(India, Bangalore)
|
|
|
|
|
|
Hi,
i want to show the windows File Association form when user presses a button. I use the following code:
Imports System.Runtime.InteropServices
Public Declare Auto Function OpenWithDialog Lib "shell32.dll" Alias "OpenAs_RunDLL" (ByVal hwnd As IntPtr, ByVal hinst As IntPtr, ByVal lpFile As String, ByVal nShowCmd As Int32) As Int32
Private Sub button_ItemClick(...)
OpenWithDialog(Me.Handle, Marshal.GetHINSTANCE(Me.GetType().Module), "", CInt(AppWinStyle.NormalFocus))
End Sub
Well, it opens a similar form, the "Open With..." form, but i am not looking for the Open With... form. I imagine that i have to make 1-2 changes and after that then it will really open the File Association form(Set Association - Associate a file type or protocol with a specific program).
Any idea what i need to change on this so it work?
Thanks in advance
|
|
|
|
|
|
Hi all..
I need to change a class inheritance at runtime. Specifically I need to change the Control class to inherit from a MyControl class instead of the Component class.
I've been searching for ways to do this. I come across with Reflection.Emit, Profiling API, some code injection tools, but I am still very confused on how to do this. Is there any other way to do this?
Has anyone here have tried to do something similar? If so what techniques have you used?
Thanks,
José Tavares
|
|
|
|
|
In this instance, you can't change the inheritance chain. To do this, would require you to implement the features that the class is relying on from the base class. There are cases where you can appear tochange the inheritance chain, but this behaviour has to be coded in from the start. When you think about it, from a security standpoint, it would be a bad idea to change the behaviour because you could change the implementation to inherit from insecure/dangerous code, and would you really want this if you were a user?
|
|
|
|
|
I understand that and had thought about it already but it would be very helpful for me
Another hypothesis is to change the assembly to reflect this change. Can I change the System.Windows.Forms assembly with this changes (injecting the class into the assembly). If I use this assembly in the directory of the application would the compiler try to load it before it goes to GAC?
I've come across with an application RAIL (http://rail.dei.uc.pt) but it's no longer supported. Do you know any similar tool that allows me to change an assembly?
Thanks,
José Tavares
|
|
|
|
|
The only thing I can think of would be mono.cecil. It might help, but I haven't done enough with it to be sure.
|
|
|
|
|
I gave Mono.Cecil a try and was able to change the BaseType of Control to MyControl instead of Component.
The problem now is that I do not want to replace the System.Windows.Forms.dll in the GAC. I would like to use the new dll in the bin directory of my application. But it seems to be always loading the one in the GAC. Is this somehow possible?
|
|
|
|
|
jpsstavares wrote: I need to change a class inheritance at runtime.
Maybe you do and maybe you don't. Since you did not provide requirements I can only doubt your conclusion. It is far more likely that you need a different design.
led mike
|
|
|
|
|
You're right I forgot to mention that.
I'm doing a test suite to test application's GUIs and one problem to do this is the identification of components. You may have Controls with the same name, with the same automation ID, so there is no unique identifier to a Component that identifies it over different executions and different versions of the software.
The idea is to add an ID to the Control class that would automatically be created and that would allow me to identify controls (I want to add other things but this is my main reason).
Thanks
|
|
|
|
|
jpsstavares wrote: I'm doing a test suite to test application's GUIs
Ok, that explains a lot. Good luck, way outside my area of knowledge.
led mike
|
|
|
|
|
Hi,
Controls have a Tag property that normally is not used at all (by the Control
itself), i.e. it is reserved for the user, so he can attach an object of his
choice. Maybe that is sufficient to solve your identification problem?
|
|
|
|
|
jpsstavares wrote: I'm doing a test suite to test application's GUIs
There are already programs out there that accomplish this. We use QA Wizard Pro[^] from Seapine. Granted, it's not cheap (most programs like this aren't), but it does it's job quite well. Also, their support staff is the most helpful customer support I've ever dealt with.
Brandon
|
|
|
|
|
If they are visual controls, the HWND should be unique for each control.
|
|
|
|
|
Pete O'Hanlon wrote: If they are visual controls, the HWND should be unique for each control.
Yes but they are unique in each execution of the application. But for each test case the application is launched and closed so I cannot use the HWND...
|
|
|
|
|
But you could, if you reacquired the HWND whenever the app was launched. You know the controls you want, and you can hook in and get the HWND when it runs.
|
|
|
|
|
Dear All,
I have a windows application and I have created a setup in Intel System.
When it is installed in the client machine which has AMD processor it is installed successfully, but when clicking on the exe it is giving and error and it is not working.
Then i tried to reproduce it in out environment which has the AMD processor. I faced the same issue and then installed VS 2005 in that system and created the setup and tested the same in the AMD and Inter processor systems it worked well.
Then I gave the same setup to the client and the client is facing the same issue and it throws an error and the application is not opening.
Have any one faced the same issue?
Can any one tell me how to get rid of this?
Thank you a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
M. J. Jaya Chitra wrote: Have any one faced the same issue?
Probably. I have not.
M. J. Jaya Chitra wrote: Can any one tell me how to get rid of this?
Sure. Fix the bugs in your code.
If you need help, be more specific. What AMD processors do fail, and
what Intel processors do succeed in running your code?
And what is your application, what languages and tools did you use, what
fancy stuff is in there?
Could it be those AMDs are multi-core and those Intels are single-core,
implying you have a thread synchronisation problem?
Could it be you are using assembly instructions that exist on AMD but not
on Intel (as in the SIMD instruction sets, which are quite different)?
|
|
|
|
|
I would bet this isn't an AMD vs Intel thing...
But yer gonna hafta Do some debugging/research in order to figure out what is causing it.
Search the net for the error message to find out what might be causing it.
I believe you said you installed VS2k5 on one of the machines that wasn't working and it started working again? If that is the case, I would almost guarantee that you are missing a library on the machines that are not working.
|
|
|
|
|
Hi,
Can anyone say me the difference between framework class library and base class library in .Net.
-Harshini
|
|
|
|
|
The base class library is exactly that. It's the base set of classes provided by the .net framework for the fundamental functionality.
the framework class library is the extended set of classes that provide more advanced and specific functionality. The FCL is the BCL + a bunch of extra stuff.
BCL[^]
FCL[^]
Most of the time you don't really need to care weather a class you are using is in the BCL or the FCL. It only really becomes important if you want to use alternative .net implementations like Mono as they don't fully implement the FCL.
Simon
|
|
|
|
|
I am having problem to delete a Managed C++ DLL that was used in a
pure C# DLL even in the following scenario.
1. Launch the application. This applicatio has its own default
applicaiton domain.
2. Create a new Application Domain.
3. Load the Pure C# DLL in the new applicaiton domain. This C# DLL uses
managed C++ DLL.
4. Create a Proxy object using CreateInstanceAndUnwrap for the wrapper
object which is a wrapper for the class used from the pure C# DLL.
This wrapper object is exported from a seperate DLL.
DLL Configuration:- Wrapper for C# DLL, C# DLL, Managed C++ DLL.
The wrapper C# is used so that the main C# will not be loaded into
the default application domain when creating a Proxy object using the
menthod CreateInstanceAndUnwrap. The application domain talks with
only the wrapper DLL. If we do not have wrapper class, then the main
C# DLL will also be loaded into the default application. The sideeffect
of this is that, even when the new application is unloaded, we will not
be able to delete the main C# DLL. Wrapper is just a call frowader to
the C# DLL class.
5. Give the class name exported from C# DLL to the wrapper object and ask
it to create an instance of the class. The wrapper class creates the
the class and initializes its membet to it, so that it can forward
call requests.
6. From the default application domain, call a method on the wrapper object.
This call on the wrapper object calls the method on the C# class. This
C# class uses a function exported from a managed C++ DLL.
7. After executing the methods, unload the new application domain.
8. Now try to delete C# DLL, Mananged C++ DLL.
I was able to delete C# DLL, but not MC++ DLL. After further investigation
I found that the Visual Studio "Output" window has the following two lines:-
'Application.exe': Loaded 'C:\DLL1\Debug\MCPP.dll', Symbols loaded.----> LOADING FIRST TIME
'Application.exe' (Managed): Loaded 'C:\DLL1\Debug\MCPP.dll', Symbols loaded. ----> LOADING SECOND TIME
When the method on C# class is getting executed, the output log file
contains the above two lines. The .NET framework is loading it twice.
Once as Native C++ DLL, second time as Managed DLL.
Does any one know how to delete the MC++ DLL.
|
|
|
|