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

    Unhappy Confused about creating dll with Drawing library

    Hi,

    I have a program (Windows Form Project) which plots some points on a graph and then convert this graph as .bmp file and finally save this .bmp file in user defined path in PC. For sure I need System.Drawing, System.Drawing.2D for performing above functions.

    Now I am trying the include same functionality in .dll and integrate this dll in LabWindows(CVI) and TestStand. I am not been able to find a way to do that because:

    - If I try to make a new project of "Class Library" type then I can not incude System.Drawing and System.Drawing.2D in it.

    Can anyone please provide solution ot the problem? Does any one of you ever tried doing it and could resolve the issue?

    Regards
    Ricky

  2. #2
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: Confused about creating dll with Drawing library

    There should be no problem doing this (I have created .dll's using the System.Drawing namespace). What you need to do is:

    (1) First add a reference to System.Drawing. This tutorial should help (it's for VS, but if you use, say, SharpDevelop, it's approximately the same): http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx

    (2) Add this at the top of any class referencing System.Drawing functions:
    Code:
    using System.Drawing;
    using System.Drawing.Drawing2D;
    Does that help?
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #3
    Join Date
    Aug 2008
    Posts
    78

    Resolved Re: Confused about creating dll with Drawing library

    Thanks BioPhysEgnr. It worked!
    I did not even think of doing it.

  4. #4
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: Confused about creating dll with Drawing library

    Great! Yeah, linking in external libraries in a new programming language is always confusing the first time.
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

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