|
I've been looking at that one for the better part of the day now and can't seem to get it working.
It could be that it works fine for use on the web but I have to use it in access so...
I'v been reading alot about this and it seems it is no longer supported by microsoft in the .net2 wich really suckes how am I supposed to get my user controls into access now
|
|
|
|
|
TDDragon wrote: I'v been reading alot about this and it seems it is no longer supported by microsoft in the .net2
WHA??? Who told you that?? Attributing a class for COM Interop is very much supported, even into .NET 3.0 and 3.5.
How do you have your class/methods/properties attributed?? Was the resulting .DLL registered on the target machine using REGASM?? Regsrv32 won't work with a .NET assembly.
|
|
|
|
|
when I try to register it on the target machine it gives me an error
as for where or who told me that there was no support I can't really answer that beceause I don't know anymore (I'v been reading articles and blogs all day long and everything is starting to bee very blurry)
I'v added the following to my class:
<Guid("1376DE24-CC2D-46cb-8BF0-887A9CAF3014"), ClassInterface(ClassInterfaceType.AutoDual), ProgId("Preview.PreviewDialog")> Public Class PreviewDialog
...
<ComRegisterFunction()> Public Shared Sub RegisterClass(ByVal key As String)
Dim sb As New StringBuilder(key)
sb.Replace("HKEY_CLASSES_ROOT\", "")
Dim k As RegistryKey = Registry.ClassesRoot.OpenSubKey(sb.ToString(), True)
Dim ctrl As RegistryKey = k.CreateSubKey("Control")
ctrl.Close()
Dim inprocServer32 As RegistryKey = k.OpenSubKey("InprocServer32", True)
inprocServer32.SetValue("CodeBase", Assembly.GetExecutingAssembly().CodeBase)
inprocServer32.Close()
k.Close()
End Sub
<ComUnregisterFunction()> Public Shared Sub UnregisterClass(ByVal key As String)
Dim sb As New StringBuilder(key)
sb.Replace("HKEY_CLASSES_ROOT\", "")
Dim k As RegistryKey = Registry.ClassesRoot.OpenSubKey(sb.ToString(), True)
k.DeleteSubKey("Control", False)
Dim inprocServer32 As RegistryKey = k.OpenSubKey("InprocServer32", True)
k.DeleteSubKey("CodeBase", False)
k.Close()
End Sub
when I build this it seems that he is trying to register it but isn't able to do so for the vbpowerpack.dll so I'm currently writing a simple usercontrol without the vbpowerpack to see if it makes a difference
My control is visible already in the insert add-in menu of access but I get an error when I try to do soo.
I'm currently thinking (hoping) its because of the vbpowerpack
|
|
|
|
|
After creating a very simple user control (contains just a button and checkbox and no code) it would seem that my code above indeed works fine (I can use this user control in access 2003 (still have to find it in 2007 but don't expect much trouble there))
So apperently it was the vbpowerpack that gave me so much trouble
still have to see how I can make access catch events and get property's from my user control but that at least I can get my user control to display on a form already
thanks for the assistence
|
|
|
|
|
please help
i wanna make a code that tell visual basic if the value of ("reglz")= dbnull then
go to err1:
when i type that ,he underline the word dbnull (u can't use it as experision
here is my code
cmd.CommandText = "select sum(fatrq1)reglz from reglz where fatrname = '" + ComboBox1.Text + "'"<br />
'fatrq1<br />
dr = cmd.ExecuteReader<br />
<br />
dr.Read()<br />
<br />
<br />
If f = DBNull Then<br />
GoTo hh<br />
<br />
End If<br />
<br />
f = dr("reglz")<br />
any suggestion ???
|
|
|
|
|
|
|
replace your code with the following
if isdbnull(f) then
goto hh
end if
|
|
|
|
|
I have microsoft fingerprint reader. its SDK from griule.com.
samples provided with SDK are in VB6,VB.NET,C#.NET etc.
but I need samples to work in MS.ACCESS2003.
all work fine when I copied all the code from VB6 to VBA(ms access).
here's what I have to changes.
1). made a public variable to refer to form.(Public frmMain As Form) as VB6 has a form with name(frmMain).
here's what I experience when I call a function.
herers the definition provided in for VB6.
Function CapRawImageToHandle (ByRef RawImage As Variant, ByVal width As Long, ByVal height As Long, ByVal hdc As Long, ByRef handler As IPictureDisp) As Long
'Call to function in VB6
frmMain.ctrl.CapRawImageToHandle raw.img, raw.width, raw.height, frmMain.hDc, handle
I got an error application-defined or object-oriented error.
I guess frmMain.hDC is causing problem as I don't know how to refer to ms access form's hDC property.
Asif Rehman
|
|
|
|
|
I have changes frmMain.hdc to frmMain.hWnd
now it works fine but.
I've got Image Control on form. and want to show the image taken from
handle variable.
' handle to finger image
Dim handle As IPictureDisp
frm.GrFingerXCtrl1.CapRawImageToHandle raw.img, raw.width, raw.height, frm.Hwnd, handle
' draw image on picture box
If Not (handle Is Nothing) Then
formMain.img.Picture = handle
End If
it gives error when I update Image Control(msaccess) in this way.(file not found).
Asif Rehman
|
|
|
|
|
I posted this a last week (I know) but didn't get an answer that helped me.
the answer I did get showed how to ad standard vb.net controls to a toolbar but this is not exactly what I want (maybe my question wasn't specific anough) so let's try again.
I have developed a user control in vb.net (it displays all files in a folder with a previeuw and some additional information and functions)
Now my boss asked me to see if we can't use it in "ms access 2007" since I'm very new to access (about 1 month user and developer now) I have no idee of how to get started at this.
basicly I need to be able to create a new form that holds my vb.net user control on it and is able to catch certain events (declared in the user control)
Any help on this would be appriciated (I looked on the internet but al I could find was how to put controls in the toolbar (to be clear this is not what I want my controls need to go on the form itself))
Thanks in advance
|
|
|
|
|
Have you figured out if this is possible?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Well it appears to be possible but I didn't get it working perfectly yet
I'm able to create an activx componont (in vb.net)
then I can import it in access (2007,2003) but I'm unable to set it's property's, not in code and in design I can set them once just after I put the control on the form but after that I can't change them they always revert back to there original value's
but due to lak of time I hade to put this 'project' in the freezer for a while so...
|
|
|
|
|
TDDragon wrote: due to lak of time I hade to put this 'project' in the freezer for a while so...
That's a bummer.
TDDragon wrote: I'm unable to set it's property's, not in code and in design I can set them once just after I put the control on the form
Hmmmm, is the visiblity of the properties non readonly outside the component?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I don't remember specificly but I think I'v tried every kind (public,friend,protected,...)
If I have some time I'll continue the search for an answer
|
|
|
|
|
Hi all,
I am working with webservices and its security.
I have a webservice and client application.now i need to secure the web service while calling and as well as serving the
request.
I tried using x509certificate but i didnt find luck.
Now, i want to use Kerberos token for providing security...
Can any one help me in giving security to the web serive
Thanks in advance......
|
|
|
|
|
Please stop spamming the entire site.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i want to create control array in vb.net in runtime or design time help me
sathish
|
|
|
|
|
what do you mean exactly.
from what I understand you could do it with the list variable.
example:
dim l as list (of button)
dim l as list (of textbox)
dim l as lizt (of control) (don't know how/if this will work though)
|
|
|
|
|
exactly i want create control array like vb like example: textbox(0) in runtime or at design time
sathish
|
|
|
|
|
Then I would use the list
example code that creates a list and fills it with 20 textbox
Private l As New List(Of TextBox)
Private Sub filltextbox()
Dim i As Integer = 0
Do While i < 20
Dim txt As New TextBox
txt.Text = "test" + i
l.Add(txt)
i += 1
Loop
End Sub
|
|
|
|
|
it is very useful but i want to access textbox values using there index value and in this the textbox names are different why ?
sathish
|
|
|
|
|
don't really know what you mean
the textbox names aren't different I just added text to it as a way to show how to access te property's
If you want to access the textbox with index value you could always give that index value along with the textbox.tag property and then loop true the list untill you find the right textbox
|
|
|
|
|
There is no design time support for creating control arrays. Here is some code that demonstrates a few different approaches.
Public Class Form1
' An array of textbox's
Private ControlArray As New List(Of TextBox)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Here I am adding TextBox's that already exist on my form to the array
With ControlArray
.Add(TextBox1)
.Add(TextBox2)
.Add(TextBox3)
End With
' Loop through each textbox in the array
For Each tb As TextBox In ControlArray
MsgBox(tb.Name)
Next
' Access a textbox by index
MsgBox(ControlArray(1).Name)
' Here I am creating textboxes dynamically and adding them
' to the array
For i As Integer = 0 To 2
' Create a textbox
Dim tb As New TextBox
' Set it's position
tb.Location = New Point(20, 10 + i * 30)
' Set it's width
tb.Width = 100
' Add the textbox to the array
ControlArray.Add(tb)
' Add the textbox to the form
Me.Controls.Add(tb)
' Add handlers for the GotFocus and LostFocus events
AddHandler tb.GotFocus, AddressOf TextBox_GotFocus
AddHandler tb.LostFocus, AddressOf TextBox_LostFocus
Next
' Here I've looped through the forms controls and found
' all the textboxes and added them to the array
' This is a good approach if you have many controls you added at
' design time but don't want to manually add each one to the array.
' The desired event handlers can also be dynamically added this way
For Each ctrl As Control In Me.Controls
Dim tb As TextBox = TryCast(ctrl, TextBox)
If tb IsNot Nothing Then
ControlArray.Add(tb)
End If
Next
End Sub
' Handles the textboxes GotFocus event
' I've handled the controls I created at design time by including them after the handles keyword
Private Sub TextBox_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus, TextBox2.GotFocus, TextBox3.GotFocus
' tb is a reference to the textbox that raised this event
Dim tb As TextBox = DirectCast(sender, TextBox)
tb.BackColor = Color.Wheat
End Sub
' Handles the textboxes LostFocus event
' I've handled the controls I created at design time by including them after the handles keyword
Private Sub TextBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus, TextBox2.LostFocus, TextBox3.LostFocus
' tb is a reference to the textbox that raised this event
Dim tb As TextBox = DirectCast(sender, TextBox)
tb.BackColor = Color.White
End Sub
End Class
|
|
|
|
|
thanks for your help and another thing that i want to known textbox name which currently active. i could not get it name from MsgBox(Me.ActiveControl.Name) this command why ?
thanks
sathish
|
|
|
|