This particularly rapid, unintelligible patter

But there’s one other guaranteed shock-maker in the theater these days. That’s what happens when a particular, implicit covenant between theatermakers and theatergoers — one that exists even to this day — is violated. I mean the promise that no matter what’s presented onstage, you’ll be let off the hook at the end with some sort of reassurance or release, a sense of redemption or catharsis. When that release is denied — at least when it’s denied by artists in full control of their powers — audiences inevitably get angry.

Ben Brantley, chief theater critic, New York Times

Blooming

When I’m hard up for inspiration or peace, I occasionally I need to read Ivan’s words. Ivan Tcherepnin was a music professor who provided me this handout maybe 25 years ago. It’s here for the artists who might be further unlocked by his words.


 

I am not Allah
and cannot make you become composers
—I can’t even try, since that is up to you

I assigned John Cage first, because he, more than any other composer,
writes in a lucid way how ANYone can be a composer
like MCDC saying, “Anything is beautiful if you think it is”
or Wittgenstein, “Beauty is in the use of our clickers”
It takes lots of work, discipline and persistence and self-honesty
to even GET to the place where a composition idea of value can be discovered

If friends asked you about your courses during vacation
and you were talking about the composition class
you would say that you studied melodies, phrasing and modes
The interrelation of text, melody and rhythm
the combination of several voices in polyphony
the use of the canon as a tool to organize multiple voices
the emergence of harmonic progressions from polyphony
and development of themes based on harmonic progression
the use of periods and sentences as tools to organize musical ideas (motives)
you were given oodles of music, music to study for technical and/or inspirational purposes
and so on.

You heard about the existence of a cave
or mine shaft to which composers, after much digging,
have access (not guaranteed to find anything in there, either)

You have listened to your own work and seen yourselves in the mirror of your music
and found the mirror to be uneven, sometimes opaque—
requiring more practice, more tooling, more facility
But beware. The tools, the facility, the techniques are not the goal
at best they can be facilitators; at worst deceivers, creators of an illusion
that you are able to compose without the most essential factor present
which has no name, no shape, no presence aside from your own consciousness and spirit

Whether it is Cage saying, “Hey, no sweat, anyone can do it, it’s free, it’s fun” or Schoenberg saying, “You have miles to go before you can even imagine what composition is all about, and even then, you will be light years away from knowing enough of the literature to create anything faintly original”

the art is in your hands, and through your awareness and craft alone will you create something
which can begin to breathe life, communicate awareness and transport the listeners

In some cases, you would do better to let go of wanting to master traditional practices and try to invent your own wheels; in other cases, that would be too much to ask to unlearn for the sake of music

In any case, you should always get back to basic human needs, primal feelings, unlearned patterns of perception and cognition, principles of life on the surface of the earth in this epoch, at the twilight of the 21st Century

too much looking back or fascination with the past is dangerous

better to leapfrog over the civilized past, leap back and forth between different parts of the earth, separated by time and place

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

this is a prelude to the Modal Modules, which focus, as did canon, on a technical, theoretical means to organize multiple voices in musical compositions
There is no substitute for your own experimentation, mentation and persistent, disciplined digging into the musical earth

—Ivan Tcherepnin

What will the Professor say today?

Now’s as good a time as any to start blogging again. What with Facebook and all the new new forms of 140-character communication, this dust-smelling form seems practically retro only a few years after its inception. Conveniently, this means that my parents have probably stopped reading this, and I can be a little more simple and direct. Anyway, I think most ideas worth repeating deserve more than 140 characters.

I woke up this afternoon. My sleep schedule has rotated severely with my work on this new musical, Zombie Vixens from Hell. As so many other people did, I read the dreadful news about the shootings in Colorado, and this in turn led me to do as much research as I possibly could about lone wolf terrorists in one hour. This search led me to read this interesting document, which describes the Internet as a fresh source of power for such terrorists. I think the Internet is awesome and wonderful. But I have seen a frightening tendency among my friends and me of only wanting to interact on the Internet with people who share our point of view. I find myself reaching for the Unfriend button on Facebook when someone has an opinion that disagrees with mine, and I’ve seen nearly all of my friends do the same. Which brings up the interesting question: What is it about us that makes us only want to interact with people who share our points of view? What about the Internet makes us more closed-minded, not less?

Here’s a completely unsupportable supposition that will, I think, demonstrate its own truth in time: James Holmes made posts in some back shithole of the Internet, describing whatever outrage he felt the need to avenge. And the kicker will be, of course, that he found support and encouragement there.

I think that Facebook is enemy number one in this regard. Facebook tracks every click we make, and little AI gremlins watch us, and determine what we should see next. And Facebook thinks that what we want to see is content from people who share our points of view, whether we’re birthers or Green Party or vegetarians or corrective makeup artists. Newspapers are clearly on their long slow slide into irrelevancy, but newspapers did something very very important for us: they made us read opinions that we didn’t automatically agree with. Facebook has no qualms about feeding our little cocaine monkey brains only what makes us happy; i.e. that which does not challenge our world view.

I make a point of trying to read as many news sources as possible. Each morning I read at least the front pages of the New York Times, the Los Angeles Times, Gamasutra, National Review, The Economist, Gamesindustry.biz, Huffington Post, MCV UK, Slashdot, The Daily Pilot, and the OC Register. I read the Register mostly for comic relief; it’s also fun to play the game of Find The Spelling Or Usage Error Of The Day with the Register. It has been pointed out to me that I read at an unusual speed.

This reading list forces me to be exposed to opinions that I do not automatically agree with. I am hoping there’s some therapeutic value. Lifting weights makes you stronger.

I’m so ronery

“Such Biggest Loss Can’t Happen, Unbelievable”

Pyongyang, December 19 (KCNA) — Kim Jong Il, general secretary of the Workers’ Party of Korea, chairman of the DPRK National Defence Commission and supreme commander of the Korean People’s Army, passed away from a great mental and physical strain at 08:30 December 17, 2011, on train during a field guidance tour.

His picture makes everyone feel pangs of compunction as he made long journey of field guidance, going in his field jacket all his life.

He had inconvenient naps and simple rice-balls in cars or on trains while making the journey of field guidance for the country’s prosperity and people’s happy life, not even taking a day off.

Mourners cried in chocking voices, “General, you have had pain only for people all your life”, “How can you, General, pass away so early leaving us behind?”, “We have not fulfilled our obligation”.

They are shedding bitter tears, their knees on the ground, as they courageously weathered out stern adversities, trusting him only and holding him in high esteem as the sun of destiny and father.

They are throwing themselves into each other’s arms and wailing over his death, saying it was just a few days ago when they saw him full of bean.

They are getting the paved stones drenched with tears, feeling so regrettable as they can no longer see him whose smile was as broad as sunshine.

“Let us work harder”-this is the call they are shouting from the bottom of their hearts.

Saying he considered the people’s joy as his pleasure and happiness, he visited a lot of units related to the improvement of the standard of people’s living including the Meat and Fish Shop in Pothongmun Street, Pothonggang Shop, the shop producing wheat cakes stuffed with meat of the Kumsong Foodstuff Factory and the commodity exhibition of Pyongyang Department Store No. 1.

Workers of the February 8 Vinalon Complex, the Hungnam Fertilizer Complex and the Ryongsong Machine Complex called Kim Jong Il in chocking voices again and again, showing the vinalon fiber, a heap of fertilizers and latest geothermal facilities which pleased him so much.

Standing in the van of the Korean revolution at present is Kim Jong Un, great successor to the revolutionary cause of Juche and outstanding leader of our party, army and people.

Who is the last laughter? No one in the world can beat the man ready to die. With such pluck and gut Kim Jong Il made trips to inspect the front.

All sentences copied verbatim from Korean Central News Agency of Democratic People’s Republic of Korea, December 17-21, 2011 Juche 100.

Here comes the sun, and I say

Here’s a little retroactive technical support, for those engineers and programmers who are living backwards through time.

If, while attempting to boot an early model Sun SPARCstation, you get the message:

Can't clear ESP interrupts: Check SCSI Term, Power Fuse.

then make sure that all SCSI devices are powered before turning on the SPARCstation. (In other words, turn on your CD-ROM drive.)

Through many dangers, toils and snares

On a warm green planet spinning around a minor Antares sister star, there lives a race of intelligent beings. They think, communicate, and scheme. Their technology is so sublime that any human being witnessing it could only comprehend it as magic. As do all advanced technological species, this race has a sense of humor tending toward the cruel. They do not refer to themselves by any name, so we’ll have to call them Zees.

Looking through the meson scope, Zee One spots our cool blue globe. Zee One thinks, “Check out these entities! Some technology they have, some art they have, but gullible, yes?”

Zee Two squints through the scope. Zee Two thinks, “Gullible, yes.”

Zee One thinks, “Of course they are. They believe that an abstract, all-encompassing, all-loving, all-knowing Entity created them. And they further believe that they can communicate directly with Him.”

Zee One and Zee Two have the same thought at the same time. Zee Two grabs his protonizer and follows Zee One into the warp chamber.

They arrive at Earth as you are walking through the forest, enjoying the splendor of creation around you. Zee Two hides behind a tree and zaps Zee One with the protonizer. When you come upon Zee One, he is a familiar form: a bearded figure of infinite patience and love, in glowing white robes, perhaps with man-made scars in his hands and feet.

“I have returned!” says Zee One. Zee Two stifles a huge cackle.

“Odd,” you say. “You don’t look exactly the way I expected my Deity to look.”

“But the Deity I am!” Zee One retorts. “Behold!”

Zee Two spins his protonizer on a nearby stream and the water hisses and bubbles until it becomes a jolly little river of Chateauneuf-du-Pape.

“An excellent vintage,” you say, “but I am not quite convinced that you are my Deity.”

Zee Two turns his protonizer on a clump of fallen branches. The branches wiggle into life, and become a twisty mass of black snakes. The snakes wiggle and hiss, spinning themselves in the air to lift and support one another. They form themselves into the letters HE’S REALLY GOD, with an earthworm representing the apostrophe.

“Your snakes spell precisely,” you say, “but I am not quite convinced that you are my Deity.”

Zee Two points his protonizer heavenwards as Zee One beckons convincingly. As you watch, the sky turns blood-red as clouds of methane streak across the horizon. The sun is blotted out as forks of green lightning crash overhead. As the sun goes, utter darkness instantly falls across the forest. Zee One holds the darkness for a few seconds for the correct dramatic effect, then in a microsecond, restores the sky to day blue.

“I was blind but now I see,” you say, blinking a little, “but I am not quite convinced that you are my Deity.”

You are in the forest, enjoying the splendor of creation around you, in the presence of a being that may or may not be your Deity.

And so I ask you: how can you determine your truth?

And so I ask you: when you leave the forest and tell us your story, how can you convince us that what you experienced was true?

And I’m so sad, like a good book

Recently, I’ve been reading Grimm Fairy Tales to get to sleep. Here’s a new story for you in their style. Like all fairy tales, half is new and two-thirds is borrowed.

“Pasalo and Shala”

There was a handsome and hardworking farm boy. Because his hair was bright as gold, he was called Pasalo (“gold-headed boy”). Pasalo woke one morning to hear beautiful singing. As he went to the road, he saw a pretty girl singing while she carried pails of milk to town. Pasalo went to her. Her name was Shala (“nightingale”), and her pails were heavy, and she sang to lighten the load. Pasalo carried her pails for her. After walking a mile or two, they fell in love, and Pasalo promised to marry Shala.

Whereupon an enchantress swooped down upon them, bearing a gilded bird cage. She had heard Shala singing too. The enchantress raised her dark cloak and turned Shala into a nightingale; and the enchantress stole the nightingale into her cage. The enchantress cursed Pasalo, and he was frozen as stone, and could not move. The enchantress flew away, and Pasalo collapsed, free of the curse.

“I will bring my love back,” thought Pasalo. He got his pitchfork and went to the great dark castle on the hill where the enchantress lived. Through the top window he could hear the nightingale singing in the gilded cage. A great gargoyle perched on top of the castle. Pasalo attacked it with the pitchfork. The gargoyle laughed, snapped the pitchfork easily between his teeth, and pressed Pasalo to the ground with one claw. The gargoyle said, “You may not enter the castle unless you show me the most beautiful thing in the world.” He let Pasalo up. Sad and beaten, Pasalo walked down the hill.

As Pasalo returned to his farm, he spied a wise old fox, fainted from pain and hunger. “The enchantress has injured me,” said the fox. “Heal me, and I will help you.” Pasalo fed the fox chicken and let him heal in his bed. When the fox was well, the fox bowed and said, “How may your love be returned?”

Pasalo said, “The gargoyle said, I may not enter the castle unless I show it the most beautiful thing in the world.”

“Ah,” said the fox. “It has never been done before, but it may be done yet. You must first find the place where water turns to air. Then, you must pass the unpassable door. There, you will find the most beautiful thing in the world.” Pasalo asked the fox what he meant, but the fox sprang out the window and ran away.

For many years, Pasalo searched for a place where water turns to air. He searched many countries, many towns and many forests, but he could find no such place. He endured many misfortunes, and his hair turned from gold to silver and then to gold again with the effort. At last, when he could go no further, he collapsed by the top of a waterfall. “I shall never find the place where the water turns to air,” said Pasalo.

Pasalo looked over the cliff, and found that he had walked all the way to the edge of the earth. Pasalo watched as the river drifted off the earth, and the water cascaded into infinite sky, and the river came to reform as clouds above the earth. “Is this the place the fox spoke of?” said Pasalo.

Pasalo was dry, so he put his face in the river to drink. As he did so, underneath the surface of the water, he could see clearly. Upside down, he saw an underground cave. He climbed through the water’s surface, pulled himself onto a ledge, and stood. Pasalo saw an underground passageway. A river flowed at his feet, the sun shone brightly through the river, and the light danced on the cavern ceiling.

“I can breathe in here,” said Pasalo, “and thus have I seen water turn to air!” Pasalo followed the river of light until he came to a small shore of sand before a great hewn wall. There was a single door in the wall. On the door, in red, were the following letters:

THE UNPASSABLE DOOR.

“Not unpassable for me,” said Pasalo, but though he beat, shoved and pried at the door, it would not move a bit. Pasalo slumped on the sand, dejected. As he sat on the sand, he could see a faint light under the door. Pasalo said, “If I might not pass through it, I might pass under it,” and dug sand from under the door. At last he removed enough that he could slide himself underneath the door.

When Pasalo emerged, he saw a vast and rich treasure room with every imaginable kind of wealth: rubies, emeralds and diamonds as big as porcupines, beds and sheets and linens spun of pure gold, encrusted crowns and swords and staves, each one more exquisite than the last. “Everything here is a wonder, and there are so many wonders here,” said Pasalo. “How can I possibly choose the most beautiful thing?” As he said this he spied a single tulip growing in a patch in the corner. A single droplet of dew sparkled from the center of the tulip. As Pasalo took the flower, a spell lifted and all the jewels and fineries were revealed as rocks and wood.

“All my treasures are vanished,” said Pasalo, “but at least I have this.” Pasalo went back under the impassable door, through the river of light at the edge of the world, and over many many miles to the dark castle on the hill.

The gargoyle glowered at him. “You may not enter the castle unless you show me the most beautiful thing in the world.”

Pasalo showed the beautiful tulip with the droplet of dew. The gargoyle laughed and said, “I tell you to show me the most beautiful thing in the world, and you show me a simple common flower?”

Pasalo said, “No. I have travelled far and wide over many years, and I have seen the edge of the earth. I have traversed the place where water turns to air, and passed the impassable door. I have rejected every earthly treasure to find this tulip and bring it here, but not to you. Please give it to Shala the nightingale on my behalf, and tell her that I love her, and always will.” Whereupon the gargoyle bowed deeply and permitted Pasalo to enter.

Pasalo ran to the top window. He saw the dark enchantress dangle the gilded cage out of the window with one arm, with Shala the nightingale therein. “If you come at me, I’ll dash your nightingale to the rocks below,” said the enchantress, “and that will be the end of your true love.” Whereupon, from outside the window, the gargoyle seized the cage and the enchantress’s arm with it, and pulled them both outside the window. The enchantress swang from the teeth of the gargoyle. The gargoyle gave a small chomp, and the enchantress (less one arm) fell twenty stories to the sharp rocks below. As she died, the sun lifted, and roses climbed the walls of the castle.

Pasalo despaired of Shala the nightingale in the jaws of the gargoyle, when the gargoyle placed his great head in the window and smiled. Through his teeth stepped Shala. The curse was lifted, and she was as beautiful as the day when Pasalo first saw her. They were married and lived happily in the castle with the great gargoyle guarding them; the last I heard, the three live there still.

There’s no leaving here; ask, I’m an ear

There?s a great deal of existing rendering code built on old versions of Microsoft’s Foundation Class (MFC) model. In the old object model, you had a single CFrameWnd, a single CDocument, and one or more CView classes that were owned by the CFrameWnd class. These objects share message routing responsibilities with one another, and a great deal of code has been written with these assumptions.

Fast forward twenty or so years, and these old assumptions, upon which most of MFC was originally architected, are incompatible with the complexity of modern user interface design, and even a good deal of modern-day MFC itself. There can be multiple documents, controls floating and tabbed which may or may not be children of the CFrameWnd.

The funky new display and interface features like CDockablePane and CMFCToolBar don’t know anything about the CView class, and they don’t inherit from CView. It’s hard to upgrade an older application written based on the old MFC document-view model to dockable panes.

It?s a bit of work, but here’s one way to accomplish this without relying on proprietary libraries. The basic strategy we use is to change the old CView-based classes to be a subclass of CDockablePane, and then make the new class support enough of the major CView features in order to handle update rendering, commands, OLE drag and drop, and user-interface updates via the old interfaces in your old class.

In order to convert your own subclass of CView into a CDockablePane subclass, here’s what you need to do:

1. Create a new subclass of CDockablePane (we’ll call it CYourDockablePane) from which all your old CViews will inherit.
2. Implement update message handling and OLE support from your CYourDockablePane subclass.
3. Subclass COleDropTarget into a new class which we’ll call CYourOleDropTarget in order to handle OLE drag-and-drop in the manner that CView does.
4. Add features to your C*FrameWnd* class to support window updating and command message routing to the new panes.

 


 

YourDockablePane.h:

//------------------------------------------------------------------
#pragma once

#include "YourOleDropTarget.h"

class CYourDockablePane : public CDockablePane
{
	DECLARE_DYNCREATE(CYourDockablePane)

public:
	CYourDockablePane();
	virtual ~CYourDockablePane();

	// These are needed to get around OnUpdate()?s protected status
	virtual BOOL ReceiveNotification(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	virtual void OnUpdate( CView *pSender, LPARAM lHint, CObject *pHint );

	// Simulate CView OLE drag and drop effects
	virtual DROPEFFECT	OnDragEnter( COleDataObject *pDataObject, DWORD dwKeyState, CPoint point );
	virtual void		OnDragLeave( void );
	virtual DROPEFFECT	OnDragOver( COleDataObject *pDataObject, DWORD dwKeyState, CPoint point );
	virtual DROPEFFECT	OnDropEx( COleDataObject *pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point );
	virtual DROPEFFECT	OnDragScroll( DWORD dwKeyState, CPoint point);
	virtual BOOL        OnDrop( COleDataObject* pDataObject,	DROPEFFECT dropEffect, CPoint point);

protected:
	DECLARE_MESSAGE_MAP()

	// View classes know how to do this
	virtual CYourDocument *GetDocument(void) const;
	CYourOleDropTarget	m_OleDropTarget;

public:

};



YourDockablePane.cpp:
/---------------------------------------------------------------------
// YourDockablePane.cpp : implementation file

#include "stdafx.h"
#include "YourDockablePane.h"

IMPLEMENT_DYNCREATE(CYourDockablePane, CDockablePane)

CYourDockablePane::CYourDockablePane()
{

}

CYourDockablePane::~CYourDockablePane()
{
}


BEGIN_MESSAGE_MAP(CYourDockablePane, CDockablePane)
END_MESSAGE_MAP()

CYourDocument * CYourDockablePane::GetDocument( void ) const
{
	CDocTemplate* pDocTemplate;
	POSITION pos;
	pos = AfxGetApp()->GetFirstDocTemplatePosition();
	pDocTemplate = AfxGetApp()->GetNextDocTemplate(pos);
	pos = pDocTemplate->GetFirstDocPosition();
	return (CYourDocument*) pDocTemplate->GetNextDoc(pos);
}

BOOL CYourDockablePane::ReceiveNotification( WPARAM wParam, LPARAM lParam, LRESULT* pResult )
{
	return OnNotify( wParam, lParam, pResult );
}

DROPEFFECT CYourDockablePane::OnDragEnter( COleDataObject *pDataObject, DWORD dwKeyState, CPoint point )
{
	return DROPEFFECT_NONE;
}

void CYourDockablePane::OnDragLeave( void )
{

}

DROPEFFECT CYourDockablePane::OnDragOver( COleDataObject *pDataObject, DWORD dwKeyState, CPoint point )
{
	return DROPEFFECT_NONE;
}

DROPEFFECT CYourDockablePane::OnDropEx( COleDataObject *pDataObject, DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point )
{
	return DROPEFFECT_NONE;
}

DROPEFFECT CYourDockablePane::OnDragScroll( DWORD dwKeyState, CPoint point )
{
	return DROPEFFECT_NONE;
}

BOOL CYourDockablePane::OnDrop( COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point )
{
	return false;
}

void CYourDockablePane::OnUpdate( CView *pSender, LPARAM lHint, CObject *pHint )
{

}



YourOleDropTarget.h:
/------------------------------------------------------------------------
#pragma once

class CYourDockablePane;

// CYourOleDropTarget command target

class CYourOleDropTarget : public COleDropTarget
{
	DECLARE_DYNAMIC(CYourOleDropTarget)

public:
	CYourOleDropTarget();
	virtual ~CYourOleDropTarget();
	BOOL Register(CWnd* pWnd);

protected:
	CYourDockablePane *m_pPane;
	DECLARE_MESSAGE_MAP()
public:
	virtual DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject,
		DWORD dwKeyState, CPoint point);
	virtual DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject,
		DWORD dwKeyState, CPoint point);
	virtual BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject,
		DROPEFFECT dropEffect, CPoint point);
	virtual DROPEFFECT OnDropEx(CWnd* pWnd, COleDataObject* pDataObject,
		DROPEFFECT dropDefault, DROPEFFECT dropList, CPoint point);
	virtual void OnDragLeave(CWnd* pWnd);
	virtual DROPEFFECT OnDragScroll(CWnd* pWnd, DWORD dwKeyState,
		CPoint point);

};



YourOleDropTarget.cpp:
/--------------------------------------------------------------
// YourOleDropTarget.cpp : implementation file
//

#include "stdafx.h"
#include "YourDockablePane.h"
#include "YourOleDropTarget.h"

// CYourOleDropTarget

IMPLEMENT_DYNAMIC(CYourOleDropTarget, COleDropTarget)


CYourOleDropTarget::CYourOleDropTarget() :
	m_pPane( NULL )
{
}

CYourOleDropTarget::~CYourOleDropTarget()
{
}

BEGIN_MESSAGE_MAP(CYourOleDropTarget, COleDropTarget)
END_MESSAGE_MAP()

BOOL CYourOleDropTarget::Register( CWnd* pWnd )
{
	m_pPane = dynamic_cast< CYourDockablePane * >( pWnd );
	return COleDropTarget::Register( pWnd );
}


// CYourOleDropTarget message handlers

DROPEFFECT CYourOleDropTarget::OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
{
	return m_pPane->OnDragEnter( pDataObject, dwKeyState, point);
}

void CYourOleDropTarget::OnDragLeave(CWnd* pWnd)
{
	m_pPane->OnDragLeave();
}

DROPEFFECT CYourOleDropTarget::OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
{
	return m_pPane->OnDragOver( pDataObject, dwKeyState, point);
}

DROPEFFECT CYourOleDropTarget::OnDragScroll(CWnd* pWnd, DWORD dwKeyState, CPoint point)
{
	return m_pPane->OnDragScroll( dwKeyState, point);
}

BOOL CYourOleDropTarget::OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)
{
	return m_pPane->OnDrop( pDataObject, dropEffect, point);
}

DROPEFFECT CYourOleDropTarget::OnDropEx( CWnd *pWnd, 
							COleDataObject* pDataObject,
							DROPEFFECT dropDefault,
							DROPEFFECT dropList,
							CPoint point 
							)
{
	DROPEFFECT effect;
	
	effect = m_pPane->OnDropEx( pDataObject, dropDefault, dropList, point );

	if ( effect == DROPEFFECT_NONE )
		return m_pPane->OnDrop( pDataObject, dropDefault, point );

	return effect;
}



Add this snippet to the definition file (the .h file) of your application?s CFrameWnd or CFrameWndEx subclass:
. . .
		typedef list< CPane *> CYourPanes;
		typedef CYourPanes::iterator  CYourPaneIter;

		typedef list< CYourDockablePane *> CYourDockablePanes;
		typedef CYourDockablePanes::iterator CYourDockablePanesIter;

		CYourPanes			m_Panes;
		CYourDockablePanes 	m_YourDockablePanes;

Add this to the implementation file (the .cpp file) of your application's CFrameWnd or CFrameWndEx subclass, changing the CYourFrameWnd class name to the name of your frame window subclass:
void CYourFrameWnd::OnUpdate( CView* pSender, LPARAM lHint, CObject* pHint )
{
	for ( CYourDockablePanesIter it = m_YourDockablePanes.begin(); 
		it != m_YourDockablePanes.end(); it++ )
       {
		(*it)->OnUpdate( pSender, lHint, pHint );
	}
}
BOOL CYourFrameWnd::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
	/* We intercept all the commands sent to the frame here, and give all 
	 * our child panes first crack at handling them.
	 */
	for ( CYourPaneIter it = m_Panes.begin(); it != m_Panes.end(); it++ )
	{
         	if ( (*it)->OnCmdMsg( nID, nCode, pExtra, pHandlerInfo ))
			return true;
	}

	return CFrameWndEx::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
BOOL CYourFrameWnd::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
	for ( CYourDockablePanesIter it = m_YourDockablePanes.begin(); it != m_YourDockablePanes.end(); it++ )
	{
		if ( (*it)->ReceiveNotification( wParam, lParam, pResult ) )
			return true;
	}

	return CFrameWndEx::OnNotify(wParam, lParam, pResult);
}
At this point, you should search through your old CView class to find any references to a COleDropTarget. These references should be changed to refer to the m_OleDropTarget member that you put within the CYourDockablePane class.

A couple final things you need to do: inform your main frame class about the locations of your CYourDockablePane-derived classes, as well as your toolbars and other non-view features, which are generally children of the CPane class.

Wherever you instantiate and call Create() on your CYourDockablePane descendant, add it to your list of CYourDockablePanes:

  m_YourDockablePanes.push_back( &yourNewlyCreatedDockablePane );

And wherever you instantiate and Create() toolbars or other things that need to process commands or UI updates, including your dockable panes, add them to the list of CPanes as well:

  m_Panes.push_back( &yourNewlyCreatedControlOrPane );

This basic strategy can be used to convert old CView-based classes into any modern control-based user interface architecture, or merely to have your classes derive from CWnd directly.

There may be other side effects of this class conversion that I’ve not considered. Please feel free to modify the above code to your specific situation.

Information and code from this blog entry may be reused and redistributed under the following license.

Creative Commons License
There’s no leaving here; ask, I’m an ear by John Byrd is licensed under a Creative Commons Attribution 3.0 United States License.
Based on a work at www.johnbyrd.org.

One night in Bangkok makes a hard man humble

My thoughts this morning go out to my brother, who has been sent to Afghanistan for a month. Part of the troop surge there. He’s going in a support role, in order to provide some equipment and weapons training, so he’s not expected to see combat; however, I’m still thinking of him. He’s a large fellow and at least as smart as me.

A couple weeks ago I joined the Screen Actors’ Guild. I’m hoping I can leverage some of the Ambassador’s Day work into a new agent.

I just wrote the world’s youngest chess playing program, Superpawn. Superpawn plays like a smart young child. It plays a mostly legal game of chess, though it doesn’t understand concepts like castling and the fifty move rule. Superpawn loves to get the queen out early and parade her around the board. It is trivially Winboard compatible. Once Superpawn survives the epd2wb test suite, I’ll probably release it with a CC0 license.

When my wife was a little girl, she used to play chess with her older and somewhat more serious sister. At a certain point in the game, Amanda would grab a pawn and scream “SUPERPAWN!” and fly it around the board, knocking all the pieces over.

Me used to be a angry young man

With thanks and respect to my father, my company now has a small office at 2102 Business Center Drive in Irvine. I’ve spent the last few weeks launching the company. I spent Christmas break moving in the computers and the printer and the Ikea furniture. I even hired a part-time employee with a flurry of W-2s and I-9s to manage some accounts.

I was worried that I’d turn into a porn-surfing late-sleeping slug when self-employed, but it’s been just the opposite. I am happy to report that I work just as hard for myself as for The Man — twelve-hour days in many cases, and I don’t feel that I’ve worked that hard at the end of the day.

It’s an exciting time, and I’m glad to be alive so I can live it. I am physically tired, but I wake up every morning now excited to go into work.


View Larger Map

<%image(20100106-Photo_010110_005.jpg|1280|1024|Me hiding me head in the sand)%>