Re: COM Interop Problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Actually I take that back. I finally found it and here is what I get when i
run the command he gave me.

error CS5001: Program 'c:\Source\Temp\C#-COM TESTS\COM Tests\COM
Server\validation.exe' does not have an entry point defined

Now, I have a project called "COM Server" and a unit called validation.cs
that is part of that program that actually contains all the code I sent you
earlier.

The above error is the result of running: csc validation.cs /r:System.dll

and I ran from the main source folder not the location where the dll exists
in debug.

Should VS 2003 already be doing these steps for me or is it required for me
to run this at the command line each time I want to compile a COM server
written in C#?

I still can not get this COM Server installed into Delphi...

P.S. Thanks for all your assistance and patience with me...

Thanks,

glenn


"glenn" <ghan***@xxxxxxxxxxxxxxxxxx> wrote in message
news:Oq2RgBGPFHA.2568@xxxxxxxxxxxxxxxxxxxxxxx
> I tried but don't know file to open in order to do this.
> I have never used that program before so not really sure what its doing
> yet...
>
> Also here is the total source for the server:
>
>
> using System;
>
> using System.Text.RegularExpressions;
>
> using System.Reflection;
>
> //[assembly:AssemblyKeyFile("KeyFile.snk")] this is actually provided
for
> in the assemblyInfo.cs file so its been done but over there
>
> namespace COM_Server
>
> {
>
> /// <summary>
>
> /// Summary description for validation.
>
> /// </summary>
>
> public class validation
>
> {
>
> public validation()
>
> {
>
> //
>
> // TODO: Add constructor logic here
>
> //
>
> }
>
>
> public bool IsPhoneNumber( string s )
>
> {
>
> return Regex.IsMatch(s,
>
> @"^(((\(\d{3}\)( )?)|(\d{3}( |\-)))\d{3}\-\d{4})$");
>
> }
>
>
> public bool IsZipCode( string s )
>
> {
>
> return Regex.IsMatch(s, @"^((\d{5})|(\d{5}\-\d{4}))$");
>
> }
>
>
> public bool IsSSN( string s )
>
> {
>
> return Regex.IsMatch(s, @"^\d{3}\-\d{2}\-\d{4}$");
>
> }
>
>
> }
>
> }
>
>
> I then compiled and ran regasm mycom.dll /tlb and it did add it to the
type
> library list for COM objects because I can pick it to load into Delphi...
> But I can't compile due to the other things I had listed earlier...
> I also tried to import into delphi via the type library itself (tlb file)
> but received the errors about it not being valid...
>
> Thanks,
>
> glenn
>
> "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
> news:OA3QS3FPFHA.2468@xxxxxxxxxxxxxxxxxxxxxxx
> >
> > "glenn" <ghan***@xxxxxxxxxxxxxxxxxx> wrote in message
> > news:ub$zWMFPFHA.3788@xxxxxxxxxxxxxxxxxxxxxxx
> > > Here is the line of code from C#...
> > >
> > > object user = secure.m_getloggedinuser();
> > >
> > > When that executes I get :
> > >
> > > Loaded 'c:\source\temp\c#-com tests\com tests\com
> > > client\bin\debug\interop.ssisecure.dll', No symbols loaded.
> > >
> > > The program '[3700] COM Client.exe' has exited with code 0 (0x0).
> > >
> > > The COM server is responding with a variant type that is cast to a
> string
> > > in
> > > all my other clients. Here it appears I'm missing a step but I've
> > > followed
> > > the instructions in the book...
> > >
> > > Thanks,
> > >
> > > glenn
> > >
> > >
> >
> > I was talking about the COM server code, not the client part.
> > Did you try to run ildasm on the interop library to check the method
> > signature?
> >
> > Willy.
> >
> >
> >
>
>


.


Quantcast