Results 1 to 7 of 7

Thread: Generating code(.dll), Ice integration problem

  1. #1
    Kruppy is offline Registered User
    Name: Yuri Krupp
    Organization: Eljaco Inc
    Project: Grid Query tool
    Join Date
    Aug 2005
    Location
    New York
    Posts
    32

    Generating code(.dll), Ice integration problem

    Hello,
    The project I am working on is the DLL with MFC used as a static library, also statically linked to third parties MFC extension libraries.
    Once I set Properties/Code Generation/Runtime library as Multi-threaded DLL, I have got many "...already defined in msvcrt.lib(MSVCR71.dll)" errors.
    How can I get Ice integrated?
    Thanks
    Yury

  2. #2
    beagles's Avatar
    beagles is offline Registered User
    Name: Brent Eagles
    Organization: Eagles Technologies Inc
    Project: Asterisk SCF
    Join Date
    Feb 2003
    Location
    Newfoundland
    Posts
    111
    What you are experiencing is the result of trying to link object files or libraries that were built using different runtime library settings. Ice is currently built as a DLL and uses the DLL version of the Microsoft runtime library and the static libraries you are using were likely built with the static version of the runtime library.

    How do you solve your problem? Sadly, the only thing I would suggest is to see if you can obtain DLL versions of the the third party MFC extensions and use the MFC DLL library instead. Depending on what your DLL is doing, this might be better for you in the long run anyway. As I recall, there are memory management issues with DLLs that use the static runtime library. Some of my colleagues have had some experience with this and may have some additional comments.

    Cheers,
    Brent
    Brent Eagles
    Digium/Eagles Technologies Inc
    St. John's, NL

    Project(s): Asterisk SCF

  3. #3
    Kruppy is offline Registered User
    Name: Yuri Krupp
    Organization: Eljaco Inc
    Project: Grid Query tool
    Join Date
    Aug 2005
    Location
    New York
    Posts
    32

    sample MFC client?

    Brent,
    Thank you for review.
    Do you have any sample MFC(GUI) client app wich integrates with Ice?
    Sincerely
    Yury

  4. #4
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    Have a look at the demo/Ice/MFC directory. That should get you started.

    Cheers,

    Michi.

  5. #5
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    As a warning the server demo has a big bug.

    You may not write to MFC UI objects in a thread other than main. This demo does exactly this -- since it writes directly to a CEdit in a method invocation on the hello object, and in the logger. The hello object method, if called as a result of an RPC, will always be called in a thread other than main. The logger methods may be called in a thread other than main.

    This bug is fixed in Ice 2.2.

    Regards, Matthew

  6. #6
    Kruppy is offline Registered User
    Name: Yuri Krupp
    Organization: Eljaco Inc
    Project: Grid Query tool
    Join Date
    Aug 2005
    Location
    New York
    Posts
    32

    MFC/Ice client implementation, smart pointer as member variable problem

    Thanks for response,
    One specific question:
    I have implemented the client integration the way MFC sample app does:
    the dialog box gets initialized with the connector pointer as a parameter, and the interface proxy is initializing within the OnInitDialog().
    The client basically creates the request and on ButtonClick() makes the server call to retrieve the response:

    m_Response = m_PrxExecutor->execute(request);

    Can the response object smart pointer be a dialog box's member variable in order to reuse the response in different scope? Or a copy of the underlying instance should be made?

    Once the response pointer is a member variable, I have an exception within ~Handle() ( hanlde.h ) when dialog box is closing. I assume some Object pointer exists, but not the object (and deletion cannot be made).

    Am I doing something wrong?

    Thank you in advance
    Yury

  7. #7
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    There is no reason why the smart pointer cannot be a member. As to why you get an exception in ~Handle, I'm not really sure. Did you try purify (or similar tool) to try to find a memory problem?

    If you post a self-contained complete example that demonstrates this problem we'll try to give you a hand.

    Matthew

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. is there a Ice Maven Integration?
    By martind in forum Help Center
    Replies: 2
    Last Post: 03-29-2009, 12:07 PM
  2. Ice-E problem with dll
    By Maestro Arohtar in forum Help Center
    Replies: 1
    Last Post: 04-02-2007, 12:11 AM
  3. Wrap ICE in a win32 dll problem
    By kinsung in forum Help Center
    Replies: 2
    Last Post: 02-07-2007, 11:55 PM
  4. Generating code from slice includes?
    By ctennis in forum Help Center
    Replies: 4
    Last Post: 06-09-2006, 09:26 AM
  5. Difference of ice code in dll or exe?
    By level in forum Help Center
    Replies: 4
    Last Post: 04-01-2004, 01:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •