DLL call in C COM Client

This is a discussion on DLL call in C COM Client within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I'm using a C# dll (as a COM onject) from a C++ unmanaged code. The compiler is the C++ ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    58

    DLL call in C COM Client

    Hi,
    I'm using a C# dll (as a COM onject) from a C++ unmanaged code. The compiler is the C++ of Visual Studio 2008. It works fine.
    I want now to replace C++ code with C and I get the "include" and "using" statements not supported by my imposed (i.e. change the source file type to .c instead of .cpp) compiling.
    Again the dll is perfectly seen and used by C++. I just I'm missing the dll (under COM model) import declarations in C; long time ago i knew it ...
    Thanks for your help.

    PS: It's about the COM model!

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,853
    do you mean?

    Code:
    //in DLL header (not to be included in the calling app) 
    
    #define DLLExport __declspec(dllexport)
    
    //in header (to be included in calling app and DLL) containing funtions
    // 'if not defined' allows the same header to be used in both
    // if include order is correct in DLL
    
    #ifndef DLLExport 
    #define DLLExport __declspec (dllimport)
    #endif
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. temperature sensors
    By danko in forum C Programming
    Replies: 22
    Last Post: 07-10-2007, 07:26 PM
  2. DLL call - Think I'm close
    By jamez05 in forum Windows Programming
    Replies: 2
    Last Post: 12-13-2005, 01:52 PM
  3. Function Call From DLL
    By (TNT) in forum Windows Programming
    Replies: 5
    Last Post: 05-05-2002, 09:33 PM
  4. Assembly example
    By Lynux-Penguin in forum C Programming
    Replies: 6
    Last Post: 04-24-2002, 07:45 PM
  5. How do I call this function in my client file?
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 09-28-2001, 03:55 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21