|
The answer to the first question is no
And to the second Yes
(Sorry I don't know how to quote your message)
So the next question I have is what model should I use? EG. I would be using OO so would dao or enties?
BTW thank You for Your input!
Frazzle the name say's it all
|
|
|
|
|
frazzle-me wrote: (Sorry I don't know how to quote your message)
After you have hit the 'Reply' widget, select the text you want to quote from the original message and then hit the 'Quote Selected Text' button. (The big orange one )
If dao in your question means what it used to mean then it has been replaced by ADO.NET[^]. If you follow the links on that page, you will get a fairly good understanding of how it works.
The Entity Framework[^] can be a little complex, particularly if your database schema changes quite a lot during development. Once again if you follow the links on that page you will get to understand how it works.
For a first 'data centric' application I would probably tend toward ADO, but I am a conservative sort of person. If after you've had a play with both, you think you've got your head round Entities then go for that, otherwise use ADO.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
Henry Minute wrote: For a first 'data centric' application I would probably tend toward ADO, but I am a conservative sort of person. If after you've had a play with both, you think you've got your head round Entities then go for that, otherwise use ADO.
Thank You I am researching ado now
Frazzle the name say's it all
|
|
|
|
|
Hi,
I am developing a database that require a visualization of STEP or IGES file. I want basic rotation keys and zoom in/out.
Can anyone now if this feasible under Visual Studio 2008/2010 ? There is any library o API that I can use.
Thanks for the feedback.
knc
|
|
|
|
|
Yes, it's feasible to do.
You'd either have to write your own libraries to parse the file and visualize them or find a library to do it for you. I don't know of any, but if you Google for "IGES STEP SDK" you might find a few.
|
|
|
|
|
|
Like which? Are you talking about the individual pictures or the entire right side panel of the form?
In either case, I'd bet that they are both custom made controls. You'd probably start with a Panel control and custom paint the image it should show. You could probably use a Panel control inside of another Panel to handle scrolling. The inner Panel would host all of your image controls.
|
|
|
|
|
Meh, dunno anything about custom painting. Do you know of any third party controls that look like it?
Virtual Space Shuttle Astronaut
|
|
|
|
|
The Mighty Atom wrote: Meh, dunno anything about custom painting.
Wow. So much for learning...
The Mighty Atom wrote: Do you know of any third party controls that look like it?
I don't know of a third party control that does this for you.
|
|
|
|
|
Looks like a set of picture boxes (perhaps in a panel).
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
The one on the left is a TreeView. The one on the right is probably a custom built view, try asking the site where you saw it. Lots of samples of both can be found in the CodeProject articles or via Google.
I must get a clever new signature for 2011.
|
|
|
|
|
Will do, thanks.
I don't mind learning, i just don't know where to start when it comes to custom painting.
Virtual Space Shuttle Astronaut
|
|
|
|
|
The Mighty Atom wrote: i just don't know where to start when it comes to custom painting.
Try somewhere like this[^]. Use the tools available, such as MSDN, Google and all the various 'techie' sites (such as CodeProject) where people post articles, suggestions, tips etc.
I must get a clever new signature for 2011.
|
|
|
|
|
Is there a way to avoid typing alphabetic keys (A-Z) in any window and track the key which was pressed at same time. I tried to use BlockInput API. But it disabled all keys in keyboard. I hope your kind reply. Thanks
|
|
|
|
|
I have to ask why you would want to do such a thing. I can't see any useful purpose in it.
The easiest way to do it would be to create your own TextBox control (inheriting from TextBox) and handling the Key/Press/Down/Up events, searching for the keys that are allowed and passing them on to the base TextBox. Anything else you would do whatever you needed with them and just not pass them down to the base TextBox.
|
|
|
|
|
My requirement is to create a transliteration application. If I do this as you suggested, its ability limits to one application. But I want allow users to do transliteration on any window. To do so first I want to avoid typing English letters and track the key which was pressed. Later it will send translated letter to the active window. That's what I want.
|
|
|
|
|
The onyl way to do that would be a global keyboard hook.
The problem is you get keyboard scancodes, not letters. You'll have to map the key to the letter you want, see if it's allowed, and if so, send the key message down to the next hook in the chain. If not, you'll have to find the letter that is allowed, map that back to a scancode, alter the keyboard message and send that down the hook chain.
|
|
|
|
|
As I know, .NET Framework doesn't support global hooks and I am not familiar with hooks . Can you suggest another possible way to do this with .NET
|
|
|
|
|
What Dave says goes; if you don't like it that's too bad.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Pasan148 wrote: As I know, .NET Framework doesn't support global hooks
Actually, you're wrong. Global Mouse and Keyboard hooks, among a couple of others, work just fine in .NET. You just have to Google for examples.
Pasan148 wrote: Can you suggest another possible way to do this with .NET
There is no other way.
|
|
|
|
|
I used following code to implement my project as you suggest
Private Const WH_KEYBOARD_LL As Integer = 13
Private Const WM_KEYUP As Integer = &H101
Private Const WM_SYSKEYUP As Integer = &H105
Private proc As LowLevelKeyboardProcDelegate = AddressOf HookCallback
Private hookID As IntPtr
Private Delegate Function LowLevelKeyboardProcDelegate(ByVal nCode As Integer, ByVal wParam As IntPtr, _
ByVal lParam As IntPtr) As IntPtr
<DllImport("user32")> _
Private Shared Function SetWindowsHookEx(ByVal idHook As Integer, ByVal lpfn As LowLevelKeyboardProcDelegate, _
ByVal hMod As IntPtr, ByVal dwThreadId As UInteger) As IntPtr
End Function
<DllImport("user32.dll")> _
Private Shared Function UnhookWindowsHookEx(ByVal hhk As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
<DllImport("user32.dll")> _
Private Shared Function CallNextHookEx(ByVal hhk As IntPtr, ByVal nCode As Integer, ByVal wParam As IntPtr, _
ByVal lParam As IntPtr) As IntPtr
End Function
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)> _
Private Shared Function GetModuleHandle(ByVal lpModuleName As String) As IntPtr
End Function
Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
hookID = SetHook(proc)
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing
UnhookWindowsHookEx(hookID)
End Sub
Private Function SetHook(ByVal proc As LowLevelKeyboardProcDelegate) As IntPtr
Using curProcess As Process = Process.GetCurrentProcess()
Using curModule As ProcessModule = curProcess.MainModule
Return SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0)
End Using
End Using
End Function
But there is a problem in this function
Private Function HookCallback(ByVal nCode As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
If nCode Then
Dim vkCode As Integer = Marshal.ReadInt32(lParam)
If vkCode = Keys.A Then
SendKeys.Send("B")
Return CType(1, IntPtr)
End If
End If
Return CallNextHookEx(hookID, nCode, wParam, lParam)
End Function
If someone press 'A', I want to display 'B'. But according to this function it displays 'B' twice. How can I overcome this problem.
|
|
|
|
|
It's doing that because you used SendKeys n a keyboard hook.
Seriously, read up on what you're doing with a keyboard hook. When you callback function is, well, called, you are given the keyscan code before the system gets the key. This is your opportunity to MODIFY THE MESSAGE before it gets to the system.
Remove the SendKeys line and replace it with a line that sets a new value for lParam with the appropriate key you want.
|
|
|
|
|
Please can you show me the code to set a new value for lParam variable. Since I am not familiar with hooks I can't understand how to do that.
|
|
|
|
|
All you're doing is converting the new keycode to an Integer and passing the new value to the CallNextHookEx function. Seriously, why is this so hard?
|
|
|
|
|
Pasan148 wrote: Is there a way to avoid typing alphabetic keys (A-Z) in any window and track the key which was pressed at same time.
Just as a warning; you'd be violating the law if this application would be running on a PC in the Netherlands without the users' prior consent.
I are Troll
|
|
|
|