Click here to Skip to main content
15,913,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: Alphanumeric counter Pin
Christian Graus19-Jul-05 10:57
protectorChristian Graus19-Jul-05 10:57 
Generalwebrequest problem Pin
cakewalkr719-Jul-05 4:59
cakewalkr719-Jul-05 4:59 
GeneralRe: webrequest problem Pin
cakewalkr719-Jul-05 5:55
cakewalkr719-Jul-05 5:55 
Questionhow to raise sql messages in c# Pin
fady_sayegh19-Jul-05 4:58
fady_sayegh19-Jul-05 4:58 
AnswerRe: how to raise sql messages in c# Pin
Not Active19-Jul-05 5:57
mentorNot Active19-Jul-05 5:57 
GeneralExcel automation Pin
Christer Claesson19-Jul-05 4:37
Christer Claesson19-Jul-05 4:37 
GeneralProblem with a dynamically loaded DLL Pin
chrismetcalf19-Jul-05 4:00
chrismetcalf19-Jul-05 4:00 
GeneralCOM Events with C# Pin
skai00719-Jul-05 3:31
skai00719-Jul-05 3:31 
Hello,

i have a problem with Events ....
i have to use C# and send events to a COM interface
i would like to activate this events by this C#.dll or also through the same COM interface
the COM comunications works but it dosn't fire an event ...
for the test i use a client written in VB6
i would be nice when you can me give any help
(i working with .NET 2003 / VS6.0 on a XPpro)

i have the feeling that ACCOMEvt(src, DateTime.UtcNow); dosn't work rigth ...


here my Code for the server:

using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace ACEvt
{
public delegate void ACDelegate(string Source, DateTime TimeStamp);

[Guid("AC4C1820-04B6-4988-928F-FD858B95C880")]
public interface ACCOMInterface
{
[DispId(1)]
DateTime getACTimestamp();
[DispId(2)]
void ActivateACCOMEvt(string source);
}

[Guid("ACC976E0-C208-4740-AC42-41212D3C34F0"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ACCOMEvents
{
void ACCOMEvt(string src, DateTime TimeStamp);
}

[Guid("AC5E5FB2-219D-4ee7-AB27-E4DBED8E123E"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(ACCOMEvents))]
public class ACCOM : ACCOMInterface
{
public event ACDelegate ACCOMEvt;

public ACCOM()
{
//must be empty !!!!
}
public DateTime getACTimestamp()
{
MessageBox.Show("getACTimestamp");
return DateTime.UtcNow;
}
public void ActivateACCOMEvt(string src)
{
MessageBox.Show("ActivateACCOMEvt");
ACCOMEvt(src, DateTime.UtcNow);
}

}
}

and the VB6 Client without the form:

Option Explicit
Dim WithEvents bmw As AC_Evt.ACCOM

Private Sub Form_Load()
Set bmw = New AC_Evt.ACCOM
End Sub

Private Sub TimeStampBtn_Click()
EvtLst.AddItem bmw.getACTimestamp(), 0
End Sub

Private Sub ActEvtBtn_Click()
bmw.ActivateACCOMEvt ("ActEvtBtn")

End Sub

Private Sub bmw_ACCOM_Evt(ByVal src As String, ByVal Timestamp As Date)
EvtLst.AddItem ">" & src & " " & Timestamp, 0
End Sub

skai007
GeneralControl Level Transparency Pin
Jaswinder Singh Kohli19-Jul-05 3:12
sussJaswinder Singh Kohli19-Jul-05 3:12 
GeneralRe: Control Level Transparency Pin
Roger Alsing19-Jul-05 3:35
Roger Alsing19-Jul-05 3:35 
GeneralUpdate Row Pin
zaboboa19-Jul-05 2:53
zaboboa19-Jul-05 2:53 
GeneralRe: Update Row Pin
Luis Alonso Ramos19-Jul-05 17:38
Luis Alonso Ramos19-Jul-05 17:38 
Generalcreating transparent window problem Pin
Member 161799919-Jul-05 2:42
Member 161799919-Jul-05 2:42 
GeneralRe: creating transparent window problem Pin
User 665819-Jul-05 4:40
User 665819-Jul-05 4:40 
GeneralRe: creating transparent window problem Pin
Member 161799919-Jul-05 4:47
Member 161799919-Jul-05 4:47 
GeneralThreads Pin
deeps2619-Jul-05 2:39
deeps2619-Jul-05 2:39 
GeneralRe: Threads Pin
maheswara19-Jul-05 2:57
maheswara19-Jul-05 2:57 
GeneralRe: Threads Pin
S. Senthil Kumar19-Jul-05 7:01
S. Senthil Kumar19-Jul-05 7:01 
Questionfill listview in different class and file? Pin
oleman10819-Jul-05 2:18
oleman10819-Jul-05 2:18 
GeneralComboBox Event Pin
zaboboa19-Jul-05 2:03
zaboboa19-Jul-05 2:03 
GeneralRe: ComboBox Event Pin
maheswara19-Jul-05 2:38
maheswara19-Jul-05 2:38 
QuestionComplete this program-- New bie to FileStream ? Pin
cyberiafreak19-Jul-05 1:29
cyberiafreak19-Jul-05 1:29 
AnswerRe: Complete this program-- New bie to FileStream ? Pin
Dan Neely19-Jul-05 2:10
Dan Neely19-Jul-05 2:10 
AnswerRe: Complete this program-- New bie to FileStream ? Pin
maheswara19-Jul-05 2:14
maheswara19-Jul-05 2:14 
GeneralRe: Complete this program-- New bie to FileStream ? Pin
Anonymous20-Jul-05 21:01
Anonymous20-Jul-05 21:01 

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.