Click here to Skip to main content
16,007,932 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionShowdown - When logout Pin
Vandankiran8-Apr-06 21:39
Vandankiran8-Apr-06 21:39 
AnswerRe: Showdown - When logout Pin
CWIZO9-Apr-06 2:52
CWIZO9-Apr-06 2:52 
AnswerRe: Commport Pin
progload9-Apr-06 6:31
progload9-Apr-06 6:31 
Questionsending serial data using rs232 Pin
hackerz838-Apr-06 21:09
hackerz838-Apr-06 21:09 
AnswerRe: sending serial data using rs232 Pin
Joshua Quick9-Apr-06 11:32
Joshua Quick9-Apr-06 11:32 
GeneralRe: sending serial data using rs232 Pin
hackerz839-Apr-06 20:54
hackerz839-Apr-06 20:54 
AnswerRe: sending serial data using rs232 Pin
Joshua Quick9-Apr-06 23:21
Joshua Quick9-Apr-06 23:21 
QuestionVB.NET: COM Interop. Sink event to COM Client Pin
mdepaepe8-Apr-06 19:03
mdepaepe8-Apr-06 19:03 
Hello,

I am trying to develop a simple COM Server using VB.NET in order to be called from a VB6 existing application exe.

At build time, I always get an error like:
"COM Interop registration failed. Could not load type EventSource.evtContextWrapper from assembly DotNetServerForComClient."

I have this error as well in W2000 and WXP using VS.NET 2003.

For a basic test, I started from a MS sample and adpted it slightly: I have only one class in a class library for which the assembly is signed:

<Assembly: AssemblyKeyFileAttribute("mykeys.snk")>

Here under is the code of my class.

Any help would be very much appreciated.

------------------------------------------------------

Imports System.Runtime.InteropServices
Namespace EventSource
Public Delegate Sub TestEvtDelegate(ByVal inPar As String, ByRef outPar As String)
Public Delegate Sub TestInEvtDelegate(ByVal inPar As String)



<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface evtContextWrapper
Sub TestEvt(ByVal inPar As String, ByRef outPar As String)
Sub TestInEvt(ByVal inPar As String)
End Interface




<ComSourceInterfaces("EventSource.evtContextWrapper, DotNetServerForComClient")> _
Public Class Class1
Public Event TestEvt As TestEvtDelegate
Public Event TestInEvt As TestInEvtDelegate
Private WithEvents myTmr As Timers.Timer
Public Function GetTime(ByVal ShowSeconds As Boolean) As String

Dim nm As Reflection.AssemblyName
nm = System.Reflection.Assembly.GetExecutingAssembly().GetName

If (ShowSeconds = True) Then
Return ".NET server, assembly name =" + nm.ToString + " Time is:" + Now().ToLongTimeString
Else
Return ".NET server, assembly name =" + nm.ToString + " Time is:" + Now().ToShortTimeString
End If
myTmr = New Timers.Timer(2000)
myTmr.Enabled = True
End Function

Private Sub myTmr_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles myTmr.Elapsed
Dim strOut As String
RaiseEvent TestEvt("Hello", strOut)
MsgBox("Hello " & strOut)
myTmr.Enabled = False
myTmr = Nothing
End Sub
End Class
End Namespace
--------------------------------------------------------

Michel
QuestionIn Code Behind, What is proper select statement syntax to retrieve the @BName field from a table? Pin
kenn_rosie8-Apr-06 17:04
kenn_rosie8-Apr-06 17:04 
AnswerRe: In Code Behind, What is proper select statement syntax to retrieve the @BName field from a table? Pin
kenn_rosie8-Apr-06 17:49
kenn_rosie8-Apr-06 17:49 
GeneralRe: In Code Behind, What is proper select statement syntax to retrieve the @BName field from a table? Pin
Colin Angus Mackay8-Apr-06 19:09
Colin Angus Mackay8-Apr-06 19:09 
QuestionPanel control movement problem Pin
MWashburn8-Apr-06 14:30
MWashburn8-Apr-06 14:30 
QuestionHow to Capture image from WebCam Or IP Camera Pin
WindDance8-Apr-06 2:12
WindDance8-Apr-06 2:12 
QuestionHow can Remoting From vb.net code Pin
Arag038-Apr-06 1:15
Arag038-Apr-06 1:15 
AnswerRe: How can Remoting From vb.net code Pin
Colin Angus Mackay8-Apr-06 19:11
Colin Angus Mackay8-Apr-06 19:11 
QuestionCrystal Report Problem Pin
microuser_20008-Apr-06 1:09
microuser_20008-Apr-06 1:09 
Questionsmall error Pin
Amit Agarrwal7-Apr-06 23:39
Amit Agarrwal7-Apr-06 23:39 
AnswerRe: small error Pin
Colin Angus Mackay8-Apr-06 0:01
Colin Angus Mackay8-Apr-06 0:01 
Questionplease help how to pass enter Pin
Amarni7-Apr-06 21:08
Amarni7-Apr-06 21:08 
AnswerRe: please help how to pass enter Pin
Chatura Dilan8-Apr-06 1:00
Chatura Dilan8-Apr-06 1:00 
QuestionDatareports in vb6 Pin
rais patel7-Apr-06 20:03
rais patel7-Apr-06 20:03 
AnswerRe: Datareports in vb6 Pin
Vikrant Badhai7-Apr-06 23:17
Vikrant Badhai7-Apr-06 23:17 
QuestionRepeater Control is not working Pin
Amit Agarrwal7-Apr-06 19:09
Amit Agarrwal7-Apr-06 19:09 
GeneralRe: Repeater Control is not working Pin
Guffa7-Apr-06 22:46
Guffa7-Apr-06 22:46 
GeneralRe: Repeater Control is not working Pin
Amit Agarrwal7-Apr-06 23:12
Amit Agarrwal7-Apr-06 23:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.