COM on a 64-bit platform

I use a third-party COM library with C #, everything works fine on 32-bit XP. I use tlbimp to create a wrapper, add a link, everything works. However, when migrating to our server environment, which is a 64-bit version of Windows Server 2008, I came across a road block.

The code below works correctly when I right-click and validate it, that is, I execute it in the VS environment. The code does not work when compiling into a console application, and the code in the assembly does not work either in a test or in a call from a console application. In an attempt to get it working, I start as an administrator in a 32-bit command window - nothing is grouped anyway anyway, and an exception is not generated, which indicates that GrpSvr.GrpCall is a valid Com Library name.

    string sMessage = "no grouper";
    GrpSvr.GrpCall grouper = Activator.CreateInstance(
        Type.GetTypeFromProgID("GrpSvr.GrpCall")) as GrpSvr.GrpCall;
    if (grouper != null)
        sMessage = grouper.GroupInit(@"C:\CmdGrp.txt", true, true);

    Console.WriteLine(sMessage);
+3
source share
2 answers

Try using COM + as the host and save the application for 64 bits. For more information see this link.

+3
source

, COM DLL 32 . 32 , .

+2

All Articles