# Linkage confusion

**URL:** <https://www.ruby-forum.com/t/linkage-confusion/206808>\
**Category:** wxRuby\
**Created:** [May 10, 2011, 10:46pm UTC](https://www.ruby-forum.com/t/linkage-confusion/206808 "2011-05-10T22:46:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [May 10, 2011, 10:46pm UTC](https://www.ruby-forum.com/t/linkage-confusion/206808/1 "2011-05-10T22:46:19Z")

</div>

In the printinglrb sample a code line says dc= get\_dc;

I have searched my ruby installation for a get\_dc method and found it  
nowhere except in printing.rb.  
I do find a getdc in Petazold.

After the dc =get\_dc line in ruby there are a lot of dc references.  
like

```
dc.set_background(Wx::WHITE_BRUSH)
dc.clear()
dc.set_font(Wx::get_app.test_font)

dc.set_background_mode(Wx::TRANSPARENT)

```

If I understood the ruby definition of the dc object I might understand  
the  
rest of this code. For your information, I have coded thousands of  
lines  
using the Microsoft interface. I have created many windows and many  
text  
and graphic files which I sent to the printer. My confusion is with  
the  
ruby implementation, not with the process itself.

Since I cannot find a ruby or wxruby reference, is there some magic  
linkage  
to some windowd dlls or some ther  
mechanism that I do not understand?

> From what I get from reading the code, ruby is presenting me with a cleaner  
> way to process printing, windows, and dialogs. I just need to be able  
> to  
> sync into it better.

I had expected this routine to be defined in Wx::DC.I downloaded the  
wxruby  
source and looked in dc.rb. I did not find get\_dc or the dc.xxx  
refernced  
above. I I also did not find it in any on-line documentation that I  
looked  
at.

Help. I don’t understand something.
