CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    3

    A Win32 Dll Question

    Dear All:
    I using MFC 6.0 to build a "Win32 Dynamic Link Library", and output "a.dll, a.lib" files . The dll file exports functions to used.
    After finished it , I use "a.dll a.lib a.h" in another MFC project and build an .exe file correctly(the exe file is build with "using MFC in static lib"). It works well in my OS , and I can use the .exe to control an instrument.

    Problem occur:
    If I use debug mode to create dll & lib file, and using the two files to buile the .exe file, it work will in my OS and another OS(the new OS doesn't install VC 6.0).
    But if I use released mode to create dll & lib file, and using the two file to build .exe file, it's just work will in my OS, not in the new OS.

    What is the problem!? Please help me~~ ><

  2. #2
    Join Date
    Oct 2000
    Location
    India
    Posts
    4,620

    Thumbs up Re: A Win32 Dll Question

    Hi,

    What do u mean by "It will not work in the other OS" ? Please check if you
    have the same project settings for the "Release" build and the "Debug" build.
    You might have forgotten to set the option "using mfc in static lib".

    Secondly, if you dont want to do a static build, Run the "Depends" tool
    a.k.a. "Dependency Walker" to identify the DLLs needed for your application.
    Distribute the DLLs along with your application. Mostly, u just need to
    distribute the MSVCRT.DLL and the MFC42.DLL along with your app.
    All luck and have a great day.

    Regards,
    V.Girish

    Visit www.geocities.com/contactgirish for Source code, Tutorials, FAQs and Downloads.

  3. #3
    Join Date
    Jun 2006
    Posts
    3

    Smile Re: A Win32 Dll Question

    Hi
    Thank for your help! I build my project in computer A, and I copy the project generate .exe file and all need dll files to computer B(new OS install window2000 only).
    The question I have meat is:
    If I use debug mode to create dll & lib file, and using the two files to buile MFC .exe file, it work will in my OS and another OS(the new OS doesn't install VC 6.0).
    But if I use released mode to create dll & lib file, and using the two file to MFC .exe file in the same project , it's just work will in my OS, not in the new OS.

    The main UI doesn't appear in the screen, just pop up a message box say:
    Program Error:
    a.exe has generated error and will be close by Windows,You will need to restart your program.

    What is the problem!?


    2. I have try to build my dll file in "MFC App Wizard" using "regular dll with share MFC dll", it's work will in my OS and New OS whether the dll bulid condition.

    Because the dll file export functions doesn't use MFC dll file, and the same dll file will be used in other language(like VB), so I want to build the dll file without MFC.

    Anyway, thanks for your kindness help!

  4. #4
    Join Date
    Jun 2006
    Posts
    3

    Smile Re: A Win32 Dll Question

    I have find the answer! There is a mistake in my program. Thanks ~

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured